-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to run the same tests with multi docker image variants #5547
Add ability to run the same tests with multi docker image variants #5547
Conversation
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
This pull request does not have a backport label. Could you fix it @blakerouse? 🙏
|
|
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.
Controlling+filtering by docker image should be added to https://github.com/elastic/elastic-agent/blob/main/docs/test-framework-dev-guide.md for the case where you only want to test one of these.
{Type: define.Kubernetes}, | ||
{Type: define.Kubernetes, DockerImage: "docker.elastic.co/beats/elastic-agent"}, | ||
{Type: define.Kubernetes, DockerImage: "docker.elastic.co/beats/elastic-agent-complete"}, | ||
{Type: define.Kubernetes, DockerImage: "docker.elastic.co/beats/elastic-agent-ubi"}, |
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.
For 9.0 the elastic-agent and elastic-agent-ubi will eventually be the same, so this is redundant there but not in 8.x where Ubuntu will continue to exist.
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.
I can do a followup in main to merge those into the same.
Overall I like this PR! I left some comments which are more points for a quick discussion around which fields a k8s test could define, namely Distro, Version, etc. but I am happy for +1 as soon as we agree on whether we do or don't need them 🙂 |
This is currently not supported. It will be even more work to allow filtering to a specific docker image for running tests. I am looking to just to get this done for the |
@pkoutsovasilis Please give this another look, I took a different path. This now more aligns with OS testing. |
So after some offline syncing with @blakerouse I think that the code changes are looking good. Now some things I noticed while running these tests locally (with 8.16.0-SNAPSHOT version) as our CI still needs some love are the following:
PS: so nice that you moved the k8s integration tests alongside the other integration tests 🚀 |
@pkoutsovasilis I have reduced the tests to only test basic and wolfi at the moment. This is to reduce the time spent and get around the issue with UBI. Being that the UBI is going away in 9.0, and we haven't really been testing. The complete images are just additions to the original so they should basically work the same, so removing it for now to improve performance should be okay. I think the overall solution to reducing the time it takes is to split up the work across multiple runners, but I want that done in a way where its not hard-coded in the YAML. I am already working on that here with buildkite, where it uses the batches to generate a buildkite pipeline. I think the same approach should be taken here, so its only required to update the golang testing framework for new versions and not also adjust matching YAML pipelines. See: #5391 |
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.
changes look good to me
This pull request is now in conflicts. Could you fix it? 🙏
|
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.
Tried it locally and works as expected. LGTM.
Quality Gate passedIssues Measures |
This pull request is now in conflicts. Could you fix it? 🙏
|
CI failure in Merge coverage reports step (see below) seems totally unrelated to this PR as the file mentioned there isn't even touched by this PR:
Also, the failure isn't happening consistently either. Force merging... |
…5547) * Add ability to run the same tests with multi docker image variants. * Fix buildkite. * Add back distro for kubernetes types. * Refactor how kubernetes tests are selected. * Allow specific docker variant. * Add kubernetes testing to the dev guide. * Add back K8S_VERSION to buildkite job. * Fix docker image location. * Don't create so many clusters. * Ensure basic is always picked first. * Fix cloud variant image name. * revert builkite changes * Move kubernetes integration tests in CI next to other integration tests. * Rename wolfi-complete to complete-wolfi. * Reduce docker variants on some tests. * Only test basic and wolfi. (cherry picked from commit 67b709f) # Conflicts: # .buildkite/scripts/steps/k8s-extended-tests.sh # magefile.go
…cker image variants (#5585) * Add ability to run the same tests with multi docker image variants (#5547) * Add ability to run the same tests with multi docker image variants. * Fix buildkite. * Add back distro for kubernetes types. * Refactor how kubernetes tests are selected. * Allow specific docker variant. * Add kubernetes testing to the dev guide. * Add back K8S_VERSION to buildkite job. * Fix docker image location. * Don't create so many clusters. * Ensure basic is always picked first. * Fix cloud variant image name. * revert builkite changes * Move kubernetes integration tests in CI next to other integration tests. * Rename wolfi-complete to complete-wolfi. * Reduce docker variants on some tests. * Only test basic and wolfi. (cherry picked from commit 67b709f) # Conflicts: # .buildkite/scripts/steps/k8s-extended-tests.sh # magefile.go * Fix merge issue. --------- Co-authored-by: Blake Rouse <[email protected]>
…iants (elastic#5547)" This reverts commit 67b709f.
What does this PR do?
Extends the integration testing framework for Kubernetes to allow multiple docker images to be used for the tests.
Why is it important?
Providers better coverage of our docker variants and it allows the tests author to write tests targeting different image variants.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files[ ] I have added an entry in./changelog/fragments
using the changelog toolHow to test this PR locally
INSTANCE_PROVISIONER="kind" SNAPSHOT="true" mage integration:kubernetes
INSTANCE_PROVISIONER="kind" SNAPSHOT="true" mage integration:kubernetesMatrix
INSTANCE_PROVISIONER="kind" SNAPSHOT="true" TEST_PLATFORMS="kubernetes/arm64/1.30.2/wolfi" mage integration:kubernetesMatrix