e2e: Set ARC_E2E_DO_DOCKER_BUILD to verify docker-build
This commit is contained in:
parent
f7c336f9dd
commit
f70f325f48
|
|
@ -121,6 +121,7 @@ func TestE2E(t *testing.T) {
|
||||||
t.Fatalf("Failed to parse duration %q: %v", vt, err)
|
t.Fatalf("Failed to parse duration %q: %v", vt, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
env.doDockerBuild = os.Getenv("ARC_E2E_DO_DOCKER_BUILD") != ""
|
||||||
|
|
||||||
t.Run("build and load images", func(t *testing.T) {
|
t.Run("build and load images", func(t *testing.T) {
|
||||||
env.buildAndLoadImages(t)
|
env.buildAndLoadImages(t)
|
||||||
|
|
@ -317,6 +318,7 @@ type env struct {
|
||||||
minReplicas int64
|
minReplicas int64
|
||||||
dockerdWithinRunnerContainer bool
|
dockerdWithinRunnerContainer bool
|
||||||
rootlessDocker bool
|
rootlessDocker bool
|
||||||
|
doDockerBuild bool
|
||||||
containerMode string
|
containerMode string
|
||||||
remoteKubeconfig string
|
remoteKubeconfig string
|
||||||
imagePullSecretName string
|
imagePullSecretName string
|
||||||
|
|
@ -732,7 +734,7 @@ func (e *env) createControllerNamespaceAndServiceAccount(t *testing.T) {
|
||||||
func (e *env) installActionsWorkflow(t *testing.T, kind DeployKind, testID string) {
|
func (e *env) installActionsWorkflow(t *testing.T, kind DeployKind, testID string) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
|
||||||
installActionsWorkflow(t, e.testName+" "+testID, e.runnerLabel(testID), testResultCMNamePrefix, e.repoToCommit, kind, e.testJobs(testID), !e.rootlessDocker)
|
installActionsWorkflow(t, e.testName+" "+testID, e.runnerLabel(testID), testResultCMNamePrefix, e.repoToCommit, kind, e.testJobs(testID), !e.rootlessDocker, e.doDockerBuild)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *env) testJobs(testID string) []job {
|
func (e *env) testJobs(testID string) []job {
|
||||||
|
|
@ -774,7 +776,7 @@ func createTestJobs(id, testResultCMNamePrefix string, numJobs int) []job {
|
||||||
const Branch = "main"
|
const Branch = "main"
|
||||||
|
|
||||||
// useSudo also implies rootful docker and the use of buildx cache export/import
|
// useSudo also implies rootful docker and the use of buildx cache export/import
|
||||||
func installActionsWorkflow(t *testing.T, testName, runnerLabel, testResultCMNamePrefix, testRepo string, kind DeployKind, testJobs []job, useSudo bool) {
|
func installActionsWorkflow(t *testing.T, testName, runnerLabel, testResultCMNamePrefix, testRepo string, kind DeployKind, testJobs []job, useSudo, doDockerBuild bool) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||||
|
|
@ -873,6 +875,7 @@ func installActionsWorkflow(t *testing.T, testName, runnerLabel, testResultCMNam
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if doDockerBuild {
|
||||||
if !kubernetesContainerMode {
|
if !kubernetesContainerMode {
|
||||||
setupBuildXActionWith := &testing.With{
|
setupBuildXActionWith := &testing.With{
|
||||||
BuildkitdFlags: "--debug",
|
BuildkitdFlags: "--debug",
|
||||||
|
|
@ -915,6 +918,8 @@ func installActionsWorkflow(t *testing.T, testName, runnerLabel, testResultCMNam
|
||||||
fmt.Sprintf("-f %s .", dockerfile),
|
fmt.Sprintf("-f %s .", dockerfile),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if useSudo {
|
if useSudo {
|
||||||
steps = append(steps,
|
steps = append(steps,
|
||||||
|
|
@ -940,7 +945,6 @@ func installActionsWorkflow(t *testing.T, testName, runnerLabel, testResultCMNam
|
||||||
Run: fmt.Sprintf("./test.sh %s %s", t.Name(), j.testArg),
|
Run: fmt.Sprintf("./test.sh %s %s", t.Name(), j.testArg),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
wf.Jobs[j.name] = testing.Job{
|
wf.Jobs[j.name] = testing.Job{
|
||||||
RunsOn: runnerLabel,
|
RunsOn: runnerLabel,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue