-
Notifications
You must be signed in to change notification settings - Fork 237
remove ImagePrepper in favor of processing individual preppers directly #101
Conversation
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.
Nice, this looks much better.
@@ -80,14 +80,16 @@ func diffImages(image1Arg, image2Arg string, diffArgs []string) error { | |||
for imageArg := range imageMap { |
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.
Could you add a TODO or open a bug to fix up this code, the error handling isn't really correct. You're not making it worse here, bu I want to make sure we don't forget.
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.
done.
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 something might have just gotten a bit slower and a timeout is happening. Specifically I'm seeing the node differ test take a while.
I figured that out by switching the tests to run in serial and seeing how long each one takes.
We might need to add a local cache or increase the timeouts.
Ah that might be it. We should definitely add caching for the processed images, I think that's out of the scope of this PR though. Looks like Travis actually doesn't have real build timeouts, they just timeout if there are no log entries printed in 10 minutes: https://docs.travis-ci.com/user/customizing-the-build#Build-Timeouts. This is probably what we're running into? |
Go test has it's own ten minute timeout :( You can try passing a longer one in the go test command. |
Looks like the build is actually only running for 1.5 minutes before failing: https://travis-ci.org/GoogleCloudPlatform/container-diff/builds/278677161. So I don't think it's a timeout |
I was able to reproduce the error by pulling down this branch |
@@ -185,3 +201,20 @@ func TestDiffAndAnalysis(t *testing.T) { | |||
}) | |||
} | |||
} | |||
|
|||
func TestMain(m *testing.M) { |
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 is the culprit
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.
good call, also turns out Docker actually wasn't available in our Travis runs. fixed
tests/integration_test.go
Outdated
func TestMain(m *testing.M) { | ||
// setup | ||
ctx := context.Background() | ||
cli, _ := client.NewEnvClient() |
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 code adds support for calling code to use specific preppers directly, rather than relying on the container-diff library to infer the prepper source. This allows callers to explicitly retrieve images from their local docker daemon vs. a remote registry. Container-diff implements this by specifying prefixes on the image strings: prefixing an image with
daemon://
specifies the local daemon, and prefixing withremote://
specifies remote registry. If no prefix is specified, the local daemon is tried first.cc @dlorenc