Skip to content

Commit 7d2139a

Browse files
committed
🔧 Skip asset routing tests for parallel execution safety on multiple Terraform versions
1 parent 8cd2ec3 commit 7d2139a

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ jobs:
6565
- '1.11.*'
6666
- '1.12.*'
6767
- '1.13.*'
68+
include:
69+
# Org-scoped asset routing tests mutate shared state, so only run them
70+
# on a single Terraform version to avoid parallel conflicts.
71+
- terraform: '1.13.*'
72+
run_asset_routing_tests: true
6873
steps:
6974
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7075
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
@@ -79,6 +84,7 @@ jobs:
7984
- env:
8085
TF_ACC: "1"
8186
MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_CONFIG_BASE64 }}
87+
RUN_ASSET_ROUTING_TESTS: ${{ matrix.run_asset_routing_tests }}
8288
run: go test -v -cover ./internal/provider/
8389
timeout-minutes: 10
8490

‎internal/provider/asset_routing_rule_resource_test.go‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ package provider
55

66
import (
77
"fmt"
8+
"os"
89
"testing"
910

1011
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
1112
)
1213

1314
func TestAccAssetRoutingRuleResource(t *testing.T) {
15+
if os.Getenv("RUN_ASSET_ROUTING_TESTS") != "true" {
16+
t.Skip("skipping: asset routing tests only run on a single TF version to avoid parallel conflicts")
17+
}
1418
orgID, err := getOrgId()
1519
if err != nil {
1620
t.Skip("skipping: no org-scoped service account available")
@@ -57,6 +61,9 @@ func TestAccAssetRoutingRuleResource(t *testing.T) {
5761
}
5862

5963
func TestAccAssetRoutingRuleResourceWithLabel(t *testing.T) {
64+
if os.Getenv("RUN_ASSET_ROUTING_TESTS") != "true" {
65+
t.Skip("skipping: asset routing tests only run on a single TF version to avoid parallel conflicts")
66+
}
6067
orgID, err := getOrgId()
6168
if err != nil {
6269
t.Skip("skipping: no org-scoped service account available")

‎internal/provider/asset_routing_table_resource_test.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ package provider
55

66
import (
77
"fmt"
8+
"os"
89
"testing"
910

1011
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
1112
)
1213

1314
func TestAccAssetRoutingTableResource(t *testing.T) {
15+
if os.Getenv("RUN_ASSET_ROUTING_TESTS") != "true" {
16+
t.Skip("skipping: asset routing tests only run on a single TF version to avoid parallel conflicts")
17+
}
1418
orgID, err := getOrgId()
1519
if err != nil {
1620
t.Skip("skipping: no org-scoped service account available")

0 commit comments

Comments
 (0)