Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Mark McDonnell <[email protected]>
  • Loading branch information
mdenomy and Integralist authored Dec 7, 2023
1 parent a807a70 commit db472f5
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions fastly/block_fastly_service_logging_newrelicotlp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,8 @@ func TestAccFastlyServiceVCL_logging_newrelicotlp_basic(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testAccCheckServiceExists("fastly_service_vcl.foo", &service),
testAccCheckFastlyServiceVCLNewRelicOTLPAttributes(&service, []*gofastly.NewRelicOTLP{&log1}, ServiceTypeVCL),
resource.TestCheckResourceAttr(
"fastly_service_vcl.foo", "name", name),
resource.TestCheckResourceAttr(
"fastly_service_vcl.foo", "logging_newrelicotlp.#", "1"),
resource.TestCheckResourceAttr("fastly_service_vcl.foo", "name", name),
resource.TestCheckResourceAttr("fastly_service_vcl.foo", "logging_newrelicotlp.#", "1"),
),
},

Expand All @@ -119,10 +117,8 @@ func TestAccFastlyServiceVCL_logging_newrelicotlp_basic(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testAccCheckServiceExists("fastly_service_vcl.foo", &service),
testAccCheckFastlyServiceVCLNewRelicOTLPAttributes(&service, []*gofastly.NewRelicOTLP{&log1AfterUpdate, &log2}, ServiceTypeVCL),
resource.TestCheckResourceAttr(
"fastly_service_vcl.foo", "name", name),
resource.TestCheckResourceAttr(
"fastly_service_vcl.foo", "logging_newrelicotlp.#", "2"),
resource.TestCheckResourceAttr("fastly_service_vcl.foo", "name", name),
resource.TestCheckResourceAttr("fastly_service_vcl.foo", "logging_newrelicotlp.#", "2"),
),
PreventDiskCleanup: true,
},
Expand Down Expand Up @@ -159,14 +155,6 @@ func testAccCheckFastlyServiceVCLNewRelicOTLPAttributes(service *gofastly.Servic
dl.CreatedAt = nil
dl.UpdatedAt = nil

// Ignore VCL attributes for Compute and set to whatever is returned from the API.
if serviceType == ServiceTypeCompute {
dl.FormatVersion = d.FormatVersion
dl.Format = d.Format
dl.ResponseCondition = d.ResponseCondition
dl.Placement = d.Placement
}

if diff := cmp.Diff(d, dl); diff != "" {
return fmt.Errorf("bad match NewRelic OTLP logging match: %s", diff)
}
Expand Down

0 comments on commit db472f5

Please sign in to comment.