Skip to content

Commit

Permalink
Remove Windows Tests Until We Figure Out SSH Without Windows Passwrod (
Browse files Browse the repository at this point in the history
  • Loading branch information
sethAmazon authored Oct 3, 2022
1 parent 1e369a6 commit 5f5b142
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 81 deletions.
134 changes: 67 additions & 67 deletions .github/workflows/integrationTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -143,15 +143,14 @@ 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
run: |
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:
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 0 additions & 6 deletions integration/generator/resources/ec2_gpu_test_matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
13 changes: 5 additions & 8 deletions integration/generator/test_case_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
},
Expand All @@ -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 {
Expand Down

0 comments on commit 5f5b142

Please sign in to comment.