-
Maybe this is a silly question, but is it possible to skip the generation of contract tests? With no configuration, Portman generates contract tests. I know that it's possible to configure your own contract tests, but is there a way to ask for NO contract tests to be generated? Background and Use Case: When I'm working on a new endpoint, I often want to build a collection that only includes the integration tests for that endpoint during the iterative development phase. I can eliminate the variation and integration tests for other endpoints by commenting them out in my configuration like so: tests:
contractTests:
$ref: ./specs/v2/tests/configs/contracts/generic-contract-tests.yaml
integrationTests:
# - name: /me tests
# $ref: ./specs/v2/tests/configs/variations/me-variations.yaml
# - name: /categories tests
# $ref: ./specs/v2/tests/configs/variations/categories-variations.yaml
# - name: /manual_accounts tests
# $ref: ./specs/v2/tests/configs/variations/manual_account-variations.yaml
# - name: /tags tests
# $ref: ./specs/v2/tests/configs/variations/tags-variations.yaml
# - name: /recurring tests
# $ref: ./specs/v2/tests/configs/variations/recurring-variations.yaml
- name: /transactions tests
$ref: ./specs/v2/tests/configs/variations/transactions-variations.yaml But if I comment out the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I've not validated this but I think you have 2 options:
example BUT i'm not sure if this will still generate the other tests. or disable the contract tests. tests:
contractTests:
- openApiOperation: "*::/*"
statusSuccess:
enabled: false
- openApiOperation: "*::/*"
responseTime:
enabled: false
maxMs: 300
- openApiOperation: "*::/*"
contentType:
enabled: false
- openApiOperation: "*::/*"
jsonBody:
enabled: false
- openApiOperation: "*::/*"
schemaValidation:
enabled: false
- openApiOperation: "*::/*"
headersPresent:
enabled: false |
Beta Was this translation helpful? Give feedback.
-
if you want to skip certain request from being converted, you can use the filter option. Which is powered by https://github.com/thim81/openapi-format#openapi-filter-options |
Beta Was this translation helpful? Give feedback.
I've not validated this but I think you have 2 options:
--includeTests, -t Inject Portman test suite (default: true)
example
portman crm.yml --includeTests false
BUT i'm not sure if this will still generate the other tests.
or
disable the contract tests.