Merge pull request #15 from mzihlmann/integration-test-does-not-test-caching-2

integration tests args overrides
This commit is contained in:
Martin Zihlmann 2025-05-27 21:03:40 +01:00 committed by GitHub
commit ae16beb628
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 15 additions and 3 deletions

View File

@ -18,3 +18,5 @@
FROM debian:10.13
RUN date > /date
COPY context/foo /foo
# RUN echo hey

View File

@ -20,4 +20,5 @@ FROM debian:10.13
RUN mkdir /foo
WORKDIR /foo
RUN apt-get update && apt-get install -y make
COPY context/bar /context
RUN echo "hey" > foo

View File

@ -20,4 +20,5 @@ FROM debian:10.13
RUN mkdir /foo
WORKDIR /foo
RUN apt-get update && apt-get install -y make
COPY context/bar /context
RUN echo "hey" > foo

View File

@ -18,3 +18,5 @@
FROM debian:10.13
RUN date > /date
COPY context/foo /foo
# RUN echo hey

View File

@ -87,6 +87,12 @@ var additionalKanikoFlagsMap = map[string][]string{
"Dockerfile_test_maintainer": {"--single-snapshot"},
"Dockerfile_test_target": {"--target=second"},
"Dockerfile_test_snapshotter_ignorelist": {"--use-new-run=true", "-v=trace"},
"Dockerfile_test_cache": {"--cache-copy-layers=true"},
"Dockerfile_test_cache_oci": {"--cache-copy-layers=true"},
"Dockerfile_test_cache_install": {"--cache-copy-layers=true"},
"Dockerfile_test_cache_install_oci": {"--cache-copy-layers=true"},
"Dockerfile_test_cache_copy": {"--cache-copy-layers=true"},
"Dockerfile_test_cache_copy_oci": {"--cache-copy-layers=true"},
}
// output check to do when building with kaniko

View File

@ -722,9 +722,9 @@ func TestWarmerTwice(t *testing.T) {
}
func verifyBuildWith(t *testing.T, cache, dockerfile string) {
args := []string{}
if strings.HasPrefix(dockerfile, "Dockerfile_test_cache_copy") {
args = append(args, "--cache-copy-layers=true")
args, ok := additionalKanikoFlagsMap[dockerfile]
if !ok {
args = []string{}
}
// Build the initial image which will cache layers