-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fix custom repo test #415
Fix custom repo test #415
Conversation
875f2a7
to
f5d8334
Compare
0ab2bd1
to
be765cb
Compare
The main fix here is that the test was using the same package name/version for both test cases. Due to this, the package being tested may already be in the apt package cache when the negative test runs. This can cause unexpected results. Also some minor refactoring so that the proper `*testing.T` is used. This fixes a problem with the test build not producing any logs. Signed-off-by: Brian Goff <[email protected]>
c39e8f6
to
f83e36f
Compare
Ok, so the first reason the test was failing is the cached repo info in In general I think we don't want to keep any data about local repo mounts between builds, so fixed this by clearing any local repo data in that dir (local repos apparently start with Now it looks like the custom repo just isn't working for some reason when doing the installation of runtime dependencies. Looking into this. Depending on the ordering of tests this could pass but usually fails in CI. Locally it's harder to make it fail but it does happen. |
f83e36f
to
3268a83
Compare
edfb67b
to
3b3ae9c
Compare
We don't really need to cache these since they are locally anyway. It can also cause inconsistencies between builds if the repo config is different, for instance during tests when swithcing between signed and unsigned repos. Signed-off-by: Brian Goff <[email protected]>
3b3ae9c
to
e8c3269
Compare
Ok, realized the extra failure was due to the same exact cause, there's just 2 places we are installing packages from and the fix needed to be applied in the 2nd case. |
Signed-off-by: Brian Goff <[email protected]>
781f1b2
to
31cee31
Compare
@@ -285,7 +317,8 @@ func buildDepends(worker llb.State, sOpt dalec.SourceOpts, spec *dalec.Spec, tar | |||
) | |||
|
|||
return in.Run( | |||
installWithConstraints(debPath+"/*.deb", depsSpec.Name, customRepoOpts), | |||
installWithConstraints(debPath+"/*.deb", depsSpec.Name, opts...), | |||
customRepoOpts, |
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.
Thank you for cleaning this up and addressing your review suggestion from before to add the customRepoOpts
instead of threading through install...
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 looks good to me, and the fixes seems very straightforward. Thank you for fixing these issues!
A few fixes here:
*testing.T
is being used. This fixes a problem with the test build not producing any logs making it hard to figure out what the error is.