Skip to content

Commit 6ed94a5

Browse files
authored
ci: Parallelize tests (#76)
1 parent 0fe2755 commit 6ed94a5

File tree

39 files changed

+43
-49
lines changed

39 files changed

+43
-49
lines changed

sysdig/data_source_sysdig_current_user_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
func TestAccCurrentUser(t *testing.T) {
14-
resource.Test(t, resource.TestCase{
14+
resource.ParallelTest(t, resource.TestCase{
1515
PreCheck: func() {
1616
monitor := os.Getenv("SYSDIG_MONITOR_API_TOKEN")
1717
secure := os.Getenv("SYSDIG_SECURE_API_TOKEN")

sysdig/data_source_sysdig_secure_notification_channel_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
func TestAccNotificationChannelDataSource(t *testing.T) {
1616
rText := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)
1717

18-
resource.Test(t, resource.TestCase{
18+
resource.ParallelTest(t, resource.TestCase{
1919
PreCheck: func() {
2020
if v := os.Getenv("SYSDIG_SECURE_API_TOKEN"); v == "" {
2121
t.Fatal("SYSDIG_SECURE_API_TOKEN must be set for acceptance tests")

sysdig/internal/client/common/client.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import (
77
"log"
88
"net/http"
99
"net/http/httputil"
10+
11+
"github.com/hashicorp/go-retryablehttp"
1012
)
1113

1214
type SysdigCommonClient interface {
@@ -24,7 +26,8 @@ func WithExtraHeaders(client SysdigCommonClient, extraHeaders map[string]string)
2426
}
2527

2628
func NewSysdigCommonClient(sysdigAPIToken string, url string, insecure bool) SysdigCommonClient {
27-
httpClient := &http.Client{
29+
client := retryablehttp.NewClient()
30+
client.HTTPClient = &http.Client{
2831
Transport: &http.Transport{
2932
TLSClientConfig: &tls.Config{InsecureSkipVerify: insecure},
3033
},
@@ -33,7 +36,7 @@ func NewSysdigCommonClient(sysdigAPIToken string, url string, insecure bool) Sys
3336
return &sysdigCommonClient{
3437
SysdigAPIToken: sysdigAPIToken,
3538
URL: url,
36-
httpClient: httpClient,
39+
httpClient: client.StandardClient(),
3740
}
3841
}
3942

sysdig/resource_sysdig_monitor_alert_anomaly_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
func TestAccAlertAnomaly(t *testing.T) {
1616
rText := func() string { return acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) }
1717

18-
resource.Test(t, resource.TestCase{
18+
resource.ParallelTest(t, resource.TestCase{
1919
PreCheck: func() {
2020
if v := os.Getenv("SYSDIG_MONITOR_API_TOKEN"); v == "" {
2121
t.Fatal("SYSDIG_MONITOR_API_TOKEN must be set for acceptance tests")

sysdig/resource_sysdig_monitor_alert_downtime_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
func TestAccAlertDowntime(t *testing.T) {
1616
rText := func() string { return acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) }
1717

18-
resource.Test(t, resource.TestCase{
18+
resource.ParallelTest(t, resource.TestCase{
1919
PreCheck: func() {
2020
if v := os.Getenv("SYSDIG_MONITOR_API_TOKEN"); v == "" {
2121
t.Fatal("SYSDIG_MONITOR_API_TOKEN must be set for acceptance tests")

sysdig/resource_sysdig_monitor_alert_event_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
func TestAccAlertEvent(t *testing.T) {
1616
rText := func() string { return acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) }
1717

18-
resource.Test(t, resource.TestCase{
18+
resource.ParallelTest(t, resource.TestCase{
1919
PreCheck: func() {
2020
if v := os.Getenv("SYSDIG_MONITOR_API_TOKEN"); v == "" {
2121
t.Fatal("SYSDIG_MONITOR_API_TOKEN must be set for acceptance tests")

sysdig/resource_sysdig_monitor_alert_group_outlier_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
func TestAccAlertGroupOutlier(t *testing.T) {
1616
rText := func() string { return acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) }
1717

18-
resource.Test(t, resource.TestCase{
18+
resource.ParallelTest(t, resource.TestCase{
1919
PreCheck: func() {
2020
if v := os.Getenv("SYSDIG_MONITOR_API_TOKEN"); v == "" {
2121
t.Fatal("SYSDIG_MONITOR_API_TOKEN must be set for acceptance tests")

sysdig/resource_sysdig_monitor_alert_metric_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
func TestAccAlertMetric(t *testing.T) {
1616
rText := func() string { return acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) }
1717

18-
resource.Test(t, resource.TestCase{
18+
resource.ParallelTest(t, resource.TestCase{
1919
PreCheck: func() {
2020
if v := os.Getenv("SYSDIG_MONITOR_API_TOKEN"); v == "" {
2121
t.Fatal("SYSDIG_MONITOR_API_TOKEN must be set for acceptance tests")

sysdig/resource_sysdig_monitor_dashboard_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
func TestAccDashboard(t *testing.T) {
1616
rText := func() string { return acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) }
1717

18-
resource.Test(t, resource.TestCase{
18+
resource.ParallelTest(t, resource.TestCase{
1919
PreCheck: func() {
2020
if v := os.Getenv("SYSDIG_MONITOR_API_TOKEN"); v == "" {
2121
t.Fatal("SYSDIG_MONITOR_API_TOKEN must be set for acceptance tests")

sysdig/resource_sysdig_monitor_notification_channel_email_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func TestAccMonitorNotificationChannelEmail(t *testing.T) {
1717

1818
rText := func() string { return acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) }
1919

20-
resource.Test(t, resource.TestCase{
20+
resource.ParallelTest(t, resource.TestCase{
2121
PreCheck: func() {
2222
if v := os.Getenv("SYSDIG_MONITOR_API_TOKEN"); v == "" {
2323
t.Fatal("SYSDIG_MONITOR_API_TOKEN must be set for acceptance tests")

0 commit comments

Comments
 (0)