Skip to content

Commit

Permalink
Test warmer with cache in a volume.
Browse files Browse the repository at this point in the history
  • Loading branch information
mxbossard authored Dec 5, 2023
1 parent 93eff38 commit ee9720a
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,17 +638,22 @@ 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) {
_, ex, _, _ := runtime.Caller(0)
cwd := filepath.Dir(ex + "/cache")

// Start a sleeping warmer container
dockerRunFlags := []string{"run", "--net=host"}
dockerRunFlags = addServiceAccountFlags(dockerRunFlags, config.serviceAccount)
dockerRunFlags = append(dockerRunFlags,
"--entrypoint=/busybox/sh",
"--memory=16m", "--memory-swappiness=0",
"--memory=16m",
"-v", cwd + ":/cache"

Check failure on line 649 in integration/integration_test.go

View workflow job for this annotation

GitHub Actions / tests (integration-test-layers)

missing ',' before newline in argument list

Check failure on line 649 in integration/integration_test.go

View workflow job for this annotation

GitHub Actions / tests

missing ',' before newline in argument list

Check failure on line 649 in integration/integration_test.go

View workflow job for this annotation

GitHub Actions / tests

syntax error: unexpected newline in argument list; possibly missing comma or ) (typecheck)

Check failure on line 649 in integration/integration_test.go

View workflow job for this annotation

GitHub Actions / tests

missing ',' before newline in argument list (typecheck)

Check failure on line 649 in integration/integration_test.go

View workflow job for this annotation

GitHub Actions / tests (integration-test-misc)

missing ',' before newline in argument list

Check failure on line 649 in integration/integration_test.go

View workflow job for this annotation

GitHub Actions / tests (integration-test-misc)

missing ',' before newline in argument list

Check failure on line 649 in integration/integration_test.go

View workflow job for this annotation

GitHub Actions / tests (integration-test-run)

missing ',' before newline in argument list

Check failure on line 649 in integration/integration_test.go

View workflow job for this annotation

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

missing ',' before newline in argument list
WarmerImage,
"-c",
"/kaniko/warmer -i debian:trixie-slim ; /kaniko/warmer -i debian:trixie-slim")
warmTwiceCmd := exec.Command("docker", dockerRunFlags...)
_ = RunCommand(warmTwiceCmd, t)
"--cache-dir=/cache",
"-i", "debian:trixie-slim")
warmCmd := exec.Command("docker", dockerRunFlags...)

_ = RunCommand(warmCmd, t)
_ = RunCommand(warmCmd, t)
}

func verifyBuildWith(t *testing.T, cache, dockerfile string) {
Expand Down

0 comments on commit ee9720a

Please sign in to comment.