Skip to content

Commit

Permalink
Run tests in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
julienp committed Jan 19, 2025
1 parent 4a8154f commit edfc757
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:
--volume /tmp:/src \
--entrypoint /src/pulumi-test-containers \
${{ env.DOCKER_ORG }}/pulumi:${{ env.PULUMI_VERSION }}-${{ matrix.arch }} \
-test.timeout=1h -test.v | sed 's/.*/[root] &/' &
-test.parallel=8 -test.timeout=1h -test.v | sed 's/.*/[root] &/' &
docker run \
-e RUN_CONTAINER_TESTS=true \
-e IMAGE_VARIANT=pulumi-nonroot \
Expand All @@ -203,7 +203,7 @@ jobs:
--volume /tmp:/src \
--entrypoint /src/pulumi-test-containers \
${{ env.DOCKER_ORG }}/pulumi:${{ env.PULUMI_VERSION }}-${{ matrix.arch }}-nonroot \
-test.timeout=1h -test.v | sed 's/.*/[nonroot] &/' &
-test.parallel=8 -test.timeout=1h -test.v | sed 's/.*/[nonroot] &/' &
wait
provider-build-environment:
Expand Down Expand Up @@ -300,7 +300,7 @@ jobs:
--volume /tmp:/src \
--entrypoint /src/pulumi-test-containers \
${{ env.DOCKER_ORG }}/pulumi-provider-build-environment:${{ env.PULUMI_VERSION }}-${{ matrix.arch }} \
-test.parallel=1 -test.timeout=1h -test.v
-test.parallel=8 -test.timeout=1h -test.v
base:
name: Base image
Expand Down Expand Up @@ -443,7 +443,7 @@ jobs:
--entrypoint /src/pulumi-test-containers \
--platform ${{ matrix.arch }} \
${{ env.IMAGE_NAME }} \
-test.parallel=1 -test.timeout=1h -test.v -test.run "TestPulumiTemplateTests|TestEnvironment"
-test.parallel=8 -test.timeout=1h -test.v -test.run "TestPulumiTemplateTests|TestEnvironment"
define-ubi-matrix:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -559,7 +559,7 @@ jobs:
--volume /tmp:/src \
--entrypoint /src/pulumi-test-containers \
${{ env.IMAGE_NAME }} \
-test.parallel=1 -test.timeout=1h -test.v -test.run "TestPulumiTemplateTests|TestEnvironment"
-test.parallel=8 -test.timeout=1h -test.v -test.run "TestPulumiTemplateTests|TestEnvironment"
ci-ok:
name: ci-ok
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
--volume /tmp:/src \
--entrypoint /src/pulumi-test-containers \
${{ env.DOCKER_ORG }}/pulumi:${{ env.PULUMI_VERSION }}-${{ matrix.arch }} \
-test.timeout=1h
-test.parallel=8 -test.timeout=1h
- name: Tests for nonroot variant
run: |
chmod o+r $GOOGLE_APPLICATION_CREDENTIALS
Expand All @@ -179,7 +179,7 @@ jobs:
--volume /tmp:/src \
--entrypoint /src/pulumi-test-containers \
${{ env.DOCKER_ORG }}/pulumi:${{ env.PULUMI_VERSION }}-nonroot-${{ matrix.arch }} \
-test.timeout=1h
-test.parallel=8 -test.timeout=1h
- name: Push ${{ env.PULUMI_VERSION }}
run: |
docker push ${{ env.DOCKER_ORG }}/pulumi:${{ env.PULUMI_VERSION }}-${{ matrix.arch }}
Expand Down Expand Up @@ -314,7 +314,7 @@ jobs:
--volume /tmp:/src \
--entrypoint /src/pulumi-test-containers \
${{ env.DOCKER_ORG }}/pulumi-provider-build-environment:${{ env.PULUMI_VERSION }}-${{ matrix.arch }} \
-test.parallel=1 -test.timeout=1h -test.v
-test.parallel=8 -test.timeout=1h -test.v
- name: Push ${{ env.PULUMI_VERSION }}
run: docker push ${{ env.DOCKER_ORG }}/pulumi-provider-build-environment:${{ env.PULUMI_VERSION }}-${{ matrix.arch }}

Expand Down Expand Up @@ -533,7 +533,7 @@ jobs:
--entrypoint /src/pulumi-test-containers \
--platform ${{ matrix.arch }} \
${{ env.IMAGE_NAME }} \
-test.parallel=1 -test.timeout=1h -test.v -test.run "TestPulumiTemplateTests|TestEnvironment"
-test.parallel=8 -test.timeout=1h -test.v -test.run "TestPulumiTemplateTests|TestEnvironment"
- name: Push image
run: |
docker push ${{ env.IMAGE_NAME }}
Expand Down Expand Up @@ -731,7 +731,7 @@ jobs:
--volume /tmp:/src \
--entrypoint /src/pulumi-test-containers \
${{ env.IMAGE_NAME }} \
-test.parallel=1 -test.timeout=1h -test.v -test.run "TestPulumiTemplateTests|TestEnvironment"
-test.parallel=8 -test.timeout=1h -test.v -test.run "TestPulumiTemplateTests|TestEnvironment"
- name: Push image
run: |
docker push ${{ env.IMAGE_NAME }}
Expand Down
6 changes: 2 additions & 4 deletions tests/containers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ func TestPulumiTemplateTests(t *testing.T) {
for _, test := range testCases {
test := test
t.Run(test.template, func(t *testing.T) {
// TODO: Not running these in parallel to help with disk space.
// https://github.com/pulumi/pulumi-docker-containers/issues/215
// t.Parallel()
e := ptesting.NewEnvironment(t)
defer func() {
e.RunCommand("pulumi", "stack", "rm", "--force", "--yes")
Expand Down Expand Up @@ -144,7 +141,7 @@ func TestKitchenSinkLanguageVersions(t *testing.T) {
require.NoError(t, err)

t.Run("node-default", func(t *testing.T) {
// We need to run the `node-default` test first, before the other tests which modify
// We need o run the `node-default` test first, before the other tests which modify
// the container's default node version.
p := filepath.Join("testdata", "node-default")
copyTestData(t, p)
Expand Down Expand Up @@ -375,6 +372,7 @@ func TestEnvironment(t *testing.T) {
})

t.Run(imageVariant, func(t *testing.T) {
t.Parallel()
// Install scripts for various tools can sometimes modify PATH, usually by adding entries
// to ~/.bashrc. This test ensures that we notice such modifications.
expectedPaths := map[string]string{
Expand Down

0 comments on commit edfc757

Please sign in to comment.