Skip to content

Commit 85e14e8

Browse files
authored
fix[tests]: Fix secure connection tests when run against secure-staging instead of prod (#295)
* Fix test when being run against staging env instead of prod * Fixing the good formating * Run tests over integration without any parallelization * Revert "Run tests over integration without any parallelization" This reverts commit 5a7c79f. * Fix test when run without defining the SECURE_URL Env var * Fix formatting * Fix syntax error * Run integration tests without parallelization So we increase their reliability * Set parallel to 1 into IBM integration tests too
1 parent e1aeaa3 commit 85e14e8

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

GNUmakefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ test: fmtcheck
3434
go test $(TEST) -tags=unit -timeout=30s -parallel=4
3535

3636
testacc: fmtcheck
37-
CGO_ENABLED=1 TF_ACC=1 go test $(TEST) -v $(TESTARGS) -tags=tf_acc_sysdig -timeout 120m -race
37+
CGO_ENABLED=1 TF_ACC=1 go test $(TEST) -v $(TESTARGS) -tags=tf_acc_sysdig -timeout 120m -race -parallel=1
3838

3939
testacc-ibm: fmtcheck
40-
CGO_ENABLED=1 TF_ACC=1 go test $(TEST) -v $(TESTARGS) -tags=tf_acc_ibm -timeout 120m -race
40+
CGO_ENABLED=1 TF_ACC=1 go test $(TEST) -v $(TESTARGS) -tags=tf_acc_ibm -timeout 120m -race -parallel=1
4141

4242
junit-report: fmtcheck
4343
@go install github.com/jstemmer/go-junit-report/v2@latest
44-
CGO_ENABLED=1 TF_ACC=1 go test $(TEST) -v $(TESTARGS) -tags=tf_acc_sysdig -timeout 120m -race 2>&1 | go-junit-report -iocopy -out junit-report.xml
44+
CGO_ENABLED=1 TF_ACC=1 go test $(TEST) -v $(TESTARGS) -tags=tf_acc_sysdig -timeout 120m -race 2>&1 -parallel=1 | go-junit-report -iocopy -out junit-report.xml
4545

4646
vet:
4747
@echo "go vet ."

sysdig/data_source_sysdig_secure_current_connection_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ func TestAccSecureConnection(t *testing.T) {
1717
dataSourceResourceName := "data.sysdig_secure_connection.current"
1818

1919
apiToken := os.Getenv("SYSDIG_SECURE_API_TOKEN")
20+
secureUrl := os.Getenv("SYSDIG_SECURE_URL")
21+
if secureUrl == "" {
22+
secureUrl = "https://secure.sysdig.com"
23+
}
2024

2125
resource.ParallelTest(t, resource.TestCase{
2226

@@ -34,7 +38,7 @@ func TestAccSecureConnection(t *testing.T) {
3438
{
3539
Config: getSysdigSecureCurrentConnection(),
3640
Check: resource.ComposeTestCheckFunc(
37-
resource.TestCheckResourceAttr(dataSourceResourceName, "secure_url", "https://secure.sysdig.com"),
41+
resource.TestCheckResourceAttr(dataSourceResourceName, "secure_url", secureUrl),
3842
resource.TestCheckResourceAttr(dataSourceResourceName, "secure_api_token", apiToken),
3943
),
4044
},

0 commit comments

Comments
 (0)