-
Notifications
You must be signed in to change notification settings - Fork 2
129 lines (108 loc) · 3.51 KB
/
run.e2e-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: "Tests: E2E"
concurrency: # This need to ensure that only a single job or workflow using the same concurrency group will run at a time.
group: ${{ github.workflow }}
cancel-in-progress: false
defaults:
run:
shell: bash
env:
AWS_REGION: us-west-2
NAMESPACE: tftest
IZE_LOG_LEVEL: debug
IZE_PLAIN_TEXT: true
IZE_VERSION: 0.0.0-dev
AWS_PROFILE: debug
on:
workflow_dispatch:
pull_request:
jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
max-parallel: 2 # VPCs are limited
matrix:
include:
- name: complete-worker
env: e2e01
test_name: TestExamplesCompleteWorker
- name: worker-scheduled
env: e2e02
test_name: TestExamplesWorkerSchedule
- name: complete-web
env: e2e03
test_name: TestExamplesCompleteWeb
- name: web-nginx-proxy
env: e2e04
test_name: TestExamplesWebProxy
- name: worker-scheduled-autoscale
env: e2e05
test_name: TestExamplesWorkerAutoScheduled
- name: complete-worker-ec2
env: e2e06
test_name: TestExamplesWorkerEc2
env:
ENV: ${{ matrix.env }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Checkout Code
uses: actions/checkout@v2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_SA }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_SA }}
aws-region: ${{ env.AWS_REGION }}
- name: Generate Test SSH Key
run: ssh-keygen -q -f ~/.ssh/id_rsa
- name: IZE setup
uses: hazelops/[email protected]
with:
version: ${{ env.IZE_VERSION }}
- name: IZE init
run: ize init
- name: IZE create AWS Profile
run: ize gen aws-profile
- name: IZE gen tfenv
run: ize gen tfenv
- name: Copy generated files
run: |
cp -R .ize/env/${{ env.ENV }}/*.* examples/${{ matrix.name }}/
- name: Go TF Test
working-directory: test
run: |
go install github.com/gruntwork-io/terratest/cmd/terratest_log_parser@latest
go mod tidy
go test -v -timeout 60m -run ${{ matrix.test_name }} -coverprofile=coverage-${{ matrix.test_name }}.out -race -covermode=atomic | tee test_output.log
terratest_log_parser -testlog test_output.log -outputdir results
ls -la
- name: Test Summary
uses: test-summary/action@v2
with:
paths: |
test/results/**/*.xml
test/results/*.xml
if: always()
- name: Upload test summary
uses: actions/upload-artifact@v3
with:
name: test-summary-${{ matrix.test_name }}
path: test/test-summary-${{ matrix.test_name }}.md
if: always()
- name: Upload Go test results
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.test_name }}
path: test/coverage-${{ matrix.test_name }}.out
if: always()
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
files: test/coverage-${{ matrix.test_name }}.out
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
name: ${{ matrix.test_name }}