Skip to content

Commit 81a29be

Browse files
authored
refactor(tests): add more granular test tags (per env per product) (#303)
* refactor(tests): add sysdig_monitor, sysdig_secure, ibm_monitor build tags * refactor(tests): set add tests granularity in github actions
1 parent aa90768 commit 81a29be

File tree

58 files changed

+108
-86
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+108
-86
lines changed

.github/workflows/test.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
- name: Test
2323
run: make test
2424

25-
test-sysdig:
26-
name: Sysdig Acceptance Tests
25+
test-sysdig-monitor:
26+
name: Sysdig Monitor Acceptance Tests
2727
runs-on: ubuntu-latest
2828
needs: test
2929

@@ -41,11 +41,12 @@ jobs:
4141
- name: Test
4242
run: make testacc
4343
env:
44+
TEST_SUITE: tf_acc_sysdig_monitor
4445
SYSDIG_MONITOR_API_TOKEN: ${{ secrets.KUBELAB_MONITOR_API_TOKEN }}
4546
SYSDIG_SECURE_API_TOKEN: ${{ secrets.KUBELAB_SECURE_API_TOKEN }}
4647

47-
test-ibm:
48-
name: IBM Acceptance Tests
48+
test-sysdig-secure:
49+
name: Sysdig Secure Acceptance Tests
4950
runs-on: ubuntu-latest
5051
needs: test
5152

@@ -61,8 +62,32 @@ jobs:
6162
cache: true
6263

6364
- name: Test
64-
run: make testacc-ibm
65+
run: make testacc
66+
env:
67+
TEST_SUITE: tf_acc_sysdig_secure
68+
SYSDIG_MONITOR_API_TOKEN: ${{ secrets.KUBELAB_MONITOR_API_TOKEN }}
69+
SYSDIG_SECURE_API_TOKEN: ${{ secrets.KUBELAB_SECURE_API_TOKEN }}
70+
71+
test-ibm-monitor:
72+
name: IBM Monitor Acceptance Tests
73+
runs-on: ubuntu-latest
74+
needs: test
75+
76+
steps:
77+
- name: Check out code
78+
uses: actions/checkout@v2
79+
80+
- name: Set up Go
81+
uses: actions/setup-go@v3
82+
with:
83+
go-version: ${{ env.GO_VERSION }}
84+
check-latest: true
85+
cache: true
86+
87+
- name: Test
88+
run: make testacc
6589
env:
90+
TEST_SUITE: tf_acc_ibm_monitor
6691
SYSDIG_IBM_MONITOR_API_KEY: ${{ secrets.TERRAFORM_IBM_API_KEY }}
6792
SYSDIG_IBM_MONITOR_INSTANCE_ID: ${{ secrets.TERRAFORM_IBM_MONITOR_INSTANCE_ID }}
6893
SYSDIG_IBM_MONITOR_IAM_URL: "https://iam.test.cloud.ibm.com"

GNUmakefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ test: fmtcheck
4040
testacc: fmtcheck
4141
CGO_ENABLED=1 TF_ACC=1 go test $(TEST) -v $(TESTARGS) -tags=$(TEST_SUITE) -timeout 120m -race -parallel=1
4242

43-
testacc-ibm: fmtcheck
44-
CGO_ENABLED=1 TF_ACC=1 go test $(TEST) -v $(TESTARGS) -tags=tf_acc_ibm -timeout 120m -race -parallel=1
45-
4643
junit-report: fmtcheck
4744
@go install github.com/jstemmer/go-junit-report/v2@latest
4845
CGO_ENABLED=1 TF_ACC=1 go test $(TEST) -v $(TESTARGS) -tags=$(TEST_SUITE) -timeout 120m -race 2>&1 -parallel=1 | go-junit-report -iocopy -out junit-report.xml

sysdig/common_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build tf_acc_sysdig || tf_acc_ibm || unit
1+
//go:build tf_acc_sysdig || tf_acc_sysdig_monitor || tf_acc_sysdig_secure || tf_acc_ibm || tf_acc_ibm_monitor || unit
22

33
package sysdig_test
44

sysdig/data_source_sysdig_current_user_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build tf_acc_sysdig || tf_acc_ibm
1+
//go:build tf_acc_sysdig || tf_acc_sysdig_monitor || tf_acc_sysdig_secure || tf_acc_ibm || tf_acc_ibm_monitor
22

33
package sysdig_test
44

sysdig/data_source_sysdig_fargate_workload_agent_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build tf_acc_sysdig
1+
//go:build tf_acc_sysdig || tf_acc_sysdig_monitor || tf_acc_sysdig_secure
22

33
package sysdig_test
44

sysdig/data_source_sysdig_monitor_notification_channel_email_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build tf_acc_sysdig || tf_acc_ibm
1+
//go:build tf_acc_sysdig || tf_acc_sysdig_monitor || tf_acc_ibm || tf_acc_ibm_monitor
22

33
package sysdig_test
44

sysdig/data_source_sysdig_monitor_notification_channel_pagerduty_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build tf_acc_sysdig || tf_acc_ibm
1+
//go:build tf_acc_sysdig || tf_acc_sysdig_monitor || tf_acc_ibm || tf_acc_ibm_monitor
22

33
package sysdig_test
44

sysdig/data_source_sysdig_secure_current_connection_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build tf_acc_sysdig
1+
//go:build tf_acc_sysdig || tf_acc_sysdig_secure
22

33
package sysdig_test
44

sysdig/data_source_sysdig_secure_notification_channel_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build tf_acc_sysdig
1+
//go:build tf_acc_sysdig || tf_acc_sysdig_secure
22

33
package sysdig_test
44

sysdig/data_source_sysdig_secure_trusted_cloud_identity_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build tf_acc_sysdig
1+
//go:build tf_acc_sysdig || tf_acc_sysdig_secure
22

33
package sysdig_test
44

0 commit comments

Comments
 (0)