[PoC] feat: implement Contract tests for Fleet with Pact.io #80384
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
It basically adds Pact as a dependency and creates a Pact verifier for Fleet. It will fetch contracts from a Github URL (pushed here: elastic/e2e-testing#339).
How to test this locally
Firstly, we have to initialise Fleet using the UI, and for that we need to have ES and Kibana up and running.
In another terminal:
To run the contract tests:
$ cd x-pack $ npm install $ npm run test:pact --prefix plugins/ingest_manager
Other concerns
I was not able to bypass the pre-commit error about Pact needing to be added as a dependency to package.json, which I think it is already done.