Skip to content

Commit

Permalink
feat: Update readmes on turning off diff calculation #1375
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Holshausen committed Jun 5, 2021
1 parent 1ef4af2 commit c5b91da
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
8 changes: 7 additions & 1 deletion provider/gradle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,18 @@ The following project properties can be specified with `-Pproperty=value` on the
|`pact.filter.providerState`|Only verify interactions whose provider state match the provided regular expression. An empty string matches interactions that have no state|
|`pact.filter.pacturl`|This filter allows just the just the changed pact specified in a webhook to be run. It should be used in conjunction with `pact.filter.consumers` |
|`pact.verifier.publishResults`|Publishing of verification results will be skipped unless this property is set to 'true'|
|`pact.verifier.ignoreNoConsumers`|If set to `true`, don't fail the build if there are no consumers to verify [4.1.19+]|

The following project properties must be specified as system properties:

|Property|Description|
|--------|-----------|
|`pact.verifier.disableUrlPathDecoding`|Disables decoding of request paths|
|`pact.pactbroker.httpclient.usePreemptiveAuthentication`|Enables preemptive authentication with the pact broker when set to `true`|
|`pact.provider.tag`|Sets the provider tag to push before publishing verification results (can use a comma separated list)|
|`pact.content_type.override.<TYPE>.<SUBTYPE>=<VAL>` where `<VAL>` may be `text`, `json` or `binary`|Overrides the handling of a particular content type [4.1.3+]|
|`pact.verifier.enableRedirectHandling`|Enables automatically handling redirects [4.1.8+]|
|`pact.verifier.ignoreNoConsumers`|If set to `true`, don't fail the build if there are no consumers to verify [4.1.19+]|
|`pact.verifier.generateDiff`|Controls the generation of diffs. Can be set to `true`, `false` or a size threshold (for instance `1mb` or `100kb`) which only enables diffs for payloads of size less than that [4.2.7+]|

## Specifying the provider hostname at runtime

Expand Down
12 changes: 12 additions & 0 deletions provider/junit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,18 @@ encoded when written to the Pact file and then decoded again when the file is lo
an override property: `pact.content_type.override.<TYPE>.<SUBTYPE>=text|json|binary`. For instance, setting
`pact.content_type.override.application.pdf=text` will treat PDF bodies as a text type and not encode/decode them.

### Controlling the generation of diffs

**NOTE: version 4.2.7+**

When there are mismatches with large bodies the calculation of the diff can take a long time . You can turn off the
generation of the diffs with the JVM system property: `pact.verifier.generateDiff=true|false|<dataSize>`, where
`dataSize`, if specified, must be a valid data size (for instance `100kb` or `1mb`). This will turn off the diff
calculation for payloads that exceed this size.

For instance, setting `pact.verifier.generateDiff=false` will turn off the generation of diffs for all bodies, while
`pact.verifier.generateDiff=512kb` will only turn off the diffs if the actual or expected body is larger than 512kb.

## Test target

The field in test class of type `au.com.dius.pact.provider.junit.target.Target` annotated with `au.com.dius.pact.provider.junit.target.TestTarget`
Expand Down
12 changes: 12 additions & 0 deletions provider/junit5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,18 @@ encoded when written to the Pact file and then decoded again when the file is lo
an override property: `pact.content_type.override.<TYPE>.<SUBTYPE>=text|json|binary`. For instance, setting
`pact.content_type.override.application.pdf=text` will treat PDF bodies as a text type and not encode/decode them.

### Controlling the generation of diffs

**NOTE: version 4.2.7+**

When there are mismatches with large bodies the calculation of the diff can take a long time . You can turn off the
generation of the diffs with the JVM system property: `pact.verifier.generateDiff=true|false|<dataSize>`, where
`dataSize`, if specified, must be a valid data size (for instance `100kb` or `1mb`). This will turn off the diff
calculation for payloads that exceed this size.

For instance, setting `pact.verifier.generateDiff=false` will turn off the generation of diffs for all bodies, while
`pact.verifier.generateDiff=512kb` will only turn off the diffs if the actual or expected body is larger than 512kb.

# Pending Pact Support (version 4.1.0 and later)

If your Pact broker supports pending pacts, you can enable support for that by enabling that on your Pact broker annotation or with JVM system properties. You also need to provide the tags that will be published with your provider's verification results. The broker will then label any pacts found that don't have a successful verification result as pending. That way, if they fail verification, the verifier will ignore those failures and not fail the build.
Expand Down
1 change: 1 addition & 0 deletions provider/maven/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ The following plugin properties can be specified with `-Dproperty=value` on the
|`pact.consumer.tags`|Overrides the tags used when publishing pacts [version 4.0.7+]|
|`pact.content_type.override.<TYPE>.<SUBTYPE>=text\|json\|binary`|Overrides the handling of a particular content type [version 4.1.3+]|
|`pact.verifier.enableRedirectHandling`|Enables automatically handling redirects [4.1.8+]|
|`pact.verifier.generateDiff`|Controls the generation of diffs. Can be set to `true`, `false` or a size threshold (for instance `1mb` or `100kb`) which only enables diffs for payloads of size less than that [4.2.7+]|

Example in the configuration section:

Expand Down

0 comments on commit c5b91da

Please sign in to comment.