diff --git a/.circleci/bootstrap-test-environment.sh b/.circleci/bootstrap-test-environment.sh index b028c5ad2..2e49b12a5 100755 --- a/.circleci/bootstrap-test-environment.sh +++ b/.circleci/bootstrap-test-environment.sh @@ -1,11 +1,14 @@ #!/bin/bash -eo pipefail +PROJECT=$1 +shift + # Avoid the /nonexistent home directory in nobody's /etc/passwd entry. usermod --home /tmp/nobody nobody # Grant read access to nobody, the user which will eventually try to test this # checkout. -mv /root/project /tmp/project +mv "${PROJECT}" /tmp/project # Python build/install toolchain wants to write to the source checkout, too. chown --recursive nobody:nogroup /tmp/project diff --git a/.circleci/config.yml b/.circleci/config.yml index c33b484a4..1b7705f36 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,21 +62,23 @@ jobs: - run: &BOOTSTRAP_TEST_ENVIRONMENT name: "Bootstrap test environment" command: | - ~/project/.circleci/bootstrap-test-environment.sh + ~/project/.circleci/bootstrap-test-environment.sh ~/project - run: &SETUP_VIRTUALENV name: "Setup virtualenv" # pip cannot install packages if the working directory is not # readable. working_directory: "/tmp" - command: "~/project/.circleci/setup-virtualenv.sh" + command: | + ~/project/.circleci/setup-virtualenv.sh - run: &RUN_TESTS name: "Run test suite" # Something about when it re-uses an existing environment blows up # if the working directory is not readable. working_directory: "/tmp" - command: "~/project/.circleci/setup-virtualenv.sh" + command: | + ~/project/.circleci/setup-virtualenv.sh - store_artifacts: &STORE_TEST_LOG # Despite passing --workdir /tmp to tox above, it still runs trial @@ -222,15 +224,17 @@ jobs: - run: <<: *BOOTSTRAP_TEST_ENVIRONMENT command: | - sudo ~/project/.circleci/bootstrap-test-environment.sh + sudo ~/project/.circleci/bootstrap-test-environment.sh ~/project - run: <<: *SETUP_VIRTUALENV - command: "sudo ~/project/.circleci/setup-virtualenv.sh" + command: | + sudo ~/project/.circleci/setup-virtualenv.sh - run: <<: *RUN_TESTS - command: "sudo ~/project/.circleci/setup-virtualenv.sh" + command: | + sudo ~/project/.circleci/setup-virtualenv.sh - store_artifacts: *STORE_TEST_LOG - store_artifacts: *STORE_OTHER_ARTIFACTS