Skip to content

Commit

Permalink
chore: Run Synthetics API tests sequentially
Browse files Browse the repository at this point in the history
  • Loading branch information
mbazhlekova committed Nov 9, 2023
1 parent 32b46d4 commit 9910b25
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 26 deletions.
2 changes: 1 addition & 1 deletion pkg/synthetics/monitor_locations_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

func TestIntegrationGetMonitorLocations(t *testing.T) {
t.Parallel()
t.Skipf("Synthetics REST API is deprecated")

tc := mock.NewIntegrationTestConfig(t)

Expand Down
2 changes: 1 addition & 1 deletion pkg/synthetics/monitors_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var (
)

func TestIntegrationMonitors(t *testing.T) {
t.Parallel()
t.Skipf("Synthetics REST API is deprecated")

tc := mock.NewIntegrationTestConfig(t)

Expand Down
2 changes: 1 addition & 1 deletion pkg/synthetics/secure_credentials_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var (
)

func TestIntegrationSecureCredentials(t *testing.T) {
t.Parallel()
t.Skipf("Synthetics REST API is deprecated")

tc := mock.NewIntegrationTestConfig(t)
synthetics := New(tc)
Expand Down
27 changes: 4 additions & 23 deletions pkg/synthetics/synthetics_api_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import (
var tv bool = true

func TestSyntheticsSecureCredential_Basic(t *testing.T) {
t.Parallel()

testAccountID, err := mock.GetTestAccountID()
if err != nil {
t.Skipf("%s", err)
Expand All @@ -41,8 +39,6 @@ func TestSyntheticsSecureCredential_Basic(t *testing.T) {
}

func TestSyntheticsSecureCredential_Error(t *testing.T) {
t.Parallel()

testAccountID, err := mock.GetTestAccountID()
if err != nil {
t.Skipf("%s", err)
Expand All @@ -56,7 +52,6 @@ func TestSyntheticsSecureCredential_Error(t *testing.T) {
}

func TestSyntheticsSimpleBrowserMonitor_Basic(t *testing.T) {
t.Parallel()

testAccountID, err := mock.GetTestAccountID()
if err != nil {
Expand Down Expand Up @@ -164,7 +159,6 @@ func TestSyntheticsSimpleBrowserMonitor_Basic(t *testing.T) {
}

func TestSyntheticsSimpleMonitor_Basic(t *testing.T) {
t.Parallel()
testAccountID, err := mock.GetTestAccountID()
if err != nil {
t.Skipf("%s", err)
Expand Down Expand Up @@ -255,7 +249,6 @@ func TestSyntheticsSimpleMonitor_Basic(t *testing.T) {
}

func TestSyntheticsScriptApiMonitor_Basic(t *testing.T) {
t.Parallel()

testAccountID, err := mock.GetTestAccountID()
if err != nil {
Expand Down Expand Up @@ -361,7 +354,6 @@ func TestSyntheticsScriptApiMonitor_Basic(t *testing.T) {
}

func TestSyntheticsScriptApiMonitorLegacy_Basic(t *testing.T) {
t.Parallel()

testAccountID, err := mock.GetTestAccountID()
if err != nil {
Expand Down Expand Up @@ -457,7 +449,6 @@ func TestSyntheticsScriptApiMonitorLegacy_Basic(t *testing.T) {
}

func TestSyntheticsScriptBrowserMonitor_Basic(t *testing.T) {
t.Parallel()
testAccountID, err := mock.GetTestAccountID()
if err != nil {
t.Skipf("%s", err)
Expand Down Expand Up @@ -539,7 +530,6 @@ func TestSyntheticsScriptBrowserMonitor_Basic(t *testing.T) {
}

func TestSyntheticsScriptBrowserMonitor_InvalidRuntimeValues(t *testing.T) {
t.Parallel()
testAccountID, err := mock.GetTestAccountID()
if err != nil {
t.Skipf("%s", err)
Expand Down Expand Up @@ -570,7 +560,6 @@ func TestSyntheticsScriptBrowserMonitor_InvalidRuntimeValues(t *testing.T) {
}

func TestSyntheticsScriptBrowserMonitor_DeviceEmulation(t *testing.T) {
t.Parallel()
testAccountID, err := mock.GetTestAccountID()
if err != nil {
t.Skipf("%s", err)
Expand Down Expand Up @@ -641,7 +630,6 @@ func TestSyntheticsScriptBrowserMonitor_DeviceEmulation(t *testing.T) {
}

func TestSyntheticsScriptBrowserMonitor_LegacyRuntime(t *testing.T) {
t.Parallel()
testAccountID, err := mock.GetTestAccountID()
if err != nil {
t.Skipf("%s", err)
Expand Down Expand Up @@ -702,7 +690,6 @@ func TestSyntheticsScriptBrowserMonitor_LegacyRuntime(t *testing.T) {
}

func TestSyntheticsPrivateLocation_Basic(t *testing.T) {
t.Parallel()

testAccountID, err := mock.GetTestAccountID()
if err != nil {
Expand All @@ -727,7 +714,6 @@ func TestSyntheticsPrivateLocation_Basic(t *testing.T) {
}

func TestSyntheticsBrokenLinksMonitor_Basic(t *testing.T) {
t.Parallel()
testAccountID, err := mock.GetTestAccountID()
if err != nil {
t.Skipf("%s", err)
Expand Down Expand Up @@ -782,7 +768,6 @@ func TestSyntheticsBrokenLinksMonitor_Basic(t *testing.T) {
}

func TestSyntheticsCertCheckMonitor_Basic(t *testing.T) {
t.Parallel()
testAccountID, err := mock.GetTestAccountID()
if err != nil {
t.Skipf("%s", err)
Expand Down Expand Up @@ -840,7 +825,6 @@ func TestSyntheticsCertCheckMonitor_Basic(t *testing.T) {
}

func TestSyntheticsStepMonitor_Basic(t *testing.T) {
t.Parallel()
testAccountID, err := mock.GetTestAccountID()
if err != nil {
t.Skipf("%s", err)
Expand Down Expand Up @@ -908,21 +892,24 @@ func TestSyntheticsStepMonitor_Basic(t *testing.T) {
},
}

time.Sleep(10 * time.Second)

updatedMonitor, err := a.SyntheticsUpdateStepMonitor(createdMonitor.Monitor.GUID, monitorUpdateInput)
require.NoError(t, err)
require.NotNil(t, updatedMonitor.Monitor)
require.Equal(t, 0, len(updatedMonitor.Errors))
require.Equal(t, monitorNameUpdate, updatedMonitor.Monitor.Name)
require.Equal(t, 3, len(updatedMonitor.Monitor.Steps))

time.Sleep(10 * time.Second)

deletedMonitor, err := a.SyntheticsDeleteMonitor(createdMonitor.Monitor.GUID)
require.NoError(t, err)
require.NotNil(t, deletedMonitor)
require.Equal(t, createdMonitor.Monitor.GUID, deletedMonitor.DeletedGUID)
}

func TestSyntheticsStepMonitor_GetSteps(t *testing.T) {
t.Parallel()
testAccountID, err := mock.GetTestAccountID()
if err != nil {
t.Skipf("%s", err)
Expand Down Expand Up @@ -979,7 +966,6 @@ func TestSyntheticsStepMonitor_GetSteps(t *testing.T) {
}

func TestSyntheticsStepMonitor_GetScript(t *testing.T) {
t.Parallel()
testAccountID, err := mock.GetTestAccountID()
if err != nil {
t.Skipf("%s", err)
Expand Down Expand Up @@ -1029,7 +1015,6 @@ func newIntegrationTestClient(t *testing.T) Synthetics {
// syntheticsStartAutomatedTest mutation to create a batch with these three monitors. The expected
// behaviour of this test is to return a valid batchId and throw no error.
func TestSyntheticsStartAutomatedTest_Basic(t *testing.T) {
t.Parallel()
t.Skipf(
`Temporarily skipping tests associated with the Synthetics Automated Tests feature, ` +
`given the API is currently unstable and endpoint access is not configured to all accounts at the moment.
Expand Down Expand Up @@ -1176,7 +1161,6 @@ func TestSyntheticsStartAutomatedTest_Basic(t *testing.T) {
// TestSyntheticsStartAutomatedTest_Error performs a test on the syntheticsStartAutomatedTest mutation by specifying
// an invalid GUID in the input field of a monitor to obtain an error, in alignment with expected behaviour.
func TestSyntheticsStartAutomatedTest_Error(t *testing.T) {
t.Parallel()
t.Skipf(
`Temporarily skipping tests associated with the Synthetics Automated Tests feature, ` +
`given the API is currently unstable and endpoint access is not configured to all accounts at the moment.
Expand All @@ -1198,7 +1182,6 @@ func TestSyntheticsStartAutomatedTest_Error(t *testing.T) {
// TestSyntheticsAutomatedTestResults_TwoMonitorsTest performs a test by creating two scripted browser monitors,
// creating a batch with those monitors, querying the batch and evaluating the status accordingly.
func TestSyntheticsAutomatedTestResults_TwoMonitorsTest(t *testing.T) {
t.Parallel()
t.Skipf(
`Temporarily skipping tests associated with the Synthetics Automated Tests feature, ` +
`given the API is currently unstable and endpoint access is not configured to all accounts at the moment.
Expand Down Expand Up @@ -1285,7 +1268,6 @@ func TestSyntheticsAutomatedTestResults_TwoMonitorsTest(t *testing.T) {
// creating a batch with the monitor, querying the batch and evaluating the status accordingly. Since the scripted
// browser monitor is bound to fail, this tests inspects the consolidated status and the status of the monitor.
func TestSyntheticsAutomatedTestResults_OneMonitorTest(t *testing.T) {
t.Parallel()
t.Skipf(
`Temporarily skipping tests associated with the Synthetics Automated Tests feature, ` +
`given the API is currently unstable and endpoint access is not configured to all accounts at the moment.
Expand Down Expand Up @@ -1351,7 +1333,6 @@ func TestSyntheticsAutomatedTestResults_OneMonitorTest(t *testing.T) {
// TestSyntheticsAutomatedTestResults_ErrorTest performs a test on the automatedTestResults query by
// specifying an invalid batchId, which is expected to throw an error.
func TestSyntheticsAutomatedTestResults_ErrorTest(t *testing.T) {
t.Parallel()
t.Skipf(
`Temporarily skipping tests associated with the Synthetics Automated Tests feature, ` +
`given the API is currently unstable and endpoint access is not configured to all accounts at the moment.
Expand Down

0 comments on commit 9910b25

Please sign in to comment.