Skip to content

Commit 8c4da32

Browse files
Merge pull request #4479 from profnandaa/windows/int-test-run
tests: enable integration test run on windows as baseline
2 parents a960fe5 + 4b7c173 commit 8c4da32

25 files changed

+286
-29
lines changed

.github/workflows/test-os.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020

2121
env:
2222
GO_VERSION: "1.21"
23-
TESTFLAGS: "-v --parallel=6 --timeout=30m"
23+
TESTFLAGS: "-v --parallel=6 --timeout=60m"
2424
GOTESTSUM_VERSION: "v1.9.0" # same as one in Dockerfile
2525
GOTESTSUM_FORMAT: "standard-verbose"
2626
DESTDIR: "./bin"
@@ -48,11 +48,37 @@ jobs:
4848
name: Install gotestsum
4949
run: |
5050
go install gotest.tools/gotestsum@${{ env.GOTESTSUM_VERSION }}
51+
-
52+
name: Install buildkitd.exe binary
53+
run: |
54+
go install .\cmd\buildkitd
55+
-
56+
name: Install containerd.exe binary
57+
run: |
58+
$goModFileContent = Get-Content go.mod -Raw
59+
$pattern = '(?<=github\.com/containerd/containerd v)[\d\.]+'
60+
$version = [regex]::Match($goModFileContent, $pattern).Value
61+
mkdir -p .\bin\installs -f
62+
cd .\bin\installs
63+
git clone https://github.com/containerd/containerd.git
64+
cd containerd
65+
git checkout tags/v$version
66+
go install .\cmd\...
67+
cd ..\..\..
68+
-
69+
name: Install registry.exe (distribution/distribution) binary
70+
run: |
71+
mkdir -p .\bin\installs -f
72+
cd .\bin\installs
73+
git clone https://github.com/distribution/distribution.git
74+
cd distribution
75+
go install .\cmd\...
76+
cd ..\..\..
5177
-
5278
name: Test
5379
env:
5480
TMPDIR: ${{ runner.temp }}
55-
SKIP_INTEGRATION_TESTS: 1
81+
# SKIP_INTEGRATION_TESTS: 1
5682
run: |
5783
mkdir -p ./bin/testreports
5884
gotestsum \

client/build_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,6 +2254,7 @@ func testClientGatewayNilResult(t *testing.T, sb integration.Sandbox) {
22542254
}
22552255

22562256
func testClientGatewayEmptyImageExec(t *testing.T, sb integration.Sandbox) {
2257+
integration.SkipOnPlatform(t, "windows")
22572258
workers.CheckFeatureCompat(t, sb, workers.FeatureDirectPush)
22582259
c, err := New(sb.Context(), sb.Address())
22592260
require.NoError(t, err)

client/client_test.go

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,16 @@ func testIntegration(t *testing.T, funcs ...func(t *testing.T, sb integration.Sa
246246
}),
247247
)
248248

249-
integration.Run(t, integration.TestFuncs(
250-
testBridgeNetworkingDNSNoRootless,
251-
),
252-
mirrors,
253-
integration.WithMatrix("netmode", map[string]interface{}{
254-
"dns": bridgeDNSNetwork,
255-
}),
256-
)
249+
if runtime.GOOS != "windows" {
250+
integration.Run(
251+
t,
252+
integration.TestFuncs(testBridgeNetworkingDNSNoRootless),
253+
mirrors,
254+
integration.WithMatrix("netmode", map[string]interface{}{
255+
"dns": bridgeDNSNetwork,
256+
}),
257+
)
258+
}
257259
}
258260

