Skip to content

Commit

Permalink
tyring to fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Paramadon committed Jan 14, 2025
1 parent 9a5781e commit 7bb8a18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 90 deletions.
17 changes: 2 additions & 15 deletions .github/workflows/ec2-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ jobs:

# nick-fields/retry@v2 starts at base dir
- name: Terraform apply
if: steps.cache_if_success.outputs.cache-hit != 'true'
uses: nick-fields/retry@v2
with:
max_attempts: 2
Expand All @@ -95,7 +94,7 @@ jobs:
fi
terraform init
if terraform apply --auto-approve \
terraform apply --auto-approve \
-var="ssh_key_value=${{env.PRIVATE_KEY}}" -var="github_test_repo=${{ inputs.test_repo_url }}" \
-var="test_name=${{ matrix.arrays.os }}" \
-var="cwa_github_sha=${{inputs.github_sha}}" -var="install_agent=${{ matrix.arrays.installAgentCommand }}" \
Expand All @@ -113,16 +112,4 @@ jobs:
-var="excluded_tests='${{ matrix.arrays.excludedTests }}'" \
-var="ssh_key_name=${{env.KEY_NAME}}" \
-var="test_dir=${{ matrix.arrays.test_dir }}" \
-var="agent_start=${{ matrix.arrays.agentStartCommand }}"; then terraform destroy -var="region=${{ inputs.region }}" -var="ami=${{ matrix.arrays.ami }}" -auto-approve
else
terraform destroy -var="region=${{ inputs.region }}" -var="ami=${{ matrix.arrays.ami }}" -auto-approve && exit 1
fi
#This is here just in case workflow cancel
- name: Terraform destroy
if: ${{ cancelled() || failure() }}
uses: nick-fields/retry@v2
with:
max_attempts: 2
timeout_minutes: 8
retry_wait_seconds: 5
command: cd ${{ inputs.test_dir }} && terraform destroy -var="region=${{ inputs.region }}" -var="ami=${{ matrix.arrays.ami }}" --auto-approve
-var="agent_start=${{ matrix.arrays.agentStartCommand }}"
76 changes: 1 addition & 75 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ env:
CWA_GITHUB_TEST_REPO_NAME: "aws/amazon-cloudwatch-agent-test"
CWA_GITHUB_TEST_REPO_NAME_TEST: "TravisStark/amazon-cloudwatch-agent-test"
CWA_GITHUB_TEST_REPO_URL: "https://github.com/aws/amazon-cloudwatch-agent-test.git"
CWA_GITHUB_TEST_REPO_BRANCH: "main"
CWA_GITHUB_TEST_REPO_BRANCH_FIX: "performance-test-fix" # Using this branch to test this change
CWA_GITHUB_TEST_REPO_BRANCH: "TestingSELinuxAMI"
TERRAFORM_AWS_ASSUME_ROLE_ITAR: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_ITAR }}
S3_INTEGRATION_BUCKET_ITAR: ${{ vars.S3_INTEGRATION_BUCKET_ITAR }}
TERRAFORM_AWS_ASSUME_ROLE_CN: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_CN }}
Expand Down Expand Up @@ -977,79 +976,6 @@ jobs:
fi
terraform destroy --auto-approve
PerformanceTrackingTest:
name: "PerformanceTrackingTest"
needs: [GenerateTestMatrix]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arrays: ${{ fromJson(needs.GenerateTestMatrix.outputs.ec2_performance_matrix) }}
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
with:
repository: ${{env.CWA_GITHUB_TEST_REPO_NAME_TEST}}
ref: ${{env.CWA_GITHUB_TEST_REPO_BRANCH_FIX}}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ env.TERRAFORM_AWS_ASSUME_ROLE }}
aws-region: us-west-2
role-duration-seconds: ${{ env.TERRAFORM_AWS_ASSUME_ROLE_DURATION }}

- name: Cache if success
id: performance-tracking
uses: actions/cache@v3
with:
path: go.mod
key: performance-tracking-test-${{ github.sha }}-${{ matrix.arrays.os }}-${{ matrix.arrays.arc }}-${{ matrix.arrays.test_dir }}

- name: Set Commit Date to Terraform Variable
id: set_commit_date
run: |
echo "commit_date=$(git show -s --format=%ci ${{ github.sha }})" >> $GITHUB_OUTPUT
- name: Verify Terraform version
if: steps.performance-tracking.outputs.cache-hit != 'true'
run: terraform --version

- name: Terraform apply
if: steps.performance-tracking.outputs.cache-hit != 'true'
uses: nick-fields/retry@v2
with:
max_attempts: 1
timeout_minutes: 60
retry_wait_seconds: 5
command: |
cd terraform/performance
terraform init
if terraform apply --auto-approve \
-var="ssh_key_value=${PRIVATE_KEY}" \
-var="cwa_github_sha=${GITHUB_SHA}" \
-var="cwa_github_sha_date=${{steps.set_commit_date.outputs.commit_date}}" \
-var="ami=${{ matrix.arrays.ami }}" \
-var="arc=${{ matrix.arrays.arc }}" \
-var="s3_bucket=${S3_INTEGRATION_BUCKET}" \
-var="ssh_key_name=${KEY_NAME}" \
-var="values_per_minute=${{ matrix.arrays.values_per_minute}}"\
-var="family=${{ matrix.arrays.family}}"\
-var="test_dir=${{ matrix.arrays.test_dir }}" ; then terraform destroy -auto-approve
else
terraform destroy -auto-approve && exit 1
fi
- name: Terraform destroy
if: ${{ cancelled() || failure() }}
uses: nick-fields/retry@v2
with:
max_attempts: 3
timeout_minutes: 8
retry_wait_seconds: 5
command: cd terraform/performance && terraform destroy --auto-approve
EC2WinPerformanceTest:
name: "EC2WinPerformanceTest"
Expand Down

0 comments on commit 7bb8a18

Please sign in to comment.