workdir integration test

This commit is contained in:
Priya Wadhwa 2018-03-26 11:38:02 -07:00
parent 0787a93372
commit a5a84ed552
No known key found for this signature in database
GPG Key ID: 0D0DAFD8F7AA73AE
2 changed files with 41 additions and 38 deletions

View File

@ -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 /

View File

@ -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 {