From b215c6b22f2ee531e279e46613b5f013185f0aef Mon Sep 17 00:00:00 2001 From: Alfredo <102765645+amolero-nr@users.noreply.github.com> Date: Wed, 25 Oct 2023 14:51:48 -0400 Subject: [PATCH] chore(changetracking): Skip feature-flagged custom attributes test (#1061) --- .../changetracking_api_integration_test.go | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/pkg/changetracking/changetracking_api_integration_test.go b/pkg/changetracking/changetracking_api_integration_test.go index ffb03a891..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" @@ -21,6 +22,36 @@ func TestChangeTrackingCreateDeployment_Basic(t *testing.T) { 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) + var customAttributes = `{"a":"1","b":"two","c":"1.5","d":"true"}` attrs := make(map[string]interface{}) err := json.Unmarshal([]byte(customAttributes), &attrs) @@ -31,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",