Skip to content

Commit

Permalink
chore: update obsolete entity GUID to fix failing integration tests
Browse files Browse the repository at this point in the history
chore: update obsolete GUID to fix more failing tests
  • Loading branch information
pranav-new-relic committed Mar 8, 2024
1 parent 003db7e commit ac1ee0b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pkg/changetracking/changetracking_api_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestChangeTrackingCreateDeployment_Basic(t *testing.T) {
DeepLink: "newrelic-client-go",
DeploymentType: ChangeTrackingDeploymentTypeTypes.BASIC,
Description: "This is a test description",
EntityGUID: common.EntityGUID(testhelpers.IntegrationTestApplicationEntityGUID),
EntityGUID: common.EntityGUID(testhelpers.IntegrationTestApplicationEntityGUIDNew),
GroupId: "deployment",
Timestamp: nrtime.EpochMilliseconds(time.Now()),
User: "newrelic-go-client",
Expand Down
4 changes: 2 additions & 2 deletions pkg/entities/entity_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestIntegrationSearchEntitiesByQuery(t *testing.T) {

client := newIntegrationTestClient(t)

query := "domain = 'APM' AND type = 'APPLICATION' and name = 'Dummy App'"
query := "domain = 'APM' AND type = 'APPLICATION' and name = 'Dummy App Pro Max'"

actual, err := client.GetEntitySearchByQuery(
EntitySearchOptions{},
Expand Down Expand Up @@ -126,7 +126,7 @@ func TestIntegrationGetEntities(t *testing.T) {
client := newIntegrationTestClient(t)

// GUID of Dummy App
guids := []common.EntityGUID{testhelpers.IntegrationTestApplicationEntityGUID}
guids := []common.EntityGUID{testhelpers.IntegrationTestApplicationEntityGUIDNew}
actual, err := client.GetEntities(guids)

if e, ok := err.(*http.GraphQLErrorResponse); ok {
Expand Down
4 changes: 2 additions & 2 deletions pkg/entities/tags_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestIntegrationListTags(t *testing.T) {

var (
// GUID of Dummy App
testGUID = common.EntityGUID(testhelpers.IntegrationTestApplicationEntityGUID)
testGUID = common.EntityGUID(testhelpers.IntegrationTestApplicationEntityGUIDNew)
)

client := newIntegrationTestClient(t)
Expand All @@ -35,7 +35,7 @@ func TestIntegrationTaggingAddTagsToEntityAndGetTags(t *testing.T) {
t.Parallel()

var (
testGUID = common.EntityGUID(testhelpers.IntegrationTestApplicationEntityGUID)
testGUID = common.EntityGUID(testhelpers.IntegrationTestApplicationEntityGUIDNew)
)

client := newIntegrationTestClient(t)
Expand Down
12 changes: 6 additions & 6 deletions pkg/nerdstorage/nerdstorage_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,30 +124,30 @@ func TestIntegrationNerdStorageWithEntityScope(t *testing.T) {

client := newIntegrationTestClient(t)

document, err := client.WriteDocumentWithEntityScope(testhelpers.IntegrationTestApplicationEntityGUID, testWriteInput)
document, err := client.WriteDocumentWithEntityScope(testhelpers.IntegrationTestApplicationEntityGUIDNew, testWriteInput)
require.NoError(t, err)
require.NotNil(t, document)

testAlternateWriteInput := testWriteInput
testAlternateWriteInput.DocumentID = testAlternateDocumentID

document, err = client.WriteDocumentWithEntityScope(testhelpers.IntegrationTestApplicationEntityGUID, testAlternateWriteInput)
document, err = client.WriteDocumentWithEntityScope(testhelpers.IntegrationTestApplicationEntityGUIDNew, testAlternateWriteInput)
require.NoError(t, err)
require.NotNil(t, document)

collection, err := client.GetCollectionWithEntityScope(testhelpers.IntegrationTestApplicationEntityGUID, testGetCollectionInput)
collection, err := client.GetCollectionWithEntityScope(testhelpers.IntegrationTestApplicationEntityGUIDNew, testGetCollectionInput)
require.NoError(t, err)
require.NotNil(t, collection)

document, err = client.GetDocumentWithEntityScope(testhelpers.IntegrationTestApplicationEntityGUID, testGetDocumentInput)
document, err = client.GetDocumentWithEntityScope(testhelpers.IntegrationTestApplicationEntityGUIDNew, testGetDocumentInput)
require.NoError(t, err)
require.NotNil(t, document)

ok, err := client.DeleteDocumentWithEntityScope(testhelpers.IntegrationTestApplicationEntityGUID, testDeleteDocumentInput)
ok, err := client.DeleteDocumentWithEntityScope(testhelpers.IntegrationTestApplicationEntityGUIDNew, testDeleteDocumentInput)
require.NoError(t, err)
require.True(t, ok)

ok, err = client.DeleteCollectionWithEntityScope(testhelpers.IntegrationTestApplicationEntityGUID, testDeleteCollectionInput)
ok, err = client.DeleteCollectionWithEntityScope(testhelpers.IntegrationTestApplicationEntityGUIDNew, testDeleteCollectionInput)
require.NoError(t, err)
require.True(t, ok)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/servicelevel/service_level_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TestServiceLevel_Basic(t *testing.T) {
client := newIntegrationTestClient(t)

// GUID of Dummy App
guid := common.EntityGUID(testhelpers.IntegrationTestApplicationEntityGUID)
guid := common.EntityGUID(testhelpers.IntegrationTestApplicationEntityGUIDNew)

eventsInput := ServiceLevelEventsCreateInput{
AccountID: testAccountID,
Expand Down
1 change: 1 addition & 0 deletions pkg/testhelpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var (

// Our integration test Dummy App
const IntegrationTestApplicationEntityGUID = "MzgwNjUyNnxBUE18QVBQTElDQVRJT058NTczNDgyNjM4"
const IntegrationTestApplicationEntityGUIDNew = "MzgwNjUyNnxBUE18QVBQTElDQVRJT058NTUzNDQ4MjAy"

// Our integration test account ID (v2 account)
const IntegrationTestAccountID = 3806526
Expand Down

0 comments on commit ac1ee0b

Please sign in to comment.