-
Notifications
You must be signed in to change notification settings - Fork 42
[PACT] feat: add Contract tests for Kibana Fleet #339
Conversation
We are creating it here, instead of in Kibana for simplicity
Pinging @MadameSheema and @jfsiii, as they were interested in contract testing |
@mdelapenya Thanks for the ping. I'm excited to watch this and learn more. Is there any tooling to go from OpenAPI to the Pact JSON format? I don't know much about Pact and would like to avoid describing the HTTP two different ways in two different locations. i.e. OpenAPI in the plugin and Pact in this repo |
@jfsiii https://docs.pact.io/faq/convinceme/#but-i-use-swaggeropenapi BTW, did not mention this pr is the result of an space time project, probably not going into the project... So this PoC performs the verification, but it should be done at kibana side. |
$ make pact-provider # will run the verification of the contracts by itself | ||
$ make verify-provider # will tear down the runtime dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verify-provider
seems to call some other make goals -> https://github.com/elastic/e2e-testing/pull/339/files#diff-b67911656ef5d18c4ae36cb6741b7965R47
Is the comment correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's on purpose: verify is the last piece in the chain, defining a well-known life cycle: prepare > verify > destroy
I did this that way to support decoupling the destroy goal in the post stage of the CI pipeline (or to be run manually)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
This reverts commit c52de78.
What does this PR do?
It adds a contract tests with Pact.io, allowing two things:
It simply adds 3 tests in the contract:
The generated contracts are stored locally for simplicity, instead of using a Pact Broker (see docs).
Why is it important?
This is a PoC, but it will allow decoupling Kibana from its consumers, verifying they are not broken in a proactive manner, instead of in a reactive one (when their tests fail, if executed)
Checklist
make notice
in the proper directory)Author's Checklist
How to test this PR locally
From root directory:
Follow-ups
Move the verification process to Kibana (or the sotware identified as provider)