Skip to content

Commit

Permalink
chore(changetracking): Skip feature-flagged custom attributes test (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
amolero-nr authored Oct 25, 2023
1 parent e767a55 commit b215c6b
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion pkg/changetracking/changetracking_api_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package changetracking

import (
"encoding/json"
"fmt"
"log"
"testing"
"time"
Expand All @@ -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)
Expand All @@ -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",
Expand Down

0 comments on commit b215c6b

Please sign in to comment.