259261
func newContainerd(cdAddress string) (*containerd.Client, error) {
@@ -262,6 +264,7 @@ func newContainerd(cdAddress string) (*containerd.Client, error) {
262264

263265
// moby/buildkit#1336
264266
func testCacheExportCacheKeyLoop(t *testing.T, sb integration.Sandbox) {
267+
integration.SkipOnPlatform(t, "windows")
265268
workers.CheckFeatureCompat(t, sb, workers.FeatureCacheExport, workers.FeatureCacheBackendLocal)
266269
c, err := New(sb.Context(), sb.Address())
267270
require.NoError(t, err)
@@ -327,6 +330,7 @@ func testBridgeNetworking(t *testing.T, sb integration.Sandbox) {
327330
}
328331

329332
func testBridgeNetworkingDNSNoRootless(t *testing.T, sb integration.Sandbox) {
333+
integration.SkipOnPlatform(t, "windows")
330334
workers.CheckFeatureCompat(t, sb, workers.FeatureCNINetwork)
331335
if os.Getenv("BUILDKIT_RUN_NETWORK_INTEGRATION_TESTS") == "" {
332336
t.SkipNow()
@@ -396,6 +400,7 @@ func testHostNetworking(t *testing.T, sb integration.Sandbox) {
396400
}
397401

398402
func testExportedImageLabels(t *testing.T, sb integration.Sandbox) {
403+
integration.SkipOnPlatform(t, "windows")
399404
c, err := New(sb.Context(), sb.Address())
400405
require.NoError(t, err)
401406
defer c.Close()
@@ -525,6 +530,7 @@ func testExportedImageLabels(t *testing.T, sb integration.Sandbox) {
525530

526531
// #877
527532
func testExportBusyboxLocal(t *testing.T, sb integration.Sandbox) {
533+
integration.SkipOnPlatform(t, "windows")
528534
c, err := New(sb.Context(), sb.Address())
529535
require.NoError(t, err)
530536
defer c.Close()
@@ -554,6 +560,7 @@ func testExportBusyboxLocal(t *testing.T, sb integration.Sandbox) {
554560
}
555561

556562
func testHostnameLookup(t *testing.T, sb integration.Sandbox) {
563+
integration.SkipOnPlatform(t, "windows")
557564
if sb.Rootless() {
558565
t.SkipNow()
559566
}
@@ -573,6 +580,7 @@ func testHostnameLookup(t *testing.T, sb integration.Sandbox) {
573580

574581
// moby/buildkit#1301
575582
func testHostnameSpecifying(t *testing.T, sb integration.Sandbox) {
583+
integration.SkipOnPlatform(t, "windows")
576584
if sb.Rootless() {
577585
t.SkipNow()
578586
}
@@ -597,6 +605,7 @@ func testHostnameSpecifying(t *testing.T, sb integration.Sandbox) {
597605

598606
// moby/buildkit#614
599607
func testStdinClosed(t *testing.T, sb integration.Sandbox) {
608+
integration.SkipOnPlatform(t, "windows")
600609
c, err := New(sb.Context(), sb.Address())
601610
require.NoError(t, err)
602611
defer c.Close()
@@ -611,6 +620,7 @@ func testStdinClosed(t *testing.T, sb integration.Sandbox) {
611620
}
612621

613622
func testSSHMount(t *testing.T, sb integration.Sandbox) {
623+
integration.SkipOnPlatform(t, "windows")
614624
c, err := New(sb.Context(), sb.Address())
615625
require.NoError(t, err)
616626
defer c.Close()
@@ -770,6 +780,7 @@ func testSSHMount(t *testing.T, sb integration.Sandbox) {
770780
}
771781

772782
func testExtraHosts(t *testing.T, sb integration.Sandbox) {
783+
integration.SkipOnPlatform(t, "windows")
773784
c, err := New(sb.Context(), sb.Address())
774785
require.NoError(t, err)
775786
defer c.Close()
@@ -785,6 +796,7 @@ func testExtraHosts(t *testing.T, sb integration.Sandbox) {
785796
}
786797

787798
func testShmSize(t *testing.T, sb integration.Sandbox) {
799+
integration.SkipOnPlatform(t, "windows")
788800
c, err := New(sb.Context(), sb.Address())
789801
require.NoError(t, err)
790802
defer c.Close()
@@ -816,6 +828,7 @@ func testShmSize(t *testing.T, sb integration.Sandbox) {
816828
}
817829

818830
func testUlimit(t *testing.T, sb integration.Sandbox) {
831+
integration.SkipOnPlatform(t, "windows")
819832
c, err := New(sb.Context(), sb.Address())
820833
require.NoError(t, err)
821834
defer c.Close()
@@ -924,6 +937,7 @@ func testCgroupParent(t *testing.T, sb integration.Sandbox) {
924937
}
925938

926939
func testNetworkMode(t *testing.T, sb integration.Sandbox) {
940+
integration.SkipOnPlatform(t, "windows")
927941
c, err := New(sb.Context(), sb.Address())
928942
require.NoError(t, err)
929943
defer c.Close()
@@ -997,6 +1011,7 @@ func testPushByDigest(t *testing.T, sb integration.Sandbox) {
9971011
}
9981012

9991013
func testSecurityMode(t *testing.T, sb integration.Sandbox) {
1014+
integration.SkipOnPlatform(t, "windows")
10001015
workers.CheckFeatureCompat(t, sb, workers.FeatureSecurityMode)
10011016
command := `sh -c 'cat /proc/self/status | grep CapEff | cut -f 2 > /out'`
10021017
mode := llb.SecurityModeSandbox
@@ -1068,6 +1083,7 @@ func testSecurityMode(t *testing.T, sb integration.Sandbox) {
10681083
}
10691084

10701085
func testSecurityModeSysfs(t *testing.T, sb integration.Sandbox) {
1086+
integration.SkipOnPlatform(t, "windows")
10711087
workers.CheckFeatureCompat(t, sb, workers.FeatureSecurityMode)
10721088
if sb.Rootless() {
10731089
t.SkipNow()
@@ -1114,6 +1130,7 @@ func testSecurityModeSysfs(t *testing.T, sb integration.Sandbox) {
11141130
}
11151131

11161132
func testSecurityModeErrors(t *testing.T, sb integration.Sandbox) {
1133+
integration.SkipOnPlatform(t, "windows")
11171134
c, err := New(sb.Context(), sb.Address())
11181135
require.NoError(t, err)
11191136
defer c.Close()
@@ -1294,6 +1311,7 @@ func testFrontendImageNaming(t *testing.T, sb integration.Sandbox) {
12941311
}
12951312

12961313
func testSecretMounts(t *testing.T, sb integration.Sandbox) {
1314+
integration.SkipOnPlatform(t, "windows")
12971315
c, err := New(sb.Context(), sb.Address())
12981316
require.NoError(t, err)
12991317
defer c.Close()
@@ -1367,6 +1385,7 @@ func testSecretMounts(t *testing.T, sb integration.Sandbox) {
13671385
}
13681386

13691387
func testSecretEnv(t *testing.T, sb integration.Sandbox) {
1388+
integration.SkipOnPlatform(t, "windows")
13701389
c, err := New(sb.Context(), sb.Address())
13711390
require.NoError(t, err)
13721391
defer c.Close()
@@ -2293,6 +2312,7 @@ func testBuildExportScratch(t *testing.T, sb integration.Sandbox) {
22932312
}
22942313

22952314
func testBuildHTTPSource(t *testing.T, sb integration.Sandbox) {
2315+
integration.SkipOnPlatform(t, "windows")
22962316
c, err := New(sb.Context(), sb.Address())
22972317
require.NoError(t, err)
22982318
defer c.Close()
@@ -3084,6 +3104,7 @@ func testSourceDateEpochTarExporter(t *testing.T, sb integration.Sandbox) {
30843104
}
30853105

30863106
func testSourceDateEpochImageExporter(t *testing.T, sb integration.Sandbox) {
3107+
integration.SkipOnPlatform(t, "windows")
30873108
cdAddress := sb.ContainerdAddress()
30883109
if cdAddress == "" {
30893110
t.SkipNow()
@@ -3369,6 +3390,7 @@ func testTarExporterSymlink(t *testing.T, sb integration.Sandbox) {
33693390
}
33703391

33713392
func testBuildExportWithForeignLayer(t *testing.T, sb integration.Sandbox) {
3393+
integration.SkipOnPlatform(t, "windows")
33723394
workers.CheckFeatureCompat(t, sb, workers.FeatureImageExporter)
33733395
c, err := New(sb.Context(), sb.Address())
33743396
require.NoError(t, err)
@@ -3667,6 +3689,7 @@ func testBuildExportWithUncompressed(t *testing.T, sb integration.Sandbox) {
36673689
}
36683690

36693691
func testBuildExportZstd(t *testing.T, sb integration.Sandbox) {
3692+
integration.SkipOnPlatform(t, "windows")
36703693
workers.CheckFeatureCompat(t, sb, workers.FeatureOCIExporter)
36713694
c, err := New(sb.Context(), sb.Address())
36723695
require.NoError(t, err)
@@ -3763,6 +3786,7 @@ func testBuildExportZstd(t *testing.T, sb integration.Sandbox) {
37633786
}
37643787

37653788
func testPullZstdImage(t *testing.T, sb integration.Sandbox) {
3789+
integration.SkipOnPlatform(t, "windows")
37663790
workers.CheckFeatureCompat(t, sb, workers.FeatureDirectPush)
37673791
for _, ociMediaTypes := range []bool{true, false} {
37683792
ociMediaTypes := ociMediaTypes
@@ -4708,6 +4732,7 @@ func testLazyImagePush(t *testing.T, sb integration.Sandbox) {
47084732
}
47094733

47104734
func testZstdLocalCacheExport(t *testing.T, sb integration.Sandbox) {
4735+
integration.SkipOnPlatform(t, "windows")
47114736
workers.CheckFeatureCompat(t, sb, workers.FeatureCacheExport, workers.FeatureCacheBackendLocal)
47124737
c, err := New(sb.Context(), sb.Address())
47134738
require.NoError(t, err)
@@ -4767,6 +4792,7 @@ func testZstdLocalCacheExport(t *testing.T, sb integration.Sandbox) {
47674792
}
47684793

47694794
func testCacheExportIgnoreError(t *testing.T, sb integration.Sandbox) {
4795+
integration.SkipOnPlatform(t, "windows")
47704796
workers.CheckFeatureCompat(t, sb, workers.FeatureCacheExport)
47714797
c, err := New(sb.Context(), sb.Address())
47724798
require.NoError(t, err)
@@ -5153,6 +5179,7 @@ func testBasicLocalCacheImportExport(t *testing.T, sb integration.Sandbox) {
51535179
}
51545180

51555181
func testBasicS3CacheImportExport(t *testing.T, sb integration.Sandbox) {
5182+
integration.SkipOnPlatform(t, "windows")
51565183
workers.CheckFeatureCompat(t, sb,
51575184
workers.FeatureCacheExport,
51585185
workers.FeatureCacheImport,
@@ -5195,6 +5222,7 @@ func testBasicS3CacheImportExport(t *testing.T, sb integration.Sandbox) {
51955222
}
51965223

51975224
func testBasicAzblobCacheImportExport(t *testing.T, sb integration.Sandbox) {
5225+
integration.SkipOnPlatform(t, "windows")
51985226
workers.CheckFeatureCompat(t, sb,
51995227
workers.FeatureCacheExport,
52005228
workers.FeatureCacheImport,
@@ -5563,6 +5591,7 @@ func testMultipleRecordsWithSameLayersCacheImportExport(t *testing.T, sb integra
55635591

55645592
// moby/buildkit#3809
55655593
func testSnapshotWithMultipleBlobs(t *testing.T, sb integration.Sandbox) {
5594+
integration.SkipOnPlatform(t, "windows")
55665595
workers.CheckFeatureCompat(t, sb, workers.FeatureOCIExporter)
55675596
c, err := New(sb.Context(), sb.Address())
55685597
require.NoError(t, err)
@@ -5704,6 +5733,7 @@ func testSnapshotWithMultipleBlobs(t *testing.T, sb integration.Sandbox) {
57045733
}
57055734

57065735
func testExportLocalNoPlatformSplit(t *testing.T, sb integration.Sandbox) {
5736+
integration.SkipOnPlatform(t, "windows")
57075737
workers.CheckFeatureCompat(t, sb, workers.FeatureOCIExporter, workers.FeatureMultiPlatform)
57085738
c, err := New(sb.Context(), sb.Address())
57095739
require.NoError(t, err)
@@ -6262,6 +6292,7 @@ func testWhiteoutParentDir(t *testing.T, sb integration.Sandbox) {
62626292

62636293
// #2490
62646294
func testMoveParentDir(t *testing.T, sb integration.Sandbox) {
6295+
integration.SkipOnPlatform(t, "windows")
62656296
workers.CheckFeatureCompat(t, sb, workers.FeatureOCIExporter)
62666297
c, err := New(sb.Context(), sb.Address())
62676298
require.NoError(t, err)
@@ -6329,6 +6360,7 @@ func testMoveParentDir(t *testing.T, sb integration.Sandbox) {
63296360

63306361
// #296
63316362
func testSchema1Image(t *testing.T, sb integration.Sandbox) {
6363+
integration.SkipOnPlatform(t, "windows")
63326364
c, err := New(sb.Context(), sb.Address())
63336365
require.NoError(t, err)
63346366
defer c.Close()
@@ -6346,6 +6378,7 @@ func testSchema1Image(t *testing.T, sb integration.Sandbox) {
63466378

63476379
// #319
63486380
func testMountWithNoSource(t *testing.T, sb integration.Sandbox) {
6381+
integration.SkipOnPlatform(t, "windows")
63496382
c, err := New(sb.Context(), sb.Address())
63506383
require.NoError(t, err)
63516384
defer c.Close()
@@ -6375,6 +6408,7 @@ func testMountWithNoSource(t *testing.T, sb integration.Sandbox) {
63756408

63766409
// #324
63776410
func testReadonlyRootFS(t *testing.T, sb integration.Sandbox) {
6411+
integration.SkipOnPlatform(t, "windows")
63786412
c, err := New(sb.Context(), sb.Address())
63796413
require.NoError(t, err)
63806414
defer c.Close()
@@ -6522,6 +6556,7 @@ func testSourceMapFromRef(t *testing.T, sb integration.Sandbox) {
65226556
}
65236557

65246558
func testRmSymlink(t *testing.T, sb integration.Sandbox) {
6559+
integration.SkipOnPlatform(t, "windows")
65256560
c, err := New(sb.Context(), sb.Address())
65266561
require.NoError(t, err)
65276562
defer c.Close()
@@ -6555,6 +6590,7 @@ func testRmSymlink(t *testing.T, sb integration.Sandbox) {
65556590
}
65566591

65576592
func testProxyEnv(t *testing.T, sb integration.Sandbox) {
6593+
integration.SkipOnPlatform(t, "windows")
65586594
c, err := New(sb.Context(), sb.Address())
65596595
require.NoError(t, err)
65606596
defer c.Close()
@@ -7407,6 +7443,7 @@ func testInvalidExporter(t *testing.T, sb integration.Sandbox) {
74077443

74087444
// moby/buildkit#492
74097445
func testParallelLocalBuilds(t *testing.T, sb integration.Sandbox) {
7446+
integration.SkipOnPlatform(t, "windows")
74107447
ctx, cancel := context.WithCancelCause(sb.Context())
74117448
defer cancel(errors.WithStack(context.Canceled))
74127449

@@ -9229,6 +9266,7 @@ func testSBOMSupplements(t *testing.T, sb integration.Sandbox) {
92299266
}
92309267

92319268
func testMultipleCacheExports(t *testing.T, sb integration.Sandbox) {
9269+
integration.SkipOnPlatform(t, "windows")
92329270
workers.CheckFeatureCompat(t, sb, workers.FeatureMultiCacheExport)
92339271
c, err := New(sb.Context(), sb.Address())
92349272
require.NoError(t, err)
@@ -9346,6 +9384,7 @@ func testMultipleCacheExports(t *testing.T, sb integration.Sandbox) {
93469384
}
93479385

93489386
func testMountStubsDirectory(t *testing.T, sb integration.Sandbox) {
9387+
integration.SkipOnPlatform(t, "windows")
93499388
c, err := New(sb.Context(), sb.Address())
93509389
require.NoError(t, err)
93519390
defer c.Close()
@@ -9405,6 +9444,7 @@ func testMountStubsDirectory(t *testing.T, sb integration.Sandbox) {
94059444

94069445
// https://github.com/moby/buildkit/issues/3148
94079446
func testMountStubsTimestamp(t *testing.T, sb integration.Sandbox) {
9447+
integration.SkipOnPlatform(t, "windows")
94089448
c, err := New(sb.Context(), sb.Address())
94099449
require.NoError(t, err)
94109450
defer c.Close()
@@ -9811,6 +9851,7 @@ func testSourcePolicy(t *testing.T, sb integration.Sandbox) {
98119851
}
98129852

98139853
func testLLBMountPerformance(t *testing.T, sb integration.Sandbox) {
9854+
integration.SkipOnPlatform(t, "windows")
98149855
c, err := New(sb.Context(), sb.Address())
98159856
require.NoError(t, err)
98169857
defer c.Close()

0 commit comments

Comments
 (0)