Skip to content

Commit

Permalink
parallelize resource tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vmanilo committed Nov 4, 2024
1 parent 2bc99bb commit 8d11868
Show file tree
Hide file tree
Showing 10 changed files with 1,263 additions and 1,165 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,8 @@ jobs:
needs: build
runs-on: ubuntu-latest
if: "!github.event.pull_request.head.repo.fork"
timeout-minutes: 15
strategy:
max-parallel: 2
max-parallel: 1
fail-fast: false
matrix:
terraform:
Expand Down Expand Up @@ -176,9 +175,8 @@ jobs:
needs: build
runs-on: ubuntu-latest
if: "!github.event.pull_request.head.repo.fork"
timeout-minutes: 15
strategy:
max-parallel: 2
max-parallel: 1
fail-fast: false
matrix:
tofu:
Expand Down Expand Up @@ -225,7 +223,7 @@ jobs:
cleanup:
name: Cleanup
if: "!github.event.pull_request.head.repo.fork"
if: always()
needs: [tests-acceptance, tests-acceptance-opentofu]
runs-on: ubuntu-latest
timeout-minutes: 15
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/smoketests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ jobs:
name: Matrix Acceptance Tests
needs: build
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
max-parallel: 2
max-parallel: 1
fail-fast: false
matrix:
terraform:
Expand Down Expand Up @@ -112,10 +111,8 @@ jobs:
name: OpenTofu Matrix Acceptance Tests
needs: build
runs-on: ubuntu-latest
if: "!github.event.pull_request.head.repo.fork"
timeout-minutes: 15
strategy:
max-parallel: 2
max-parallel: 1
fail-fast: false
matrix:
tofu:
Expand Down
32 changes: 16 additions & 16 deletions twingate/internal/test/acctests/resource/connector-tokens_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ import (
)

func TestAccRemoteConnectorWithTokens(t *testing.T) {
t.Run("Test Twingate Resource : Acc Remote Connector With Tokens", func(t *testing.T) {
const terraformResourceName = "test_t1"
theResource := acctests.TerraformConnectorTokens(terraformResourceName)
remoteNetworkName := test.RandomName()
t.Parallel()

sdk.Test(t, sdk.TestCase{
ProtoV6ProviderFactories: acctests.ProviderFactories,
PreCheck: func() { acctests.PreCheck(t) },
CheckDestroy: acctests.CheckTwingateConnectorTokensInvalidated,
Steps: []sdk.TestStep{
{
Config: terraformResourceTwingateConnectorTokens(terraformResourceName, remoteNetworkName),
Check: acctests.ComposeTestCheckFunc(
checkTwingateConnectorTokensSet(theResource),
),
},
const terraformResourceName = "test_t1"
theResource := acctests.TerraformConnectorTokens(terraformResourceName)
remoteNetworkName := test.RandomName()

sdk.Test(t, sdk.TestCase{
ProtoV6ProviderFactories: acctests.ProviderFactories,
PreCheck: func() { acctests.PreCheck(t) },
CheckDestroy: acctests.CheckTwingateConnectorTokensInvalidated,
Steps: []sdk.TestStep{
{
Config: terraformResourceTwingateConnectorTokens(terraformResourceName, remoteNetworkName),
Check: acctests.ComposeTestCheckFunc(
checkTwingateConnectorTokensSet(theResource),
),
},
})
},
})
}

Expand Down
Loading

0 comments on commit 8d11868

Please sign in to comment.