From 5f5b1429a2829c7a2e93622a576ac508381d366a Mon Sep 17 00:00:00 2001 From: Seth L <81644108+sethAmazon@users.noreply.github.com> Date: Mon, 3 Oct 2022 14:18:07 -0400 Subject: [PATCH] Remove Windows Tests Until We Figure Out SSH Without Windows Passwrod (#602) --- .github/workflows/integrationTest.yml | 134 +++++++++--------- .../resources/ec2_gpu_test_matrix.json | 6 - integration/generator/test_case_generator.go | 13 +- 3 files changed, 72 insertions(+), 81 deletions(-) diff --git a/.github/workflows/integrationTest.yml b/.github/workflows/integrationTest.yml index 34f5ce12bc..118982989a 100644 --- a/.github/workflows/integrationTest.yml +++ b/.github/workflows/integrationTest.yml @@ -126,7 +126,7 @@ jobs: ec2_gpu_matrix: ${{ steps.set-matrix.outputs.ec2_gpu_matrix }} ec2_linux_matrix: ${{ steps.set-matrix.outputs.ec2_linux_matrix }} ec2_performance_matrix: ${{steps.set-matrix.outputs.ec2_performance_matrix}} - ec2_windows_matrix: ${{ steps.set-matrix.outputs.ec2_windows_matrix }} +# ec2_windows_matrix: ${{ steps.set-matrix.outputs.ec2_windows_matrix }} ecs_fargate_matrix: ${{ steps.set-matrix.outputs.ecs_fargate_matrix }} steps: - uses: actions/checkout@v2 @@ -143,7 +143,7 @@ jobs: echo "::set-output name=ec2_gpu_matrix::$(echo $(cat integration/generator/resources/ec2_gpu_complete_test_matrix.json))" echo "::set-output name=ec2_linux_matrix::$(echo $(cat integration/generator/resources/ec2_linux_complete_test_matrix.json))" echo "::set-output name=ec2_performance_matrix::$(echo $(cat integration/generator/resources/ec2_performance_complete_test_matrix.json))" - echo "::set-output name=ec2_windows_matrix::$(echo $(cat integration/generator/resources/ec2_windows_complete_test_matrix.json))" +# echo "ec2_windows_matrix: ${{ steps.set-matrix.outputs.ec2_windows_matrix }}" echo "::set-output name=ecs_fargate_matrix::$(echo $(cat integration/generator/resources/ecs_fargate_complete_test_matrix.json))" - name: Echo test plan matrix @@ -151,7 +151,6 @@ jobs: echo "ec2_gpu_matrix: ${{ steps.set-matrix.outputs.ec2_gpu_matrix }}" echo "ec2_linux_matrix: ${{ steps.set-matrix.outputs.ec2_linux_matrix }}" echo "ec2_performance_matrix: ${{ steps.set-matrix.outputs.ec2_performance_matrix}}" - echo "ec2_windows_matrix: ${{ steps.set-matrix.outputs.ec2_windows_matrix }}" echo "ecs_fargate_matrix${{ steps.set-matrix.outputs.ecs_fargate_matrix }}" MakeMSIZip: @@ -557,70 +556,71 @@ jobs: retry_wait_seconds: 5 command: cd integration/terraform/ec2/linux && terraform destroy --auto-approve - EC2WinIntegrationTest: - needs: [BuildMSI, GenerateTestMatrix] - name: 'EC2WinIntegrationTest' - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - arrays: ${{ fromJson(needs.GenerateTestMatrix.outputs.ec2_windows_matrix) }} - permissions: - id-token: write - contents: read - steps: - - uses: actions/checkout@v2 - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: ${{ env.TERRAFORM_AWS_ASSUME_ROLE }} - aws-region: us-west-2 - - - name: Cache if success - id: ec2-win-integration-test - uses: actions/cache@v2 - with: - path: go.mod - key: ec2-win-integration-test-${{ github.sha }}-${{ matrix.arrays.os }} - - - name: Echo OS - run: echo run on ec2 instance os ${{ matrix.arrays.os }} - - - name: Verify Terraform version - run: terraform --version - - # nick-invision/retry@v2 starts at base dir - - name: Terraform apply - if: steps.ec2-win-integration-test.outputs.cache-hit != 'true' - uses: nick-invision/retry@v2 - with: - max_attempts: 3 - timeout_minutes: 15 - retry_wait_seconds: 5 - command: | - cd integration/terraform/ec2/win - terraform init - if terraform apply --auto-approve \ - -var="ssh_key_value=${PRIVATE_KEY}" -var="ssh_key_name=${KEY_NAME}" \ - -var="github_repo=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" \ - -var="github_sha=${GITHUB_SHA}" -var="ami=${{ matrix.arrays.ami }}" \ - -var="test_dir=${{ matrix.arrays.test_dir }}" \ - -var="s3_bucket=${S3_INTEGRATION_BUCKET}" ; then - terraform destroy -auto-approve - else - terraform destroy -auto-approve && exit 1 - fi - - #This is here just in case workflow cancel - - name: Terraform destroy - if: ${{ cancelled() && steps.ec2-win-integration-test.outputs.cache-hit != 'true' }} - uses: nick-invision/retry@v2 - with: - max_attempts: 3 - timeout_minutes: 8 - retry_wait_seconds: 5 - command: cd integration/terraform/ec2/win && terraform destroy --auto-approve -var="ami=${{ matrix.arrays.ami }}" +# @TODO add back when we add back windows tests +# EC2WinIntegrationTest: +# needs: [BuildMSI, GenerateTestMatrix] +# name: 'EC2WinIntegrationTest' +# runs-on: ubuntu-latest +# strategy: +# fail-fast: false +# matrix: +# arrays: ${{ fromJson(needs.GenerateTestMatrix.outputs.ec2_windows_matrix) }} +# permissions: +# id-token: write +# contents: read +# steps: +# - uses: actions/checkout@v2 +# +# - name: Configure AWS Credentials +# uses: aws-actions/configure-aws-credentials@v1 +# with: +# role-to-assume: ${{ env.TERRAFORM_AWS_ASSUME_ROLE }} +# aws-region: us-west-2 +# +# - name: Cache if success +# id: ec2-win-integration-test +# uses: actions/cache@v2 +# with: +# path: go.mod +# key: ec2-win-integration-test-${{ github.sha }}-${{ matrix.arrays.os }} +# +# - name: Echo OS +# run: echo run on ec2 instance os ${{ matrix.arrays.os }} +# +# - name: Verify Terraform version +# run: terraform --version +# +# # nick-invision/retry@v2 starts at base dir +# - name: Terraform apply +# if: steps.ec2-win-integration-test.outputs.cache-hit != 'true' +# uses: nick-invision/retry@v2 +# with: +# max_attempts: 3 +# timeout_minutes: 15 +# retry_wait_seconds: 5 +# command: | +# cd integration/terraform/ec2/win +# terraform init +# if terraform apply --auto-approve \ +# -var="ssh_key_value=${PRIVATE_KEY}" -var="ssh_key_name=${KEY_NAME}" \ +# -var="github_repo=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" \ +# -var="github_sha=${GITHUB_SHA}" -var="ami=${{ matrix.arrays.ami }}" \ +# -var="test_dir=${{ matrix.arrays.test_dir }}" \ +# -var="s3_bucket=${S3_INTEGRATION_BUCKET}" ; then +# terraform destroy -auto-approve +# else +# terraform destroy -auto-approve && exit 1 +# fi +# +# #This is here just in case workflow cancel +# - name: Terraform destroy +# if: ${{ cancelled() && steps.ec2-win-integration-test.outputs.cache-hit != 'true' }} +# uses: nick-invision/retry@v2 +# with: +# max_attempts: 3 +# timeout_minutes: 8 +# retry_wait_seconds: 5 +# command: cd integration/terraform/ec2/win && terraform destroy --auto-approve -var="ami=${{ matrix.arrays.ami }}" StopLocalStack: diff --git a/integration/generator/resources/ec2_gpu_test_matrix.json b/integration/generator/resources/ec2_gpu_test_matrix.json index 8b5e7f1424..1774d143b8 100644 --- a/integration/generator/resources/ec2_gpu_test_matrix.json +++ b/integration/generator/resources/ec2_gpu_test_matrix.json @@ -9,11 +9,5 @@ "arc": "amd64", "binaryName": "amazon-cloudwatch-agent.rpm", "family": "linux" - }, - { - "os": "win-2019", - "instanceType":"g4dn.xlarge", - "ami": "Windows_Server-2019-English-Deep-Learning*", - "family": "window" } ] \ No newline at end of file diff --git a/integration/generator/test_case_generator.go b/integration/generator/test_case_generator.go index 74aafde052..bf9925efb6 100644 --- a/integration/generator/test_case_generator.go +++ b/integration/generator/test_case_generator.go @@ -18,7 +18,7 @@ const ( testDir = "test_dir" ) -//you can't have a const map in golang +// you can't have a const map in golang var osToTestDirMap = map[string][]string{ "ec2_gpu": { "./integration/test/nvidia_gpu", @@ -28,12 +28,9 @@ var osToTestDirMap = map[string][]string{ "./integration/test/cloudwatchlogs", "./integration/test/metrics_number_dimension", }, - "ec2_performance":{ + "ec2_performance": { "./integration/test/performancetest", }, - // @TODO add real tests - "ec2_windows": {""}, - "ec2_mac": {}, "ecs_fargate": { "./integration/test/ecs/ecs_metadata", }, @@ -48,14 +45,14 @@ func main() { func genMatrix(targetOS string, testDirList []string) []map[string]string { openTestMatrix, err := os.Open(fmt.Sprintf("integration/generator/resources/%v_test_matrix.json", targetOS)) - + if err != nil { log.Panicf("can't read file %v_test_matrix.json err %v", targetOS, err) } - + byteValueTestMatrix, _ := ioutil.ReadAll(openTestMatrix) _ = openTestMatrix.Close() - + var testMatrix []map[string]string err = json.Unmarshal(byteValueTestMatrix, &testMatrix) if err != nil {