From e29f3255dfdec61fff88f3ec35dd42a5461e24c2 Mon Sep 17 00:00:00 2001 From: Alfredo Molero Date: Wed, 25 Oct 2023 09:56:55 -0400 Subject: [PATCH 1/2] chore(changetracking): Skip feature-flagged custom attributes test --- pkg/changetracking/changetracking_api_integration_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/changetracking/changetracking_api_integration_test.go b/pkg/changetracking/changetracking_api_integration_test.go index ffb03a891..34651066e 100644 --- a/pkg/changetracking/changetracking_api_integration_test.go +++ b/pkg/changetracking/changetracking_api_integration_test.go @@ -17,6 +17,7 @@ import ( ) func TestChangeTrackingCreateDeployment_Basic(t *testing.T) { + t.Skip() t.Parallel() a := newIntegrationTestClient(t) From 44cd0a3a79e76147ca447a36e38e729fa610f6f6 Mon Sep 17 00:00:00 2001 From: Alfredo Molero Date: Wed, 25 Oct 2023 14:35:46 -0400 Subject: [PATCH 2/2] chore: Re-instate changetracking basic test --- .../changetracking_api_integration_test.go | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/pkg/changetracking/changetracking_api_integration_test.go b/pkg/changetracking/changetracking_api_integration_test.go index 34651066e..a60756018 100644 --- a/pkg/changetracking/changetracking_api_integration_test.go +++ b/pkg/changetracking/changetracking_api_integration_test.go @@ -5,6 +5,7 @@ package changetracking import ( "encoding/json" + "fmt" "log" "testing" "time" @@ -17,7 +18,36 @@ import ( ) func TestChangeTrackingCreateDeployment_Basic(t *testing.T) { - t.Skip() + t.Parallel() + + a := newIntegrationTestClient(t) + + input := ChangeTrackingDeploymentInput{ + Changelog: "test", + Commit: "12345a", + DeepLink: "newrelic-client-go", + DeploymentType: ChangeTrackingDeploymentTypeTypes.BASIC, + Description: "This is a test description", + EntityGUID: common.EntityGUID(testhelpers.IntegrationTestApplicationEntityGUID), + GroupId: "deployment", + Timestamp: nrtime.EpochMilliseconds(time.Now()), + User: "newrelic-go-client", + Version: "0.0.1", + } + + res, err := a.ChangeTrackingCreateDeployment( + ChangeTrackingDataHandlingRules{ValidationFlags: []ChangeTrackingValidationFlag{ChangeTrackingValidationFlagTypes.FAIL_ON_FIELD_LENGTH}}, + input, + ) + require.NoError(t, err) + + require.NotNil(t, res) + require.Equal(t, res.EntityGUID, input.EntityGUID) +} + +func TestChangeTrackingCreateDeployment_CustomAttributes(t *testing.T) { + skipMsg := fmt.Sprintf("Skipping %s until custom attributes are out of limited preview.", t.Name()) + t.Skip(skipMsg) t.Parallel() a := newIntegrationTestClient(t) @@ -32,7 +62,7 @@ func TestChangeTrackingCreateDeployment_Basic(t *testing.T) { input := ChangeTrackingDeploymentInput{ Changelog: "test", Commit: "12345a", - CustomAttributes: attrs, + CustomAttributes: ChangeTrackingRawCustomAttributesMap(attrs), DeepLink: "newrelic-client-go", DeploymentType: ChangeTrackingDeploymentTypeTypes.BASIC, Description: "This is a test description",