Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Pact consumer tests for TPS #1577

Draft
wants to merge 15 commits into
base: develop
Choose a base branch
from

Conversation

samanehsan
Copy link
Contributor

@samanehsan samanehsan commented Jan 17, 2024

Ticket: https://broadworkbench.atlassian.net/browse/DR-3357

Changes:

  1. Add consumer tests for calls to the Terra Policy Service (I used the WDS consumer tests against TDR as an example):
  • POST /api/policy/v1alpha1/pao
    • Successfully create a protected-data pao
    • Successfully create a group-constraint pao
    • Error when creating a duplicate policy
  • PATCH /api/policy/v1alpha1/pao/{snapshot_id}
    • Successfully add a group-constraint policy to an existing pao (that already has a protected-data pao)
    • Error when adding a duplicate policy to a pao
  • DELETE /api/policy/v1alpha1/pao/{snapshot_id}
    • Successfully delete a pao
    • Error when deleting a non-existent pao
  1. Add github action to publish pact contract produced by running the consumer tests. Here is the latest contract definition in the pact broker.
  2. Updated pact dependencies (also required updating Gradle to version 7.5 and updating the groovy library)
  3. Changed the PolicyServiceConfiguration from a record back to a class in order to mock the API access token.

Note: This is a draft PR because the TPS provider is still under development and the exact state names will change. We also need to work out the level of granularity for each request, for instance, how should we test creating different types of policies for a snapshot?

@samanehsan samanehsan force-pushed the se/DR-3357-tps-consumer-tests branch 2 times, most recently from 5b60f83 to fc9e1b6 Compare January 17, 2024 18:47
- Update pact provider version
- Update groovy library - required by pact (will this break the logback config?)
Also add id and policy name parameters
Replace pact dsl with JSON string
Copy link

sonarcloud bot commented Jan 23, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

4 New issues
0 Security Hotspots
60.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant