-
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
feat: Add e2e test for zarf injector #2956
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Joonas Bergius <joonas@bergi.us>
✅ Deploy Preview for zarf-docs canceled.
|
for what it's worth, I tried to make sure that these changes would in no way impact the injector's binary size, and building it locally with
|
hex = { version = "0.4.3", default-features = false } | ||
serde_json = { version = "1.0.113", default-features = false, features = [ | ||
"alloc", | ||
] } | ||
axum = { version = "0.7.5", features = ["tokio"] } | ||
tokio = { version = "1.35.0", features = ["fs", "rt"] } | ||
tokio-util = { version = "0.7.10", features = ["io"]} | ||
tokio-util = { version = "0.7.10", features = ["io"] } |
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 revert these if that'd be desirable, just my local editor configuration
let init_root = | ||
std::env::var("ZARF_INJECTOR_INIT_ROOT").unwrap_or_else(|_| String::from("/zarf-init")); | ||
let seed_root = | ||
std::env::var("ZARF_INJECTOR_SEED_ROOT").unwrap_or_else(|_| String::from("/zarf-seed")); |
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.
These are necessary to make it possible to pass in a temporary directory location for testing purposes while still falling back to the default behavior when running as part of zarf init
.
I'd be happy to include a GitHub Actions sample workflow for running this against Zarf Injector changes if that would be helpful, generally speaking it would probably look something like:
|
Description
This adds an end-to-end test for Zarf Injector that can be run via
cargo test
.A test run looks roughly something like this (added
-- --nocapture
to show the injector's output):My hope with this change was to make future refactoring cycles a little bit faster since there is a relatively fast local test (couple of seconds tops after the initial compile) for feedback.
Related Issue
Fixes #
Relates to #
Checklist before merging