-
Notifications
You must be signed in to change notification settings - Fork 25
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
Force evaluation before test execution #404
Conversation
84ab039
to
5c25ff9
Compare
This makes it so error messages from the build are not wrapped in error messages for tests. Before this change the build is performed lazily until the point when the tests try to interact with the rootfs under test making it appear like a build failure is a test error when in reality we didn't even get to the test. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
5c25ff9
to
5cd4437
Compare
@@ -41,6 +41,14 @@ func RunTests(ctx context.Context, client gwclient.Client, spec *dalec.Spec, ref | |||
return nil | |||
} | |||
|
|||
if err := ref.Evaluate(ctx); err != nil { |
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.
Since we're already doing ref.Evaluate
after we create package build state for deb
/rpm
, really the only extra errors this will surface here would be install errors from installing the package in the target container, correct? That should in general be the only extra state that hasn't yet been solved at this point?
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.
At this point, the package build state is only evaluated on the packaging build targets, not the container targets.
But other than that, yes you are correct.
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.
Ah got it, the build state hasn't yet been evaluated if we've reached this code path from a container target. And in the case of packaging build targets, this ref.Evaluate
would actually surface errors from installing in the test container, not the target container since there is no target container in that case. Thanks for clarifying
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 think this LGTM!
This makes it so error messages from the build are not wrapped in error messages for tests.
Before this change the build is performed lazily until the point when the tests try to interact with the rootfs under test making it appear like a build failure is a test error when in reality we didn't even get to the test.
Closes #400