Skip to content

Commit

Permalink
Add an integration test to reproduce #2892
Browse files Browse the repository at this point in the history
  • Loading branch information
mxbossard authored Dec 5, 2023
1 parent c803049 commit f72f1cb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,20 @@ func TestCache(t *testing.T) {
}
}

// Attempt to warm an image two times : first time should populate the cache, second time should find the image in the cache.
func TestWarmerTwice(t *testing.T) {
// Start a sleeping warmer container
dockerRunFlags := []string{"run", "--net=host"}
dockerRunFlags = addServiceAccountFlags(dockerRunFlags, config.serviceAccount)
dockerRunFlags = append(dockerRunFlags, WarmerImage,
"--entrypoint=/bin/sh",
"--memory=16m", "--memory-swappiness=0",
"-c",
"/kaniko/warmer -i debian:trixie-slim ; /kaniko/warmer -i debian:trixie-slim")
warmTwiceCmd := exec.Command("docker", dockerRunFlags...)
_ := RunCommand(warmTwiceCmd, t)

Check failure on line 650 in integration/integration_test.go

View workflow job for this annotation

GitHub Actions / tests

no new variables on left side of := (typecheck)

Check failure on line 650 in integration/integration_test.go

View workflow job for this annotation

GitHub Actions / tests (integration-test-layers)

no new variables on left side of :=

Check failure on line 650 in integration/integration_test.go

View workflow job for this annotation

GitHub Actions / tests (integration-test-misc)

no new variables on left side of :=

Check failure on line 650 in integration/integration_test.go

View workflow job for this annotation

GitHub Actions / tests (integration-test-misc)

no new variables on left side of :=

Check failure on line 650 in integration/integration_test.go

View workflow job for this annotation

GitHub Actions / tests (integration-test-run)

no new variables on left side of :=

Check failure on line 650 in integration/integration_test.go

View workflow job for this annotation

GitHub Actions / tests (k8s-executor-build-push integration-test-k8s)

no new variables on left side of :=
}

func verifyBuildWith(t *testing.T, cache, dockerfile string) {
args := []string{}
if strings.HasPrefix(dockerfile, "Dockerfile_test_cache_copy") {
Expand Down

0 comments on commit f72f1cb

Please sign in to comment.