@@ -8048,12 +8048,12 @@ loop0:
8048
8048
}
8049
8049
8050
8050
func testInvalidExporter (t * testing.T , sb integration.Sandbox ) {
8051
- requiresLinux (t )
8052
8051
c , err := New (sb .Context (), sb .Address ())
8053
8052
require .NoError (t , err )
8054
8053
defer c .Close ()
8055
8054
8056
- def , err := llb .Image ("busybox:latest" ).Marshal (sb .Context ())
8055
+ imgName := integration .UnixOrWindows ("busybox:latest" , "nanoserver:latest" )
8056
+ def , err := llb .Image (imgName ).Marshal (sb .Context ())
8057
8057
require .NoError (t , err )
8058
8058
8059
8059
destDir := t .TempDir ()
@@ -8117,7 +8117,6 @@ func testInvalidExporter(t *testing.T, sb integration.Sandbox) {
8117
8117
8118
8118
// moby/buildkit#492
8119
8119
func testParallelLocalBuilds (t * testing.T , sb integration.Sandbox ) {
8120
- integration .SkipOnPlatform (t , "windows" )
8121
8120
ctx , cancel := context .WithCancelCause (sb .Context ())
8122
8121
defer func () { cancel (errors .WithStack (context .Canceled )) }()
8123
8122
@@ -8319,7 +8318,6 @@ func testPullWithLayerLimit(t *testing.T, sb integration.Sandbox) {
8319
8318
}
8320
8319
8321
8320
func testCallInfo (t * testing.T , sb integration.Sandbox ) {
8322
- integration .SkipOnPlatform (t , "windows" )
8323
8321
workers .CheckFeatureCompat (t , sb , workers .FeatureInfo )
8324
8322
c , err := New (sb .Context (), sb .Address ())
8325
8323
require .NoError (t , err )
@@ -10268,7 +10266,6 @@ func testMountStubsTimestamp(t *testing.T, sb integration.Sandbox) {
10268
10266
}
10269
10267
10270
10268
func testFrontendVerifyPlatforms (t * testing.T , sb integration.Sandbox ) {
10271
- requiresLinux (t )
10272
10269
c , err := New (sb .Context (), sb .Address ())
10273
10270
require .NoError (t , err )
10274
10271
defer c .Close ()
@@ -10833,17 +10830,24 @@ func testLayerLimitOnMounts(t *testing.T, sb integration.Sandbox) {
10833
10830
}
10834
10831
10835
10832
func testClientCustomGRPCOpts (t * testing.T , sb integration.Sandbox ) {
10836
- integration .SkipOnPlatform (t , "windows" )
10837
10833
var interceptedMethods []string
10838
- intercept := func (ctx context.Context , method string , req , reply interface {}, cc * grpc.ClientConn , invoker grpc.UnaryInvoker , opts ... grpc.CallOption ) error {
10834
+ intercept := func (
10835
+ ctx context.Context ,
10836
+ method string ,
10837
+ req ,
10838
+ reply interface {},
10839
+ cc * grpc.ClientConn ,
10840
+ invoker grpc.UnaryInvoker ,
10841
+ opts ... grpc.CallOption ) error {
10839
10842
interceptedMethods = append (interceptedMethods , method )
10840
10843
return invoker (ctx , method , req , reply , cc , opts ... )
10841
10844
}
10842
10845
c , err := New (sb .Context (), sb .Address (), WithGRPCDialOption (grpc .WithChainUnaryInterceptor (intercept )))
10843
10846
require .NoError (t , err )
10844
10847
defer c .Close ()
10845
10848
10846
- st := llb .Image ("busybox:latest" )
10849
+ imgName := integration .UnixOrWindows ("busybox:latest" , "nanoserver:latest" )
10850
+ st := llb .Image (imgName )
10847
10851
def , err := st .Marshal (sb .Context ())
10848
10852
require .NoError (t , err )
10849
10853
_ , err = c .Solve (sb .Context (), def , SolveOpt {}, nil )
@@ -10853,42 +10857,44 @@ func testClientCustomGRPCOpts(t *testing.T, sb integration.Sandbox) {
10853
10857
}
10854
10858
10855
10859
func testRunValidExitCodes (t * testing.T , sb integration.Sandbox ) {
10856
- requiresLinux (t )
10857
10860
c , err := New (sb .Context (), sb .Address ())
10858
10861
require .NoError (t , err )
10859
10862
defer c .Close ()
10860
10863
10861
10864
// no exit codes specified, equivalent to [0]
10862
- out := llb .Image ("busybox:latest" )
10863
- out = out .Run (llb .Shlex (`sh -c "exit 0"` )).Root ()
10864
- out = out .Run (llb .Shlex (`sh -c "exit 1"` )).Root ()
10865
+ imgName := integration .UnixOrWindows ("busybox:latest" , "nanoserver:latest" )
10866
+ out := llb .Image (imgName )
10867
+ shellPrefix := integration .UnixOrWindows ("sh -c" , "cmd /C" )
10868
+
10869
+ out = out .Run (llb .Shlexf (`%s "exit 0"` , shellPrefix )).Root ()
10870
+ out = out .Run (llb .Shlexf (`%s "exit 1"` , shellPrefix )).Root ()
10865
10871
def , err := out .Marshal (sb .Context ())
10866
10872
require .NoError (t , err )
10867
10873
_ , err = c .Solve (sb .Context (), def , SolveOpt {}, nil )
10868
10874
require .Error (t , err )
10869
10875
require .ErrorContains (t , err , "exit code: 1" )
10870
10876
10871
10877
// empty exit codes, equivalent to [0]
10872
- out = llb .Image ("busybox:latest" )
10873
- out = out .Run (llb .Shlex ( `sh -c "exit 0"` ), llb .ValidExitCodes ()).Root ()
10878
+ out = llb .Image (imgName )
10879
+ out = out .Run (llb .Shlexf ( `%s "exit 0"`, shellPrefix ), llb .ValidExitCodes ()).Root ()
10874
10880
def , err = out .Marshal (sb .Context ())
10875
10881
require .NoError (t , err )
10876
10882
_ , err = c .Solve (sb .Context (), def , SolveOpt {}, nil )
10877
10883
require .NoError (t , err )
10878
10884
10879
10885
// if we expect non-zero, those non-zero codes should succeed
10880
- out = llb .Image ("busybox:latest" )
10881
- out = out .Run (llb .Shlex ( `sh -c "exit 1"` ), llb .ValidExitCodes (1 )).Root ()
10882
- out = out .Run (llb .Shlex ( `sh -c "exit 2"` ), llb .ValidExitCodes (2 , 3 )).Root ()
10883
- out = out .Run (llb .Shlex ( `sh -c "exit 3"` ), llb .ValidExitCodes (2 , 3 )).Root ()
10886
+ out = llb .Image (imgName )
10887
+ out = out .Run (llb .Shlexf ( `%s "exit 1"`, shellPrefix ), llb .ValidExitCodes (1 )).Root ()
10888
+ out = out .Run (llb .Shlexf ( `%s "exit 2"`, shellPrefix ), llb .ValidExitCodes (2 , 3 )).Root ()
10889
+ out = out .Run (llb .Shlexf ( `%s "exit 3"`, shellPrefix ), llb .ValidExitCodes (2 , 3 )).Root ()
10884
10890
def , err = out .Marshal (sb .Context ())
10885
10891
require .NoError (t , err )
10886
10892
_ , err = c .Solve (sb .Context (), def , SolveOpt {}, nil )
10887
10893
require .NoError (t , err )
10888
10894
10889
10895
// if we expect non-zero, returning zero should fail
10890
- out = llb .Image ("busybox:latest" )
10891
- out = out .Run (llb .Shlex ( `sh -c "exit 0"` ), llb .ValidExitCodes (1 )).Root ()
10896
+ out = llb .Image (imgName )
10897
+ out = out .Run (llb .Shlexf ( `%s "exit 0"`, shellPrefix ), llb .ValidExitCodes (1 )).Root ()
10892
10898
def , err = out .Marshal (sb .Context ())
10893
10899
require .NoError (t , err )
10894
10900
_ , err = c .Solve (sb .Context (), def , SolveOpt {}, nil )
0 commit comments