POC: Kubernetes integration tests #323
Merged
+446
−49
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.
Description
The kubernetes package offers helper functions that are used by the disruptors. Testing this package with the kubernetes client mock is insufficient due to its many limitations. The mock does not validate the objects submitted to the API, and it does not support the generation of events (required for example by watchers) in a reliable way.
This PR is a Proof of concept of using TestContainers for the kubernetes integration tests using the k3s module that allows spawning a fully functional kubernetes cluster running in a container.
Its main advantage with respect to the existing tests is the speed of spawning the Kubernetes cluster.
Checklist:
make lint
) and all checks pass.make test
) and all tests pass.make e2e-xxx
foragent
,disruptors
,kubernetes
orcluster
related changes)