From a5a84ed552f460d80ef62a9679fdabe8b9eb0d76 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Mon, 26 Mar 2018 11:38:02 -0700 Subject: [PATCH] workdir integration test --- .../dockerfiles/Dockerfile_test_workdir | 9 ++- integration_tests/integration_test_yaml.go | 70 +++++++++---------- 2 files changed, 41 insertions(+), 38 deletions(-) diff --git a/integration_tests/dockerfiles/Dockerfile_test_workdir b/integration_tests/dockerfiles/Dockerfile_test_workdir index 4fa6b6143..6c89e4c11 100644 --- a/integration_tests/dockerfiles/Dockerfile_test_workdir +++ b/integration_tests/dockerfiles/Dockerfile_test_workdir @@ -1,10 +1,13 @@ FROM gcr.io/google-appengine/debian9:latest COPY context/foo foo WORKDIR /test -WORKDIR workdir -COPY context/foo . -RUN cp foo newfoo +# Test that this will be appended on to the previous command, to create /test/workdir +WORKDIR workdir +COPY context/foo ./currentfoo +# Test that the RUN command will happen in the correct directory +RUN cp currentfoo newfoo WORKDIR /new/dir ENV dir /another/new/dir WORKDIR $dir/newdir +WORKDIR $dir/$doesntexist WORKDIR / diff --git a/integration_tests/integration_test_yaml.go b/integration_tests/integration_test_yaml.go index 1a91eb54d..cda55ac61 100644 --- a/integration_tests/integration_test_yaml.go +++ b/integration_tests/integration_test_yaml.go @@ -29,34 +29,34 @@ var fileTests = []struct { context string repo string }{ - // { - // description: "test extract filesystem", - // dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_extract_fs", - // configPath: "/workspace/integration_tests/dockerfiles/config_test_extract_fs.json", - // context: "integration_tests/dockerfiles/", - // repo: "extract-filesystem", - // }, - // { - // description: "test run", - // dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_run", - // configPath: "/workspace/integration_tests/dockerfiles/config_test_run.json", - // context: "integration_tests/dockerfiles/", - // repo: "test-run", - // }, - // { - // description: "test run no files changed", - // dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_run_2", - // configPath: "/workspace/integration_tests/dockerfiles/config_test_run_2.json", - // context: "integration_tests/dockerfiles/", - // repo: "test-run-2", - // }, - // { - // description: "test copy", - // dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_copy", - // configPath: "/workspace/integration_tests/dockerfiles/config_test_copy.json", - // context: "/workspace/integration_tests/", - // repo: "test-copy", - // }, + { + description: "test extract filesystem", + dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_extract_fs", + configPath: "/workspace/integration_tests/dockerfiles/config_test_extract_fs.json", + context: "integration_tests/dockerfiles/", + repo: "extract-filesystem", + }, + { + description: "test run", + dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_run", + configPath: "/workspace/integration_tests/dockerfiles/config_test_run.json", + context: "integration_tests/dockerfiles/", + repo: "test-run", + }, + { + description: "test run no files changed", + dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_run_2", + configPath: "/workspace/integration_tests/dockerfiles/config_test_run_2.json", + context: "integration_tests/dockerfiles/", + repo: "test-run-2", + }, + { + description: "test copy", + dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_copy", + configPath: "/workspace/integration_tests/dockerfiles/config_test_copy.json", + context: "/workspace/integration_tests/", + repo: "test-copy", + }, { description: "test workdir", dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_workdir", @@ -73,13 +73,13 @@ var structureTests = []struct { dockerBuildContext string repo string }{ - // { - // description: "test env", - // dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_env", - // repo: "test-env", - // dockerBuildContext: "/workspace/integration_tests/dockerfiles/", - // structureTestYamlPath: "/workspace/integration_tests/dockerfiles/test_env.yaml", - // }, + { + description: "test env", + dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_env", + repo: "test-env", + dockerBuildContext: "/workspace/integration_tests/dockerfiles/", + structureTestYamlPath: "/workspace/integration_tests/dockerfiles/test_env.yaml", + }, } type step struct {