Compare commits

...

1 commit

Author SHA1 Message Date
stack72 8f8bd4e7d2 Ensure test binary is available before container tests run
Fixes: #4529

```
--- PASS: TestPulumiDockerImage (0.00s)
    --- PASS: TestPulumiDockerImage/csharp (85.17s)
        environment.go:83: Created new test environment:  /tmp/test-env666104516
        containers_test.go:62: Running command pulumi new typescript -y -f -s moolumi/container-typescript-160a91d61965aa1c
        containers_test.go:57: Running command pulumi stack rm --force --yes
    --- PASS: TestPulumiDockerImage/typescript (45.78s)
        environment.go:83: Created new test environment:  /tmp/test-env852005014
        containers_test.go:62: Running command pulumi new typescript -y -f -s moolumi/container-typescript-160a91e9e7a382d8
        containers_test.go:57: Running command pulumi stack rm --force --yes
    --- PASS: TestPulumiDockerImage/python (42.69s)
        environment.go:83: Created new test environment:  /tmp/test-env236084280
        containers_test.go:62: Running command pulumi new typescript -y -f -s moolumi/container-typescript-160a91f48e216940
        containers_test.go:57: Running command pulumi stack rm --force --yes
PASS
~/code/go/src/github.com/pulumi/pulumi
```
2020-04-30 11:25:52 +01:00

View file

@ -31,24 +31,27 @@ echo_header() {
test_containers() {
# Run tests _within_ the "pulumi" container, ensuring that the CLI is installed
# and working correctly.
pushd ${ROOT}/tests
echo_header "Executing container runtime tests"
# Build the test binary that will be available inside the container
GOOS=linux go test -c -o /tmp/pulumi-test-containers ./containers/...
docker run -e RUN_CONTAINER_TESTS=true \
-e PULUMI_ACCESS_TOKEN=${PULUMI_ACCESS_TOKEN} \
--volume /tmp:/src \
--entrypoint /bin/bash \
pulumi/pulumi:latest \
-c "pip install pipenv && /src/pulumi-test-containers -test.parallel=1 -test.v -test.run TestPulumiDockerImage"
popd
# The actions container should fetch program dependencies from NPM, PIP, etc. before
# executing. These tests just shell out to docker run to confirm that.
# Disabled due to https://github.com/pulumi/pulumi/issues/4136
# echo_header "Executing container entrypoint tests"
# RUN_CONTAINER_TESTS=true go test ${ROOT}/tests/containers/... -test.run TestPulumiActionsImage -test.v
# In case there are any other unit tests defined in the module, run those as well.
pushd ${ROOT}/tests
GOOS=linux go test -c -o /tmp/pulumi-test-containers ${ROOT}/tests/containers/...
popd
# pushd ${ROOT}/tests
# RUN_CONTAINER_TESTS=true go test ./containers/... -test.run TestPulumiActionsImage -test.v
# popd
}
# Publishes the built containers to Docker Hub.