Skip to content

Configuration to automatically delete pact directory when re-running contract tests #173

Description

@dsinecos

Software versions

  • OS: Ubuntu 20.04
  • Consumer Pact library: pact-go v2.0.0-20210621102432-26b32fd1552a
  • Provider Pact library: -
  • Golang Version: go1.16.2 linux/amd64
  • Golang environment: -

Expected behaviour

When running contract tests using go test, presently I need to either manually delete the pact directory or configure a Before hook to delete the pact directory. If I don't do this certain changes will not be overwritten when re-running the pact tests.

For eg. when I change the text inside matchers eg. pact.S("Original text") to pact.S("Changed text"). It doesn't get updated in the generated pact files. I need to delete the pact folder and rerun the tests for these changes to take effect.

Actual behaviour

Based on a conversation with Matt in slack ( Refer for conversation ) the functionality to automatically delete the pact directory exists in the shared core. The configuration will have to be exposed.

This configuration will automatically delete the pact directory on rerunning the contract tests.

Steps to reproduce

Relevent log files

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIndicates new feature requeststriageThis issue is yet to be triaged by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions