Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 1.51 KB

README.md

File metadata and controls

37 lines (26 loc) · 1.51 KB

How to use Pact in Sam

To run the SamProviderSpecs locally, you will need to make sure that you populate a couple of environment variables so that your locally running tests know how to authenticate with the DSP DevOps hosted Pact Broker.

The credentials for authenticating with the Pact Broker can be found here:

vault read secret/dsp/pact-broker/users/read-only

On the command line, you can try the following:

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)

In IntelliJ, you can create a Run Configuration for SamProviderSpec.scala and save Environment Variables for:

  • PACT_BROKER_URL
  • PACT_BROKER_USERNAME
  • PACT_BROKER_USERNAME

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

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

Publishing Pacts

Publishing is disabled by default. To enable publishing, set the PACT_PUBLISH_RESULTS environment variable to true.

References