@@ -43,12 +43,19 @@ func TestBuildFromContextDirectoryWithTag(t *testing.T) {
4343
4444 result .Assert (t , icmd.Expected {Err : buildkitDisabledWarning })
4545 output .Assert (t , result .Stdout (), map [int ]func (string ) error {
46- 0 : output .Prefix ("Sending build context to Docker daemon" ),
47- 1 : output .Suffix ("Step 1/4 : FROM registry:5000/alpine:frozen" ),
48- 3 : output .Suffix ("Step 2/4 : COPY run /usr/bin/run" ),
49- 5 : output .Suffix ("Step 3/4 : RUN run" ),
50- 7 : output .Suffix ("running" ),
51- 8 : output .Contains ("Removing intermediate container" ),
46+ 0 : output .Prefix ("Sending build context to Docker daemon" ),
47+ 1 : output .Suffix ("Step 1/4 : FROM registry:5000/alpine:frozen" ),
48+ 3 : output .Suffix ("Step 2/4 : COPY run /usr/bin/run" ),
49+ 5 : output .Suffix ("Step 3/4 : RUN run" ),
50+ 7 : output .Suffix ("running" ),
51+ // TODO(krissetto): ugly, remove when no longer testing against moby 24. see https://github.com/moby/moby/pull/46270
52+ 8 : func (s string ) error {
53+ err := output .Contains ("Removed intermediate container" )(s ) // moby >= v25
54+ if err == nil {
55+ return nil
56+ }
57+ return output .Contains ("Removing intermediate container" )(s ) // moby < v25
58+ },
5259 10 : output .Suffix ("Step 4/4 : COPY data /data" ),
5360 12 : output .Contains ("Successfully built " ),
5461 13 : output .Suffix ("Successfully tagged myimage:latest" ),
0 commit comments