Skip to content

Commit

Permalink
feat: update tests and record cassettes
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainGuarinoni committed Sep 11, 2024
1 parent 2135292 commit d832faf
Show file tree
Hide file tree
Showing 13 changed files with 247 additions and 247 deletions.
22 changes: 11 additions & 11 deletions datadog/resource_datadog_synthetics_test_.go
Original file line number Diff line number Diff line change
Expand Up @@ -2359,7 +2359,16 @@ func buildDatadogAssertions(attr []interface{}) []datadogV1.SyntheticsAssertion
assertionMap := assertion.(map[string]interface{})
if v, ok := assertionMap["type"]; ok {
assertionType := v.(string)
if v, ok := assertionMap["operator"]; ok {
if assertionType == string(datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT) {

Check failure on line 2362 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / linter-checks

undefined: datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT

Check failure on line 2362 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

undefined: datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT

Check failure on line 2362 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

undefined: datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT

Check failure on line 2362 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

undefined: datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT

Check failure on line 2362 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

undefined: datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT

Check failure on line 2362 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

undefined: datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT

Check failure on line 2362 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

undefined: datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT

Check failure on line 2362 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test-tofu

undefined: datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT

Check failure on line 2362 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test-tofu

undefined: datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT

Check failure on line 2362 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

undefined: datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT

Check failure on line 2362 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

undefined: datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT
// Handling the case for javascript assertion that does not contains any `operator`
assertionJavascript := datadogV1.NewSyntheticsAssertionJavascriptWithDefaults()

Check failure on line 2364 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / linter-checks

undefined: datadogV1.NewSyntheticsAssertionJavascriptWithDefaults

Check failure on line 2364 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

undefined: datadogV1.NewSyntheticsAssertionJavascriptWithDefaults

Check failure on line 2364 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

undefined: datadogV1.NewSyntheticsAssertionJavascriptWithDefaults

Check failure on line 2364 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

undefined: datadogV1.NewSyntheticsAssertionJavascriptWithDefaults

Check failure on line 2364 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

undefined: datadogV1.NewSyntheticsAssertionJavascriptWithDefaults

Check failure on line 2364 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

undefined: datadogV1.NewSyntheticsAssertionJavascriptWithDefaults

Check failure on line 2364 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

undefined: datadogV1.NewSyntheticsAssertionJavascriptWithDefaults

Check failure on line 2364 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test-tofu

undefined: datadogV1.NewSyntheticsAssertionJavascriptWithDefaults

Check failure on line 2364 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test-tofu

undefined: datadogV1.NewSyntheticsAssertionJavascriptWithDefaults

Check failure on line 2364 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

undefined: datadogV1.NewSyntheticsAssertionJavascriptWithDefaults

Check failure on line 2364 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

undefined: datadogV1.NewSyntheticsAssertionJavascriptWithDefaults
assertionJavascript.SetType(datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT)

Check failure on line 2365 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / linter-checks

undefined: datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT

Check failure on line 2365 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

undefined: datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT

Check failure on line 2365 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

undefined: datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT

Check failure on line 2365 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

undefined: datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT

Check failure on line 2365 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test-tofu

undefined: datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT

Check failure on line 2365 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

undefined: datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT
if v, ok := assertionMap["code"]; ok {
assertionCode := v.(string)
assertionJavascript.SetCode((assertionCode))
}
assertions = append(assertions, datadogV1.SyntheticsAssertionJavascriptAsSyntheticsAssertion(assertionJavascript))

Check failure on line 2370 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / linter-checks

undefined: datadogV1.SyntheticsAssertionJavascriptAsSyntheticsAssertion

Check failure on line 2370 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

undefined: datadogV1.SyntheticsAssertionJavascriptAsSyntheticsAssertion

Check failure on line 2370 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

undefined: datadogV1.SyntheticsAssertionJavascriptAsSyntheticsAssertion

Check failure on line 2370 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

undefined: datadogV1.SyntheticsAssertionJavascriptAsSyntheticsAssertion

Check failure on line 2370 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test-tofu

undefined: datadogV1.SyntheticsAssertionJavascriptAsSyntheticsAssertion

Check failure on line 2370 in datadog/resource_datadog_synthetics_test_.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

undefined: datadogV1.SyntheticsAssertionJavascriptAsSyntheticsAssertion
} else if v, ok := assertionMap["operator"]; ok {
assertionOperator := v.(string)
if assertionOperator == string(datadogV1.SYNTHETICSASSERTIONJSONSCHEMAOPERATOR_VALIDATES_JSON_SCHEMA) {
assertionJSONSchemaTarget := datadogV1.NewSyntheticsAssertionJSONSchemaTarget(datadogV1.SyntheticsAssertionJSONSchemaOperator(assertionOperator), datadogV1.SyntheticsAssertionType(assertionType))
Expand Down Expand Up @@ -2494,15 +2503,6 @@ func buildDatadogAssertions(attr []interface{}) []datadogV1.SyntheticsAssertion
}
assertions = append(assertions, datadogV1.SyntheticsAssertionTargetAsSyntheticsAssertion(assertionTarget))
}
// Handling the case for javascript assertion that does not contains any `operator`
} else if assertionType == string(datadogV1.SYNTHETICSASSERTIONJAVASCRIPTTYPE_JAVASCRIPT) {
assertionJavascript := datadogV1.NewSyntheticsAssertionJavascriptWithDefaults()
assertionJavascript.SetType(datadogV1.SyntheticsAssertionJavascriptType(assertionType))
if v, ok := assertionMap["code"]; ok {
assertionCode := v.(string)
assertionJavascript.SetCode((assertionCode))
}
assertions = append(assertions, datadogV1.SyntheticsAssertionJavascriptAsSyntheticsAssertion(assertionJavascript))
}
}
}
Expand Down Expand Up @@ -2633,7 +2633,7 @@ func buildTerraformAssertions(actualAssertions []datadogV1.SyntheticsAssertion)
}

