Skip to content

Commit

Permalink
update integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
Priya Wadhwa committed Jun 21, 2018
1 parent 8453a5b commit b1d2d99
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ const (
]`
)

// TODO: remove test_user_run from this when https://github.com/GoogleContainerTools/container-diff/issues/237 is fixed
var testsToIgnore = []string{"Dockerfile_test_user_run"}

func TestMain(m *testing.M) {
buildKaniko := exec.Command("docker", "build", "-t", executorImage, "-f", "../deploy/Dockerfile", "..")
err := buildKaniko.Run()
Expand Down Expand Up @@ -118,9 +121,6 @@ func TestRun(t *testing.T) {

bucketContextTests := []string{"Dockerfile_test_copy_bucket"}

// TODO: remove test_user_run from this when https://github.com/GoogleContainerTools/container-diff/issues/237 is fixed
testsToIgnore := []string{"Dockerfile_test_user_run"}

_, ex, _, _ := runtime.Caller(0)
cwd := filepath.Dir(ex)

Expand Down Expand Up @@ -219,9 +219,18 @@ func TestLayers(t *testing.T) {
offset := map[string]int{
"Dockerfile_test_add": 9,
"Dockerfile_test_scratch": 3,
// the Docker built image combined some of the dirs defined by separate VOLUME commands into one layer
// which is why this offset exists
"Dockerfile_test_volume": 1,
}
for _, dockerfile := range dockerfiles {

t.Run("test_layer_"+dockerfile, func(t *testing.T) {
for _, ignore := range testsToIgnore {
if dockerfile == ignore {
t.SkipNow()
}
}
// Pull the kaniko image
dockerfile = dockerfile[len("dockerfile/")+1:]
dockerImage := strings.ToLower(testRepo + dockerPrefix + dockerfile)
Expand Down

0 comments on commit b1d2d99

Please sign in to comment.