diff --git a/terraform/ec2/mac/main.tf b/terraform/ec2/mac/main.tf index c18944f6f..3791b008f 100644 --- a/terraform/ec2/mac/main.tf +++ b/terraform/ec2/mac/main.tf @@ -126,9 +126,6 @@ resource "null_resource" "integration_test" { "echo Execute integration tests", "export AWS_REGION=${var.region}", "sudo chmod +x ./validator", - "cd amazon-cloudwatch-agent-test", - "git checkout MacOSEC2Test -f", - "cd ..", "./validator --validator-config=${module.validator.instance_validator_config} --preparation-mode=true", "sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:${module.validator.instance_agent_config}", "./validator --validator-config=${module.validator.instance_validator_config} --preparation-mode=false", diff --git a/test/metric/metric_value_query.go b/test/metric/metric_value_query.go index 17505f9ea..eea358074 100644 --- a/test/metric/metric_value_query.go +++ b/test/metric/metric_value_query.go @@ -5,7 +5,6 @@ package metric import ( "context" - "encoding/json" "fmt" "log" "strings" @@ -51,15 +50,6 @@ func (n *MetricValueFetcher) Fetch(namespace, metricName string, metricSpecificD }, } - // Marshal the metricDataQueries slice into JSON with indentation - jsonData, err := json.MarshalIndent(metricDataQueries, "", " ") - if err != nil { - fmt.Println("Error marshaling JSON:", err) - } - - // Print the JSON data - fmt.Println(string(jsonData)) - endTime := time.Now() startTime := subtractMinutes(endTime, 10) getMetricDataInput := cloudwatch.GetMetricDataInput{ diff --git a/validator/main.go b/validator/main.go index bae8bdc92..545a9bac5 100644 --- a/validator/main.go +++ b/validator/main.go @@ -6,7 +6,6 @@ package main import ( "flag" "fmt" - "github.com/aws/amazon-cloudwatch-agent-test/validator/validators/basic" "log" "os" "strings" @@ -19,6 +18,7 @@ import ( "github.com/aws/amazon-cloudwatch-agent-test/util/common" "github.com/aws/amazon-cloudwatch-agent-test/validator/models" "github.com/aws/amazon-cloudwatch-agent-test/validator/validators" + "github.com/aws/amazon-cloudwatch-agent-test/validator/validators/basic" ) var ( diff --git a/validator/validators/basic/basic_validator.go b/validator/validators/basic/basic_validator.go index 8b2a720dd..5925b568c 100644 --- a/validator/validators/basic/basic_validator.go +++ b/validator/validators/basic/basic_validator.go @@ -9,12 +9,12 @@ import ( "strings" "time" - apMetrics "github.com/aws/amazon-cloudwatch-agent-test/test/metric" cwtypes "github.com/aws/aws-sdk-go-v2/service/cloudwatch/types" cwltypes "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" "github.com/aws/aws-sdk-go/aws" "go.uber.org/multierr" + apMetrics "github.com/aws/amazon-cloudwatch-agent-test/test/metric" "github.com/aws/amazon-cloudwatch-agent-test/util/awsservice" "github.com/aws/amazon-cloudwatch-agent-test/util/common" "github.com/aws/amazon-cloudwatch-agent-test/util/common/traces" diff --git a/validator/validators/stress/stress_validator.go b/validator/validators/stress/stress_validator.go index 2c42325ca..440e821fb 100644 --- a/validator/validators/stress/stress_validator.go +++ b/validator/validators/stress/stress_validator.go @@ -406,10 +406,8 @@ func (s *StressValidator) ValidateStressMetric(metricName, metricNamespace strin // Validate if the metrics are not dropping any metrics and able to backfill within the same minute (e.g if the memory_rss metric is having collection_interval 1 // , it will need to have 60 sample counts - 1 datapoint / second) - if ok := awsservice.ValidateSampleCount(metricName, metricNamespace, metricDimensions, startTime, endTime, 5, 10, int32(boundAndPeriod)); !ok { + if ok := awsservice.ValidateSampleCount(metricName, metricNamespace, metricDimensions, startTime, endTime, metricSampleCount-5, metricSampleCount, int32(boundAndPeriod)); !ok { return fmt.Errorf("\n metric %s is not within sample count bound [ %d, %d]", metricName, metricSampleCount-5, metricSampleCount) - } else { - fmt.Println("Yayyyyyyy!!!!!!! sample count is good for :", metricName, metricSampleCount) } return nil