Skip to content

Commit b169de3

Browse files
committed
changes after review open-telemetry#1: add fieldnames for test structures
1 parent ca13ad7 commit b169de3

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

receiver/azuremonitorreceiver/scraper_test.go

+36-36
Original file line numberDiff line numberDiff line change
@@ -772,79 +772,79 @@ func TestGetMetricAggregations(t *testing.T) {
772772
want []string
773773
}{
774774
{
775-
"should return all aggregations when metrics filter empty",
776-
NestedListAlias{},
777-
aggregations,
775+
name: "should return all aggregations when metrics filter empty",
776+
filters: NestedListAlias{},
777+
want: aggregations,
778778
},
779779
{
780-
"should return all aggregations when namespace not in filters",
781-
NestedListAlias{
780+
name: "should return all aggregations when namespace not in filters",
781+
filters: NestedListAlias{
782782
"another.namespace": nil,
783783
},
784-
aggregations,
784+
want: aggregations,
785785
},
786786
{
787-
"should return all aggregations when metric in filters",
788-
NestedListAlias{
787+
name: "should return all aggregations when metric in filters",
788+
filters: NestedListAlias{
789789
testNamespaceName: {
790790
testMetricName: {},
791791
},
792792
},
793-
aggregations,
793+
want: aggregations,
794794
},
795795
{
796-
"should return all aggregations ignoring metric name case",
797-
NestedListAlias{
796+
name: "should return all aggregations ignoring metric name case",
797+
filters: NestedListAlias{
798798
testNamespaceName: {
799799
strings.ToLower(testMetricName): {},
800800
},
801801
},
802-
aggregations,
802+
want: aggregations,
803803
},
804804
{
805-
"should return all aggregations when asterisk in filters",
806-
NestedListAlias{
805+
name: "should return all aggregations when asterisk in filters",
806+
filters: NestedListAlias{
807807
testNamespaceName: {
808808
testMetricName: {filterAllAggregations},
809809
},
810810
},
811-
aggregations,
811+
want: aggregations,
812812
},
813813
{
814-
"should be empty when metric not in filters",
815-
NestedListAlias{
814+
name: "should be empty when metric not in filters",
815+
filters: NestedListAlias{
816816
testNamespaceName: {
817817
"not_this_metric": {},
818818
},
819819
},
820-
[]string{},
820+
want: []string{},
821821
},
822822
{
823-
"should return one aggregations",
824-
NestedListAlias{
823+
name: "should return one aggregations",
824+
filters: NestedListAlias{
825825
testNamespaceName: {
826826
testMetricName: {aggregations[0]},
827827
},
828828
},
829-
[]string{aggregations[0]},
829+
want: []string{aggregations[0]},
830830
},
831831
{
832-
"should return one aggregations ignoring aggregation case",
833-
NestedListAlias{
832+
name: "should return one aggregations ignoring aggregation case",
833+
filters: NestedListAlias{
834834
testNamespaceName: {
835835
testMetricName: {strings.ToLower(aggregations[0])},
836836
},
837837
},
838-
[]string{aggregations[0]},
838+
want: []string{aggregations[0]},
839839
},
840840
{
841-
"should return many aggregations",
842-
NestedListAlias{
841+
name: "should return many aggregations",
842+
filters: NestedListAlias{
843843
testNamespaceName: {
844844
testMetricName: {aggregations[0], aggregations[2]},
845845
},
846846
},
847-
[]string{aggregations[0], aggregations[2]},
847+
want: []string{aggregations[0], aggregations[2]},
848848
},
849849
}
850850

@@ -869,19 +869,19 @@ func TestMapFindInsensitive(t *testing.T) {
869869
want bool
870870
}{
871871
{
872-
"should find when same case",
873-
testNamespace,
874-
true,
872+
name: "should find when same case",
873+
key: testNamespace,
874+
want: true,
875875
},
876876
{
877-
"should find when different case",
878-
strings.ToLower(testNamespace),
879-
true,
877+
name: "should find when different case",
878+
key: strings.ToLower(testNamespace),
879+
want: true,
880880
},
881881
{
882-
"should not find when not exists",
883-
"microsoft.eventhub/namespaces",
884-
false,
882+
name: "should not find when not exists",
883+
key: "microsoft.eventhub/namespaces",
884+
want: false,
885885
},
886886
}
887887
for _, tt := range tests {

0 commit comments

Comments
 (0)