-
Notifications
You must be signed in to change notification settings - Fork 171
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
E2E test optimization for multi-distro support #319
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
cac7753
to
a7f0e21
Compare
Actions triggered from That just leaves annoyances like malicious PRs that mine bitcoin or just sit there spending our GHA minutes that are, while annoying, not security risks. Sounds like GitHub will require approval to run any workflows for first time contributors, but then will let them through after that. Questions:
|
|
EDIT: *Workflows that use the |
I suppose we can do a combination, with part of the test suite being runnable using the |
I'll look through your comments more tomorrow but I don't think this is a fully accurate statement. The test pipeline here still uses the repo REGISTRY credential secrets to sign into repo1 to build packages. |
https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks It's working because you aren't submitting the PR from a fork. |
This is an potential implementation as to how we can write our e2e tests so that they can be run as part of a build pipeline as well as run locally. In both cases, the e2e uses a KinD cluster to test against.
^^^ That comment should not work, since |
b408f5f
to
2b596fa
Compare
This commit brings back the terratest supported test for the example game package. This verifies zarf can init with k3s as a component and deploy a package on it
629f5d6
to
d9b7a6c
Compare
@RothAndrew @jeff-mccoy This is ready for review now. Also, I figured out what we needed to do to test Zarf with it's self-initialized k3s cluster on a native GitHub Runner so we don't need to rely on Terratest standing up an ec2 instance for that. I currently have the slash-dispatch action still there to test the game_example on an ec2 instance but was going to remove it since we don't need that anymore. Any thoughts on that? I know we'll need it in the future when testing other packages/linux distros but I don't think we need it currently? |
This is super good news. I didn't realize that native github runners were actually VMs (unlike gitlab land where we were in containers). I think for now we can just go all in on the native runners and drop the EC2 / terratest requirement and the chat-ops requirement. Since native runners are only Ubuntu, we will need to standup self-hosted runners later on for other Linux Distros to satisfy #101, but I'm a huge fan of not having to leverage terraform for the majority of the tests. One thing I do think we are losing that we need to discuss though is the current terratest setup does a better job of breaking the tests down into smaller identifiable chunks. I know it's possibly more yaml soup--but I think we shouldn't lose that fidelity if can prevent it. Thoughts? |
I'm not opposed to it, but I'm also not convinced we need that level of granularity we had before. Were you referencing the way the current tests have a different response status for each e2e test? That would lead to a large number of workflow yaml files but would solve any future issues with the test suite taking too long to run. Another option is that we could break that down a little more and have each test run in its own step, at the potential cost of a handful more seconds of overhead per test. Currently this PR runs all of the tests in the |
IMO we should not completely strip out the chatops and terratest framework, for 2 reasons:
I won't hold up this PR if you guys feel differently, though I suspect if we rip that stuff out we're going to end up putting some/most of it back in later. Which is fine as long as we can go pull it from the git history. |
I personally just like the fidelity in the PR we get for showing test results here vs digging into the logs, but it's super preference. @RothAndrew, you're probably right, we will likely need to bring back something later on unless we discover a new way to manage the secret concern--but I'd rather pull chatops until we are certain we need it and then go from there. What are your thoughts on the test breakdown in this view vs in the logs? |
Thinking about this a little more I think if we can get the ADR done we can table breaking out the tests more for another issue @YrrepNoj |
e7a52d4
to
f915f8a
Compare
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 is a major overhaul of the test, but nothing is too scary in the code. I think this will end up putting us on a much better local and ci testing path. Thanks for working this.
|
||
.PHONY: test-e2e | ||
test-e2e: package-example-game test-cloud-e2e-example-game ## DEPRECATED - to be replaced by individual e2e test targets | ||
# TODO: This can be cleaned up a little more when `zarf init` is able to provide the path to the `zarf-init.tar.zst` |
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.
You actually don't have to do zarf init
, when you run a package deploy or even zarf zarf-init.tar.zst
, it should do the exact same thing now. Init is nothing more than a fixed shortcut right now to use the init package in the same directory.
/test all |
Seems a little strange to do that but keeps in line with our existing process |
actually n/m that won't be possible 😆. Okay I'm going to merge this. |
* add kind testing * add k3d testing * add k3s testing * remove chat based e2e test * cleanup of e2e test code * adr for e2e testing Co-authored-by: Jeff McCoy <code@jeffm.us> Co-authored-by: Minimind <882485+jeff-mccoy@users.noreply.github.com>
This PR updates the GitHub Actions to run e2e pipeline in on the native GitHub runners (instead of needing to use chat-ops and Terratest to stand up AWS EC2 instances to perform the tests on.)
This PR enables the following: