1- //+build linux darwin
1+ //go:build linux || darwin
2+ // +build linux darwin
23
34/*
45* Copyright 2019 New Relic Corporation. All rights reserved.
@@ -57,11 +58,20 @@ func TestConfigDir(t *testing.T) {
5758 r := fintegration .GetTestRuntime ()
5859 fintegration .RunFlex (r )
5960 expectedSamples := []string {
60- `{"event_type":"flexStatusSample","flex.IntegrationVersion":"Unknown-SNAPSHOT","flex.counter.ConfigsProcessed":3,"flex.counter.EventCount":3,"flex.counter.EventDropCount":0,"flex.counter.MessageSample":2,"flex.counter.commandJsonOutSample":1}` ,
61- `{"error":"true","event_type":"MessageSample","integration_name":"com.newrelic.nri-flex","integration_version":"Unknown-SNAPSHOT","message":"bye","value":20.9}` ,
62- `{"error":"false","event_type":"MessageSample","integration_name":"com.newrelic.nri-flex","integration_version":"Unknown-SNAPSHOT","message":"hello","value":100}` ,
61+ `{"event_type":"flexStatusSample","flex.IntegrationVersion":"Unknown-SNAPSHOT","flex.counter.ConfigsProcessed":6,` +
62+ `"flex.counter.EventCount":6,"flex.counter.EventDropCount":0,"flex.counter.MessageLegacySample":2,` +
63+ `"flex.counter.MessageSample":2,"flex.counter.commandJsonOutSample":2}` ,
64+ `{"error":"true","event_type":"MessageSample","message":"bye","value":20.9}` ,
65+ `{"error":"false","event_type":"MessageSample","message":"hello","value":100}` ,
66+ `{"error":"true","event_type":"MessageLegacySample","integration_name":"com.newrelic.nri-flex",` +
67+ `"integration_version":"Unknown-SNAPSHOT","message":"bye","value":20.9}` ,
68+ `{"error":"false","event_type":"MessageLegacySample","integration_name":"com.newrelic.nri-flex",` +
69+ `"integration_version":"Unknown-SNAPSHOT","message":"hello","value":100}` ,
70+ `{"completed":"false","event_type":"commandJsonOutSample","id":1,` +
71+ `"myCustomAttr":"theValue","title":"delectus aut autem","userId":1}` ,
6372 `{"completed":"false","event_type":"commandJsonOutSample","id":1,"integration_name":"com.newrelic.nri-flex",` +
64- `"integration_version":"Unknown-SNAPSHOT","myCustomAttr":"theValue","title":"delectus aut autem","userId":1}` }
73+ `"integration_version":"Unknown-SNAPSHOT","myCustomAttr":"theValue","title":"delectus aut autem","userId":1}` ,
74+ }
6575 testSamples (expectedSamples , load .Entity .Metrics , t )
6676}
6777
@@ -74,7 +84,7 @@ func TestConfigFile(t *testing.T) {
7484 fintegration .RunFlex (r )
7585 expectedSamples := []string {
7686 `{"event_type":"flexStatusSample","flex.IntegrationVersion":"Unknown-SNAPSHOT","flex.counter.ConfigsProcessed":1,"flex.counter.EventCount":1,"flex.counter.EventDropCount":0,"flex.counter.commandJsonOutSample":1}` ,
77- `{"completed":"false","event_type":"commandJsonOutSample","id":1,"integration_name":"com.newrelic.nri-flex", ` +
78- `"integration_version":"Unknown-SNAPSHOT"," myCustomAttr":"theValue","title":"delectus aut autem","userId":1}` }
87+ `{"completed":"false","event_type":"commandJsonOutSample","id":1,` +
88+ `"myCustomAttr":"theValue","title":"delectus aut autem","userId":1}` }
7989 testSamples (expectedSamples , load .Entity .Metrics , t )
8090}
0 commit comments