Skip to content

Commit

Permalink
tests: include npipe connhelper in integration test package
Browse files Browse the repository at this point in the history
Signed-off-by: Höhl, Lukas <[email protected]>
  • Loading branch information
Höhl, Lukas committed Feb 1, 2024
1 parent a120a1c commit ef7e797
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
33 changes: 20 additions & 13 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ import (
"github.com/moby/buildkit/util/testutil/httpserver"
"github.com/moby/buildkit/util/testutil/integration"
"github.com/moby/buildkit/util/testutil/workers"
// include npipe connhelper for windows tests
_ "github.com/moby/buildkit/client/connhelper/npipe"
digest "github.com/opencontainers/go-digest"
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
Expand Down Expand Up @@ -3795,7 +3793,7 @@ func testBuildExportWithUncompressed(t *testing.T, sb integration.Sandbox) {
dt, err := content.ReadBlob(ctx, img.ContentStore(), img.Target())
require.NoError(t, err)

var mfst = struct {
mfst := struct {
MediaType string `json:"mediaType,omitempty"`
ocispecs.Manifest
}{}
Expand Down Expand Up @@ -4064,6 +4062,7 @@ func testPullZstdImage(t *testing.T, sb integration.Sandbox) {
})
}
}

func testBuildPushAndValidate(t *testing.T, sb integration.Sandbox) {
workers.CheckFeatureCompat(t, sb, workers.FeatureDirectPush)
requiresLinux(t)
Expand Down Expand Up @@ -4202,7 +4201,7 @@ func testBuildPushAndValidate(t *testing.T, sb integration.Sandbox) {
dt, err = content.ReadBlob(ctx, img.ContentStore(), img.Target())
require.NoError(t, err)

var mfst = struct {
mfst := struct {
MediaType string `json:"mediaType,omitempty"`
ocispecs.Manifest
}{}
Expand Down Expand Up @@ -5280,7 +5279,8 @@ func testBasicCacheImportExport(t *testing.T, sb integration.Sandbox, cacheOptio
{
Type: ExporterLocal,
OutputDir: destDir,
}},
},
},
CacheImports: cacheOptionsEntryImport,
}, nil)
require.NoError(t, err)
Expand Down Expand Up @@ -5743,10 +5743,12 @@ func testMultipleRecordsWithSameLayersCacheImportExport(t *testing.T, sb integra

base := llb.Image("busybox:latest")
// layerA and layerB create identical layers with different LLB
layerA := base.Run(llb.Args([]string{"sh", "-c",
layerA := base.Run(llb.Args([]string{
"sh", "-c",
`echo $(( 1 + 2 )) > /result && touch -d "1970-01-01 00:00:00" /result`,
})).Root()
layerB := base.Run(llb.Args([]string{"sh", "-c",
layerB := base.Run(llb.Args([]string{
"sh", "-c",
`echo $(( 2 + 1 )) > /result && touch -d "1970-01-01 00:00:00" /result`,
})).Root()

Expand Down Expand Up @@ -9637,7 +9639,8 @@ func testMountStubsTimestamp(t *testing.T, sb integration.Sandbox) {

const sourceDateEpoch = int64(1234567890) // Fri Feb 13 11:31:30 PM UTC 2009
st := llb.Image("busybox:latest").Run(
llb.Args([]string{"/bin/touch", fmt.Sprintf("--date=@%d", sourceDateEpoch),
llb.Args([]string{
"/bin/touch", fmt.Sprintf("--date=@%d", sourceDateEpoch),
"/bin",
"/etc",
"/var",
Expand Down Expand Up @@ -9808,8 +9811,10 @@ func (*secModeInsecure) UpdateConfigFile(in string) string {
return in + "\n\ninsecure-entitlements = [\"security.insecure\"]\n"
}

var securitySandbox integration.ConfigUpdater = &secModeSandbox{}
var securityInsecure integration.ConfigUpdater = &secModeInsecure{}
var (
securitySandbox integration.ConfigUpdater = &secModeSandbox{}
securityInsecure integration.ConfigUpdater = &secModeInsecure{}
)

type netModeHost struct{}

Expand Down Expand Up @@ -9841,9 +9846,11 @@ nameservers = ["10.11.0.1"]
`
}

var hostNetwork integration.ConfigUpdater = &netModeHost{}
var defaultNetwork integration.ConfigUpdater = &netModeDefault{}
var bridgeDNSNetwork integration.ConfigUpdater = &netModeBridgeDNS{}
var (
hostNetwork integration.ConfigUpdater = &netModeHost{}
defaultNetwork integration.ConfigUpdater = &netModeDefault{}
bridgeDNSNetwork integration.ConfigUpdater = &netModeBridgeDNS{}
)

func fixedWriteCloser(wc io.WriteCloser) filesync.FileOutputFunc {
return func(map[string]string) (io.WriteCloser, error) {
Expand Down
3 changes: 3 additions & 0 deletions util/testutil/integration/util_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import (
"net"

"github.com/Microsoft/go-winio"

// include npipe connhelper for windows tests
_ "github.com/moby/buildkit/client/connhelper/npipe"
)

var socketScheme = "npipe://"
Expand Down

0 comments on commit ef7e797

Please sign in to comment.