if v, ok := assertionTarget.GetCodeOk(); ok {
localAssertion["type"] = v
localAssertion["code"] = v
}
}
localAssertions[i] = localAssertion
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-22T20:29:14.605282+02:00
2024-09-11T16:27:48.498745+02:00
70 changes: 35 additions & 35 deletions datadog/tests/cassettes/TestAccDatadogSyntheticsAPITest_Basic.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-22T20:28:50.151023+02:00
2024-09-11T16:27:48.498854+02:00

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-22T20:29:13.277568+02:00
2024-09-11T16:26:32.901369+02:00
120 changes: 60 additions & 60 deletions datadog/tests/cassettes/TestAccDatadogSyntheticsAPITest_Updated.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-22T20:28:50.145892+02:00
2024-09-11T16:26:32.902496+02:00

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-08-22T20:29:22.46882+02:00
2024-09-11T16:29:08.367667+02:00

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions datadog/tests/resource_datadog_synthetics_test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ func createSyntheticsAPITestStep(ctx context.Context, accProvider func() (*schem
resource.TestCheckResourceAttr(
"datadog_synthetics_test.foo", "variables_from_script", "dd.variable.set('FOO', 'hello');"),
resource.TestCheckResourceAttr(
"datadog_synthetics_test.foo", "assertion.#", "5"),
"datadog_synthetics_test.foo", "assertion.#", "6"),
resource.TestCheckResourceAttr(
"datadog_synthetics_test.foo", "assertion.0.type", "header"),
resource.TestCheckResourceAttr(
Expand Down Expand Up @@ -1360,7 +1360,7 @@ func createSyntheticsAPITestStepNewAssertionsOptions(ctx context.Context, accPro
resource.TestCheckResourceAttr(
"datadog_synthetics_test.bar", "request_client_certificate.0.key.0.filename", "key"),
resource.TestCheckResourceAttr(
"datadog_synthetics_test.bar", "assertion.#", "11"),
"datadog_synthetics_test.bar", "assertion.#", "12"),
resource.TestCheckResourceAttr(
"datadog_synthetics_test.bar", "assertion.0.type", "header"),
resource.TestCheckResourceAttr(
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ require (
google.golang.org/protobuf v1.33.0 // indirect
)

go 1.20
go 1.23

0 comments on commit d832faf

Please sign in to comment.