CloudWatch: Move logger to its own package and minor refactoring (#57107)

* Move log to its own package

* Rename test-data to testdata

* Change alias to string type

* Remove parseQueries from a method of cloudWatchExecutor
This commit is contained in:
Shirley
2022-10-18 04:21:18 -04:00
committed by GitHub
parent 2815343ee5
commit 65939ce5b1
14 changed files with 56 additions and 37 deletions
+3 -4
View File
@@ -350,8 +350,7 @@ func TestRequestParser(t *testing.T) {
t.Run("parseRequestQuery sets label when label is present in json query", func(t *testing.T) {
query := getBaseJsonQuery()
alias := "some alias"
query.Alias = &alias
query.Alias = "some alias"
label := "some label"
query.Label = &label
@@ -401,7 +400,7 @@ func Test_migrateAliasToDynamicLabel_single_query_preserves_old_alias_and_create
Region: "us-east-1",
Namespace: "ec2",
MetricName: "CPUUtilization",
Alias: &tc.inputAlias,
Alias: tc.inputAlias,
Dimensions: map[string]interface{}{
"InstanceId": []interface{}{"test"},
},
@@ -413,7 +412,7 @@ func Test_migrateAliasToDynamicLabel_single_query_preserves_old_alias_and_create
migrateAliasToDynamicLabel(&queryToMigrate)
expected := QueryJson{
Alias: &tc.inputAlias,
Alias: tc.inputAlias,
Dimensions: map[string]interface{}{
"InstanceId": []interface{}{"test"},
},