Skip to content

Commit

Permalink
Add to pact readme. (#1233)
Browse files Browse the repository at this point in the history
* Add to pact readme.

* source env for pact tests
  • Loading branch information
Ghost-in-a-Jar authored Oct 31, 2023
1 parent 68d1a53 commit 8b3a9aa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/verify_consumer_pacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ jobs:
-e PACT_BROKER_URL=${{ env.PACT_BROKER_URL }} \
-e PACT_BROKER_USERNAME=${{ env.PACT_BROKER_USERNAME }} \
-e PACT_BROKER_PASSWORD=${{ env.PACT_BROKER_PASSWORD }} \
-e POSTGRES_READ_URL=localhost:5432 \
-e POSTGRES_USERNAME=sam-test \
-e POSTGRES_PASSWORD=sam-test \
sbtscala/scala-sbt:openjdk-17.0.2_1.7.2_2.13.10 \
sbt "set scalafmtOnCompile := false" "project pact4s" "testOnly *SamProviderSpec"
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,3 +290,6 @@ To view the SQL commands generated by ScalikeJDBC, set `scalikejdbc.global.loggi
## Smoke Tests
Sam includes smoke tests that can be run anywhere and test a running Sam instance on any network accessible host. See
the [Smoke Test README](smoke_test/README.md) for more information.

## Pact Contract Tests
See the [Pact README](pact4s/README.md) for more information.
8 changes: 8 additions & 0 deletions pact4s/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ The credentials for authenticating with the Pact Broker can be found here:
On the command line, you can try the following:

```shell
source env/local.env
source src/main/resources/rendered/secrets.env
export PACT_BROKER_URL="https://pact-broker.dsp-eng-tools.broadinstitute.org/"
export PACT_BROKER_USERNAME=$(vault read -field=basic_auth_read_only_username secret/dsp/pact-broker/users/read-only)
export PACT_BROKER_PASSWORD=$(vault read -field=basic_auth_read_only_password secret/dsp/pact-broker/users/read-only)
Expand All @@ -21,6 +23,12 @@ In IntelliJ, you can create a Run Configuration for `SamProviderSpec.scala` and
* `PACT_BROKER_USERNAME`
* `PACT_BROKER_USERNAME`

Or you can run the following command from the root of the project:

```shell
sbt "set scalafmtOnCompile := false" "project pact4s" "testOnly *SamProviderSpec"
```

## References
* https://broadworkbench.atlassian.net/wiki/spaces/IRT/pages/2660368406/Getting+Started+with+Pact+Contract+Testing
* https://broadworkbench.atlassian.net/wiki/spaces/IRT/pages/2681143308/Pact+Broker+Infrastructure

0 comments on commit 8b3a9aa

Please sign in to comment.