From 1d5554cecef18901f1c1edb827b74fc23361916a Mon Sep 17 00:00:00 2001 From: Seth L <81644108+sethAmazon@users.noreply.github.com> Date: Mon, 8 Jan 2024 11:07:06 -0500 Subject: [PATCH] Add Sanity Test To Darwin And Win (#384) --- terraform/ec2/mac/main.tf | 1 + terraform/ec2/win/main.tf | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/terraform/ec2/mac/main.tf b/terraform/ec2/mac/main.tf index 1ecdc5b83..3791b008f 100644 --- a/terraform/ec2/mac/main.tf +++ b/terraform/ec2/mac/main.tf @@ -130,6 +130,7 @@ resource "null_resource" "integration_test" { "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", "cd ~/amazon-cloudwatch-agent-test", + "echo run sanity test && sudo go test ./test/sanity -p 1 -v", "sudo go test ./test/run_as_user -p 1 -timeout 1h -computeType=EC2 -bucket=${var.s3_bucket} -cwaCommitSha=${var.cwa_github_sha} -instanceId=${aws_instance.cwagent.id} -v", ] } diff --git a/terraform/ec2/win/main.tf b/terraform/ec2/win/main.tf index 5d2eb7801..a558676ce 100644 --- a/terraform/ec2/win/main.tf +++ b/terraform/ec2/win/main.tf @@ -230,6 +230,10 @@ resource "null_resource" "integration_test_run_validator" { "powershell.exe -Command \"Start-Sleep -s 60\"", "powershell.exe -Command \"Invoke-WebRequest -Uri http://localhost:9404 -UseBasicParsing\"", "set AWS_REGION=${var.region}", + "git clone --branch ${var.github_test_repo_branch} ${var.github_test_repo}", + "cd amazon-cloudwatch-agent-test", + "go test ./test/sanity -p 1 -v", + "cd ..", "validator.exe --validator-config=${module.validator.instance_validator_config} --preparation-mode=true", var.use_ssm ? "powershell \"& 'C:\\Program Files\\Amazon\\AmazonCloudWatchAgent\\amazon-cloudwatch-agent-ctl.ps1' -a fetch-config -m ec2 -s -c ssm:${local.ssm_parameter_name}\"" : "powershell \"& 'C:\\Program Files\\Amazon\\AmazonCloudWatchAgent\\amazon-cloudwatch-agent-ctl.ps1' -a fetch-config -m ec2 -s -c file:${module.validator.instance_agent_config}\"", "validator.exe --validator-config=${module.validator.instance_validator_config} --preparation-mode=false"