Skip to content

Commit

Permalink
Update integration tests to use new cst
Browse files Browse the repository at this point in the history
  • Loading branch information
Priya Wadhwa committed May 1, 2018
1 parent 6ff3c58 commit ac8a110
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions integration_tests/integration_test_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
executorImage = "executor-image"
dockerImage = "gcr.io/cloud-builders/docker"
ubuntuImage = "ubuntu"
structureTestImage = "gcr.io/gcp-runtimes/container-structure-test"
testRepo = "gcr.io/kaniko-test/"
dockerPrefix = "docker-"
kanikoPrefix = "kaniko-"
Expand Down Expand Up @@ -205,15 +206,6 @@ func main() {
Name: ubuntuImage,
Args: []string{"chmod", "+x", "container-diff-linux-amd64"},
}
structureTestsStep := step{
Name: "gcr.io/cloud-builders/gsutil",
Args: []string{"cp", "gs://container-structure-test/latest/container-structure-test", "."},
}
structureTestPermissions := step{
Name: ubuntuImage,
Args: []string{"chmod", "+x", "container-structure-test"},
}

GCSBucketTarBuildContext := step{
Name: ubuntuImage,
Args: []string{"tar", "-C", "/workspace/integration_tests/", "-zcvf", "/workspace/context.tar.gz", "."},
Expand All @@ -239,7 +231,7 @@ func main() {
Args: []string{"push", onbuildBaseImage},
}
y := testyaml{
Steps: []step{containerDiffStep, containerDiffPermissions, structureTestsStep, structureTestPermissions, GCSBucketTarBuildContext, uploadTarBuildContext, buildExecutorImage,
Steps: []step{containerDiffStep, containerDiffPermissions, GCSBucketTarBuildContext, uploadTarBuildContext, buildExecutorImage,
buildOnbuildImage, pushOnbuildBase},
Timeout: "1200s",
}
Expand Down Expand Up @@ -315,20 +307,15 @@ func main() {
Args: []string{"pull", kanikoImage},
}
// Run structure tests on the kaniko and docker image
args := "container-structure-test -image " + kanikoImage + " " + test.structureTestYamlPath
structureTest := step{
Name: ubuntuImage,
Args: []string{"sh", "-c", args},
Env: []string{"PATH=/workspace:/bin"},
kanikoStructureTest := step{
Name: structureTestImage,
Args: []string{"test", "--image", kanikoImage, "--config", test.structureTestYamlPath},
}
args = "container-structure-test -image " + dockerImageTag + " " + test.structureTestYamlPath
dockerStructureTest := step{
Name: ubuntuImage,
Args: []string{"sh", "-c", args},
Env: []string{"PATH=/workspace:/bin"},
Name: structureTestImage,
Args: []string{"test", "--image", dockerImageTag, "--config", test.structureTestYamlPath},
}

y.Steps = append(y.Steps, dockerBuild, kaniko, pullKanikoImage, structureTest, dockerStructureTest)
y.Steps = append(y.Steps, dockerBuild, kaniko, pullKanikoImage, kanikoStructureTest, dockerStructureTest)
}

d, _ := yaml.Marshal(&y)
Expand Down

0 comments on commit ac8a110

Please sign in to comment.