@@ -19,7 +19,6 @@ import (
19
19
"os"
20
20
"path"
21
21
"path/filepath"
22
- "runtime"
23
22
"strconv"
24
23
"strings"
25
24
"syscall"
@@ -229,15 +228,21 @@ func TestIntegration(t *testing.T) {
229
228
}
230
229
231
230
func testIntegration (t * testing.T , funcs ... func (t * testing.T , sb integration.Sandbox )) {
232
- mirroredImages := integration .OfficialImages ("busybox:latest" , "alpine:latest" )
233
- mirroredImages ["tonistiigi/test:nolayers" ] = "docker.io/tonistiigi/test:nolayers"
234
- mirroredImages ["cpuguy83/buildkit-foreign:latest" ] = "docker.io/cpuguy83/buildkit-foreign:latest"
231
+ mirroredImagesUnix := integration .OfficialImages ("busybox:latest" , "alpine:latest" )
232
+ mirroredImagesUnix ["tonistiigi/test:nolayers" ] = "docker.io/tonistiigi/test:nolayers"
233
+ mirroredImagesUnix ["cpuguy83/buildkit-foreign:latest" ] = "docker.io/cpuguy83/buildkit-foreign:latest"
234
+ mirroredImagesWin := integration .OfficialImages ("nanoserver:latest" , "nanoserver:plus" )
235
+
236
+ mirroredImages := integration .UnixOrWindows (mirroredImagesUnix , mirroredImagesWin )
235
237
mirrors := integration .WithMirroredImages (mirroredImages )
236
238
237
239
tests := integration .TestFuncs (funcs ... )
238
240
tests = append (tests , diffOpTestCases ()... )
239
241
integration .Run (t , tests , mirrors )
240
242
243
+ // the rest of the tests are meant for non-Windows, skipping on Windows.
244
+ integration .SkipOnPlatform (t , "windows" )
245
+
241
246
integration .Run (t , integration .TestFuncs (
242
247
testSecurityMode ,
243
248
testSecurityModeSysfs ,
@@ -260,16 +265,14 @@ func testIntegration(t *testing.T, funcs ...func(t *testing.T, sb integration.Sa
260
265
}),
261
266
)
262
267
263
- if runtime .GOOS != "windows" {
264
- integration .Run (
265
- t ,
266
- integration .TestFuncs (testBridgeNetworkingDNSNoRootless ),
267
- mirrors ,
268
- integration .WithMatrix ("netmode" , map [string ]interface {}{
269
- "dns" : bridgeDNSNetwork ,
270
- }),
271
- )
272
- }
268
+ integration .Run (
269
+ t ,
270
+ integration .TestFuncs (testBridgeNetworkingDNSNoRootless ),
271
+ mirrors ,
272
+ integration .WithMatrix ("netmode" , map [string ]interface {}{
273
+ "dns" : bridgeDNSNetwork ,
274
+ }),
275
+ )
273
276
}
274
277
275
278
func newContainerd (cdAddress string ) (* containerd.Client , error ) {
@@ -414,7 +417,6 @@ func testHostNetworking(t *testing.T, sb integration.Sandbox) {
414
417
}
415
418
416
419
func testExportedImageLabels (t * testing.T , sb integration.Sandbox ) {
417
- integration .SkipOnPlatform (t , "windows" )
418
420
c , err := New (sb .Context (), sb .Address ())
419
421
require .NoError (t , err )
420
422
defer c .Close ()
@@ -426,7 +428,14 @@ func testExportedImageLabels(t *testing.T, sb integration.Sandbox) {
426
428
427
429
ctx := sb .Context ()
428
430
429
- def , err := llb .Image ("busybox" ).Run (llb .Shlexf ("echo foo > /foo" )).Marshal (ctx )
431
+ imgName := integration .UnixOrWindows ("busybox" , "nanoserver" )
432
+ prefix := integration .UnixOrWindows (
433
+ "" ,
434
+ "cmd /C " , // TODO(profnandaa): currently needs the shell prefix, to be fixed
435
+ )
436
+ def , err := llb .Image (imgName ).
437
+ Run (llb .Shlexf (fmt .Sprintf ("%secho foo > /foo" , prefix ))).
438
+ Marshal (ctx )
430
439
require .NoError (t , err )
431
440
432
441
target := "docker.io/buildkit/build/exporter:labels"
@@ -7766,9 +7775,7 @@ func chainRunShells(base llb.State, cmdss ...[]string) llb.State {
7766
7775
}
7767
7776
7768
7777
func requiresLinux (t * testing.T ) {
7769
- if runtime .GOOS != "linux" {
7770
- t .Skipf ("unsupported GOOS: %s" , runtime .GOOS )
7771
- }
7778
+ integration .SkipOnPlatform (t , "!linux" )
7772
7779
}
7773
7780
7774
7781
// ensurePruneAll tries to ensure Prune completes with retries.
0 commit comments