Skip to content

Commit

Permalink
Run more tests in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
julienp committed Jul 31, 2024
1 parent 3afced3 commit 014843e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ jobs:
--volume /tmp:/src \
--entrypoint /src/pulumi-test-containers \
${{ env.DOCKER_ORG }}/pulumi-provider-build-environment:${{ env.PULUMI_VERSION }} \
-test.parallel=1 -test.timeout=1h -test.v
-test.timeout=1h -test.v
base:
name: Base image
Expand Down Expand Up @@ -317,7 +317,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.timeout=1h -test.v
ubi-sdk:
name: UBI SDK images
Expand Down Expand Up @@ -401,4 +401,4 @@ jobs:
--volume /tmp:/src \
--entrypoint /src/pulumi-test-containers \
${{ env.DOCKER_ORG }}/pulumi-${{ matrix.sdk }}:${{ env.PULUMI_VERSION }}-ubi \
-test.parallel=1 -test.timeout=1h -test.v -test.run "TestPulumiTemplateTests|TestEnvironment"
-test.timeout=1h -test.v
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ jobs:
--volume /tmp:/src \
--entrypoint /src/pulumi-test-containers \
${{ env.DOCKER_ORG }}/pulumi-provider-build-environment:${{ env.PULUMI_VERSION }} \
-test.parallel=1 -test.timeout=1h -test.v
-test.timeout=1h -test.v
- name: Push ${{ env.PULUMI_VERSION }}
run: docker push ${{ env.DOCKER_ORG }}/pulumi-provider-build-environment:${{ env.PULUMI_VERSION }}
- name: Push latest
Expand Down Expand Up @@ -369,7 +369,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.timeout=1h -test.v
- name: Push image
run: |
docker push ${{ env.IMAGE_NAME }}
Expand Down Expand Up @@ -528,7 +528,7 @@ jobs:
--volume /tmp:/src \
--entrypoint /src/pulumi-test-containers \
${{ env.DOCKER_ORG }}/pulumi-${{ matrix.sdk }}:${{ env.PULUMI_VERSION }}-ubi \
-test.parallel=1 -test.timeout=1h -test.v -test.run "TestPulumiTemplateTests|TestEnvironment"
-test.timeout=1h -test.v
- name: Push image
run: |
docker push ${{ env.DOCKER_ORG }}/pulumi-${{ matrix.sdk }}:${{ env.PULUMI_VERSION }}-ubi
Expand Down
10 changes: 7 additions & 3 deletions tests/containers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ func TestKitchenSinkPythonVersions(t *testing.T) {
})
}

func TestCLIToolTests(t *testing.T) {
func TestCloudCLIToolTests(t *testing.T) {
if !isKitchenSink(t) {
t.Skip("Only running Cloud CLI tool tests on kitchen sink")
}
t.Parallel()

t.Run("Azure CLI", func(t *testing.T) {
Expand Down Expand Up @@ -230,10 +233,10 @@ func TestEnvironment(t *testing.T) {
t.Logf("Testing image variant: %s", imageVariant)

t.Run("Python", func(t *testing.T) {
t.Parallel()
if !hasPython(t) {
t.Skip("Skipping test for images without python")
}
t.Parallel()
expected := "/usr/local/bin/python"
if isKitchenSink(t) {
expected = "/pyenv/shims/python"
Expand All @@ -249,14 +252,14 @@ func TestEnvironment(t *testing.T) {
})

t.Run("Node", func(t *testing.T) {
t.Parallel()
if !hasNodejs(t) {
t.Skip("Skipping test for images without nodejs")
}
expected := "/usr/local/bin/node"
if isUBI(t) || isKitchenSink(t) {
expected = "/usr/bin/node"
}
t.Parallel()
p, err := exec.LookPath("node")
require.NoError(t, err)
require.Equal(t, expected, p)
Expand All @@ -265,6 +268,7 @@ func TestEnvironment(t *testing.T) {
})

t.Run("PATH", 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 014843e

Please sign in to comment.