Skip to content

Commit

Permalink
test: fixes to some broken integration tests (#2754)
Browse files Browse the repository at this point in the history
Co-authored-by: pranav-new-relic <[email protected]>
  • Loading branch information
vagrawal-newrelic and pranav-new-relic authored Oct 10, 2024
1 parent 2e72740 commit 1f1bf93
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion newrelic/resource_newrelic_key_transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"regexp"
"testing"
"time"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
Expand Down Expand Up @@ -88,12 +89,16 @@ func testAccNewRelicCheckKeyTransactionExists(resourceName string) resource.Test

client := testAccProvider.Meta().(*ProviderConfig).NewClient

time.Sleep(5 * time.Second)
found, err := client.Entities.GetEntity(common.EntityGUID(rs.Primary.ID))
if err != nil {
return fmt.Errorf(err.Error())
}

x := (*found).(*entities.KeyTransactionEntity)
x, foundOk := (*found).(*entities.KeyTransactionEntity)
if !foundOk {
return fmt.Errorf("no key transaction found")
}
if x.GUID != common.EntityGUID(rs.Primary.ID) {
return fmt.Errorf("key transaction not found")
}
Expand Down
8 changes: 4 additions & 4 deletions newrelic/resource_newrelic_monitor_downtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,12 @@ var fewValidTimeZones = []string{

// monitors with the below GUIDs belong to the v2 Integration Tests Account
var monitorGUIDsAsString = convertStringListToString([]string{
"MzgwNjUyNnxTWU5USHxNT05JVE9SfGFmZmM0MTRiLTVhNmMtNGI5NS1iMzYwLThhNmQ2ZTkzOTM3Yw",
"MzgwNjUyNnxTWU5USHxNT05JVE9SfDQ3ZWI5YmYzLWRiOTEtNDljYy04MzM2LTBhZWJhNTE5MzhiOQ",
})
var monitorGUIDsUpdatedAsString = convertStringListToString([]string{
"MzgwNjUyNnxTWU5USHxNT05JVE9SfDhkYmMyYmIwLTQwZjgtNDA5NC05OTA1LTdhZGE2ZGViMmEwNg",
"MzgwNjUyNnxTWU5USHxNT05JVE9SfDViZDNmYTk4LTA2NjgtNGQ1Yy05ODU2LTk3MzlmNWViY2JlNg",
"MzgwNjUyNnxTWU5USHxNT05JVE9SfGFmZmM0MTRiLTVhNmMtNGI5NS1iMzYwLThhNmQ2ZTkzOTM3Yw",
"MzgwNjUyNnxTWU5USHxNT05JVE9SfDkwODEwNTRhLWRhYTAtNGI0Mi05YmIwLTY3M2M1MDI2ZWYyOA",
"MzgwNjUyNnxTWU5USHxNT05JVE9SfGEyNWRmOTIwLTcxYjUtNDlmYy1iZTgzLTBhOGE0NjdiYWNhMg",
"MzgwNjUyNnxTWU5USHxNT05JVE9SfDAzNjQ0ZDNlLTg0YzMtNDQyMC1hYjM4LTc0ZjBjODI4NTk3ZA",
})

func convertStringListToString(list []string) string {
Expand Down

0 comments on commit 1f1bf93

Please sign in to comment.