Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove mac terraform resource #297

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions generator/test_case_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var testTypeToTestConfig = map[string][]testConfig{
{testDir: "./test/collection_interval"},
{testDir: "./test/metric_dimension"},
{testDir: "./test/restart"},
{testDir: "./test/multi_config"},
//{testDir: "./test/multi_config"},
{
testDir: "./test/acceptance",
targets: map[string]map[string]struct{}{"os": {"ubuntu-20.04": {}}},
Expand Down Expand Up @@ -105,13 +105,13 @@ var testTypeToTestConfig = map[string][]testConfig{
*/
"ec2_mac": {
{testDir: "../../../test/feature/mac"},
{testDir: "../../../test/run_as_user"},
//{testDir: "../../../test/run_as_user"},
},
"ec2_windows": {
{testDir: "../../../test/feature/windows"},
{testDir: "../../../test/restart"},
{testDir: "../../../test/acceptance"},
{testDir: "../../../test/multi_config"},
//{testDir: "../../../test/multi_config"},
// assume role test doesn't add much value, and it already being tested with linux
//{testDir: "../../../test/assume_role"},
},
Expand Down
24 changes: 0 additions & 24 deletions terraform/ec2/mac/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -136,30 +136,6 @@ resource "null_resource" "integration_test" {

}

resource "null_resource" "integration_test_run" {
connection {
type = "ssh"
user = var.user
private_key = local.private_key_content
host = aws_instance.cwagent.public_ip
}

#Run sanity check and integration test
provisioner "remote-exec" {
inline = [
"echo prepare environment",
"export AWS_REGION=${var.region}",
"echo run integration test",
"cd ~/amazon-cloudwatch-agent-test",
"go test ${var.test_dir} -p 1 -timeout 1h -computeType=EC2 -bucket=${var.s3_bucket} -cwaCommitSha=${var.cwa_github_sha} -instanceId=${aws_instance.cwagent.id} -v"
]
}

depends_on = [
null_resource.integration_test_setup,
null_resource.integration_test_wait,
]
}

data "aws_ami" "latest" {
most_recent = true
Expand Down
4 changes: 2 additions & 2 deletions test/multi_config/multi_config_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ func Validate() error {
},
}

expectedMetrics := []string{"mem_used_percent", "cpu_time_active_userdata", "disk_free"}
expectedMetrics := []string{"memory", "cpu_time_active_userdata", "disk_free"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I missed this in the other review

for _, expectedMetric := range expectedMetrics {
err := awsservice.ValidateMetric(expectedMetric, namespace, expectedDimensions)
if err != nil {
log.Printf("CloudWatch Agent apped config not working : %v", err)
log.Printf("CloudWatch Agent append config not working : %v", err)
return err
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/multi_config/multi_config_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func Validate() error {
err = awsservice.ValidateMetric(expectedMetric, namespace, expectedDimensions)
}
if err != nil {
log.Printf("CloudWatch Agent apped config not working : %v", err)
log.Printf("CloudWatch Agent append config not working : %v", err)
return err
}
return nil
Expand Down
14 changes: 14 additions & 0 deletions test/multi_config/parameters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Receivers that agent needs to tests
receivers: ["system"]

#Test case name
test_case: "win_restart"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look like it should be for win_restart

validate_type: "feature"
data_type: "logs"
number_monitored_logs: 1
values_per_minute: "2"
agent_collection_period: 60
cloudwatch_agent_config: "<cloudwatch_agent_config>"
metric_namespace: "CloudWatchAgentWinFeature"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is probably just a copy paste error

metric_validation:
log_validation: