Only mount a directory with the test binary into the container (#4639)

This commit is contained in:
Chris Smith 2020-05-14 10:05:59 -07:00 committed by GitHub
parent 0d257bb32d
commit 729f7a64c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,15 +32,16 @@ test_containers() {
echo_header "Executing container runtime tests"
# Run the container tests, note that we also build the binaries into /tmp for the next step.
TEST_BIN_DIRECTORY=$(mktemp -d)
pushd ${ROOT}/tests
GOOS=linux go test -c -o /tmp/pulumi-test-containers ${ROOT}/tests/containers/...
GOOS=linux go test -c -o ${TEST_BIN_DIRECTORY} ${ROOT}/tests/containers/...
popd
# Run tests _within_ the "pulumi" container, ensuring that the CLI is installed
# and working correctly.
docker run -e RUN_CONTAINER_TESTS=true \
-e PULUMI_ACCESS_TOKEN=${PULUMI_ACCESS_TOKEN} \
--volume /tmp:/src \
--volume ${TEST_BIN_DIRECTORY}:/src \
--entrypoint /bin/bash \
pulumi/pulumi:latest \
-c "pip install pipenv && /src/pulumi-test-containers -test.parallel=1 -test.v -test.run TestPulumiDockerImage"