Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DiffOp Preparation Commits #2517

Merged
merged 3 commits into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cache/blobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func computeBlobChain(ctx context.Context, sr *immutableRef, createIfNeeded bool
case "overlayfs", "stargz":
// overlayfs-based snapshotters should support overlay diff. so print warn log on failure.
logWarnOnErr = true
case "fuse-overlayfs":
case "fuse-overlayfs", "native":
// not supported with fuse-overlayfs snapshotter which doesn't provide overlayfs mounts.
// TODO: add support for fuse-overlayfs
enableOverlay = false
Expand Down
12 changes: 6 additions & 6 deletions client/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
)

func TestClientGatewayIntegration(t *testing.T) {
integration.Run(t, []integration.Test{
integration.Run(t, integration.TestFuncs(
testClientGatewaySolve,
testClientGatewayFailedSolve,
testClientGatewayEmptySolve,
Expand All @@ -53,20 +53,20 @@ func TestClientGatewayIntegration(t *testing.T) {
testClientGatewayExecFileActionError,
testClientGatewayContainerExtraHosts,
testWarnings,
}, integration.WithMirroredImages(integration.OfficialImages("busybox:latest")))
), integration.WithMirroredImages(integration.OfficialImages("busybox:latest")))

integration.Run(t, []integration.Test{
integration.Run(t, integration.TestFuncs(
testClientGatewayContainerSecurityMode,
}, integration.WithMirroredImages(integration.OfficialImages("busybox:latest")),
), integration.WithMirroredImages(integration.OfficialImages("busybox:latest")),
integration.WithMatrix("secmode", map[string]interface{}{
"sandbox": securitySandbox,
"insecure": securityInsecure,
}),
)

integration.Run(t, []integration.Test{
integration.Run(t, integration.TestFuncs(
testClientGatewayContainerHostNetworking,
},
),
integration.WithMirroredImages(integration.OfficialImages("busybox:latest")),
integration.WithMatrix("netmode", map[string]interface{}{
"default": defaultNetwork,
Expand Down
12 changes: 6 additions & 6 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestIntegration(t *testing.T) {
mirroredImages["tonistiigi/test:nolayers"] = "docker.io/tonistiigi/test:nolayers"
mirrors := integration.WithMirroredImages(mirroredImages)

integration.Run(t, []integration.Test{
integration.Run(t, integration.TestFuncs(
testCacheExportCacheKeyLoop,
testRelativeWorkDir,
testFileOpMkdirMkfile,
Expand Down Expand Up @@ -140,23 +140,23 @@ func TestIntegration(t *testing.T) {
testMergeOp,
testMergeOpCache,
testRmSymlink,
}, mirrors)
), mirrors)

integration.Run(t, []integration.Test{
integration.Run(t, integration.TestFuncs(
testSecurityMode,
testSecurityModeSysfs,
testSecurityModeErrors,
},
),
mirrors,
integration.WithMatrix("secmode", map[string]interface{}{
"sandbox": securitySandbox,
"insecure": securityInsecure,
}),
)

integration.Run(t, []integration.Test{
integration.Run(t, integration.TestFuncs(
testHostNetworking,
},
),
mirrors,
integration.WithMatrix("netmode", map[string]interface{}{
"default": defaultNetwork,
Expand Down
4 changes: 2 additions & 2 deletions cmd/buildctl/buildctl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ func init() {
}

func TestCLIIntegration(t *testing.T) {
integration.Run(t, []integration.Test{
integration.Run(t, integration.TestFuncs(
testDiskUsage,
testBuildWithLocalFiles,
testBuildLocalExporter,
testBuildContainerdExporter,
testBuildMetadataFile,
testPrune,
testUsage,
},
),
integration.WithMirroredImages(integration.OfficialImages("busybox:latest")),
)
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/dockerfile/dockerfile_heredoc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/stretchr/testify/require"
)

var hdTests = []integration.Test{
var hdTests = integration.TestFuncs(
testCopyHeredoc,
testRunBasicHeredoc,
testRunFakeHeredoc,
Expand All @@ -27,7 +27,7 @@ var hdTests = []integration.Test{
testHeredocIndent,
testHeredocVarSubstitution,
testOnBuildHeredoc,
}
)

func init() {
heredocTests = append(heredocTests, hdTests...)
Expand Down
6 changes: 3 additions & 3 deletions frontend/dockerfile/dockerfile_mount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/stretchr/testify/require"
)

var mountTests = []integration.Test{
var mountTests = integration.TestFuncs(
testMountContext,
testMountTmpfs,
testMountRWCache,
Expand All @@ -26,12 +26,12 @@ var mountTests = []integration.Test{
testMountFromError,
testMountInvalid,
testMountTmpfsSize,
}
)

func init() {
allTests = append(allTests, mountTests...)

fileOpTests = append(fileOpTests, testCacheMountUser)
fileOpTests = append(fileOpTests, integration.TestFuncs(testCacheMountUser)...)
}

func testMountContext(t *testing.T, sb integration.Sandbox) {
Expand Down
4 changes: 2 additions & 2 deletions frontend/dockerfile/dockerfile_runnetwork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import (
"github.com/stretchr/testify/require"
)

var runNetworkTests = []integration.Test{
var runNetworkTests = integration.TestFuncs(
testRunDefaultNetwork,
testRunNoNetwork,
testRunHostNetwork,
testRunGlobalNetwork,
}
)

func init() {
networkTests = append(networkTests, runNetworkTests...)
Expand Down
4 changes: 2 additions & 2 deletions frontend/dockerfile/dockerfile_runsecurity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import (
"github.com/stretchr/testify/require"
)

var runSecurityTests = []integration.Test{
var runSecurityTests = integration.TestFuncs(
testRunSecurityInsecure,
testRunSecuritySandbox,
testRunSecurityDefault,
testInsecureDevicesWhitelist,
}
)

func init() {
securityOpts = []integration.TestOpt{
Expand Down
4 changes: 2 additions & 2 deletions frontend/dockerfile/dockerfile_secrets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
"github.com/stretchr/testify/require"
)

var secretsTests = []integration.Test{
var secretsTests = integration.TestFuncs(
testSecretFileParams,
testSecretRequiredWithoutValue,
}
)

func init() {
allTests = append(allTests, secretsTests...)
Expand Down
4 changes: 2 additions & 2 deletions frontend/dockerfile/dockerfile_ssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"github.com/stretchr/testify/require"
)

var sshTests = []integration.Test{
var sshTests = integration.TestFuncs(
testSSHSocketParams,
}
)

func init() {
allTests = append(allTests, sshTests...)
Expand Down
8 changes: 4 additions & 4 deletions frontend/dockerfile/dockerfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func init() {
}
}

var allTests = []integration.Test{
var allTests = integration.TestFuncs(
testCmdShell,
testGlobalArg,
testDockerfileDirs,
Expand Down Expand Up @@ -118,9 +118,9 @@ var allTests = []integration.Test{
testShmSize,
testUlimit,
testCgroupParent,
}
)

var fileOpTests = []integration.Test{
var fileOpTests = integration.TestFuncs(
testEmptyDestDir,
testCopyChownCreateDest,
testCopyThroughSymlinkContext,
Expand All @@ -143,7 +143,7 @@ var fileOpTests = []integration.Test{
testWorkdirCopyIgnoreRelative,
testCopyFollowAllSymlinks,
testDockerfileAddChownExpand,
}
)

// Tests that depend on the `security.*` entitlements
var securityTests = []integration.Test{}
Expand Down
4 changes: 2 additions & 2 deletions frontend/frontend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ func init() {
}

func TestFrontendIntegration(t *testing.T) {
integration.Run(t, []integration.Test{
integration.Run(t, integration.TestFuncs(
testRefReadFile,
testRefReadDir,
testRefStatFile,
testReturnNil,
})
))
}

func testReturnNil(t *testing.T, sb integration.Sandbox) {
Expand Down
Loading