-
Notifications
You must be signed in to change notification settings - Fork 42
193 lines (189 loc) · 8.17 KB
/
e2e-testing.yaml
File metadata and controls
193 lines (189 loc) · 8.17 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: 'E2E Testing'
on:
push:
branches:
- master
pull_request:
jobs:
change-detection:
runs-on: ubuntu-latest
permissions:
pull-requests: read
repository-projects: read
outputs:
cluster: ${{ steps.filter.outputs.cluster }}
flex-cluster: ${{ steps.filter.outputs.flex-cluster }}
project: ${{ steps.filter.outputs.project }}
search-deployment: ${{ steps.filter.outputs.search-deployment }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
if: ${{ github.event_name == 'push' }}
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
id: filter
with:
filters: |
cluster:
- 'cfn-resources/cluster/**'
- 'cfn-resources/test/e2e/cluster/**'
flex-cluster:
- 'cfn-resources/flex-cluster/**'
- 'cfn-resources/test/e2e/flex-cluster/**'
project:
- 'cfn-resources/project/**'
- 'cfn-resources/test/e2e/project/**'
search-deployment:
- 'cfn-resources/search-deployment/**'
- 'cfn-resources/test/e2e/search-deployment/**'
cluster:
needs: change-detection
if: ${{ needs.change-detection.outputs.cluster == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
with:
python-version: '3.9'
cache: 'pip'
- run: pip install cloudformation-cli-go-plugin
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5
with:
go-version-file: 'cfn-resources/go.mod'
- uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_TEST_ENV }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_TEST_ENV }}
aws-region: eu-west-1
- name: Run E2E test
shell: bash
env:
MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.CLOUD_DEV_PUBLIC_KEY }}
MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.CLOUD_DEV_PRIVATE_KEY }}
MONGODB_ATLAS_ORG_ID: ${{ secrets.CLOUD_DEV_ORG_ID }}
MONGODB_ATLAS_BASE_URL: https://cloud-dev.mongodb.com/
MONGODB_ATLAS_SECRET_PROFILE: cfn-cloud-dev-github-action
run: |
cd cfn-resources/test/e2e/cluster
go test -timeout 90m -v -run '^TestClusterCFN$' .
# Run idividual test in separate test group for parallel execution.
# Due to usage of t.Setenv() in test code t.Parallel() is not possible.
# Having both tests run in same `go test` execution is not possible due to scripts used for private registry publishing modifying same files
cluster-pause:
needs: change-detection
if: ${{ needs.change-detection.outputs.cluster == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
with:
python-version: '3.9'
cache: 'pip'
- run: pip install cloudformation-cli-go-plugin
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5
with:
go-version-file: 'cfn-resources/go.mod'
- uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_TEST_ENV }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_TEST_ENV }}
aws-region: eu-west-1
- name: Run E2E test
shell: bash
env:
MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.CLOUD_DEV_PUBLIC_KEY }}
MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.CLOUD_DEV_PRIVATE_KEY }}
MONGODB_ATLAS_ORG_ID: ${{ secrets.CLOUD_DEV_ORG_ID }}
MONGODB_ATLAS_BASE_URL: https://cloud-dev.mongodb.com/
MONGODB_ATLAS_SECRET_PROFILE: cfn-cloud-dev-github-action
run: |
cd cfn-resources/test/e2e/cluster
go test -timeout 90m -v -run '^TestClusterPauseCFN$' .
flex-cluster:
needs: change-detection
if: ${{ needs.change-detection.outputs.flex-cluster == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
with:
python-version: '3.9'
cache: 'pip'
- run: pip install cloudformation-cli-go-plugin
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5
with:
go-version-file: 'cfn-resources/go.mod'
- uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_TEST_ENV }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_TEST_ENV }}
aws-region: eu-west-1
- name: Run E2E test
shell: bash
env:
MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.CLOUD_DEV_PUBLIC_KEY }}
MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.CLOUD_DEV_PRIVATE_KEY }}
MONGODB_ATLAS_ORG_ID: ${{ secrets.CLOUD_DEV_ORG_ID }}
MONGODB_ATLAS_BASE_URL: https://cloud-dev.mongodb.com/
MONGODB_ATLAS_SECRET_PROFILE: cfn-cloud-dev-github-action
run: |
cd cfn-resources/test/e2e/flex-cluster
go test -timeout 60m -v flexcluster_test.go
project:
needs: change-detection
if: ${{ needs.change-detection.outputs.project == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
with:
python-version: '3.9'
cache: 'pip'
- run: pip install cloudformation-cli-go-plugin
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5
with:
go-version-file: 'cfn-resources/go.mod'
- uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_TEST_ENV }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_TEST_ENV }}
aws-region: eu-west-1
- name: Run E2E test
shell: bash
env:
MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.CLOUD_DEV_PUBLIC_KEY }}
MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.CLOUD_DEV_PRIVATE_KEY }}
MONGODB_ATLAS_ORG_ID: ${{ secrets.CLOUD_DEV_ORG_ID }}
MONGODB_ATLAS_BASE_URL: https://cloud-dev.mongodb.com/
MONGODB_ATLAS_SECRET_PROFILE: cfn-cloud-dev-github-action
run: |
cd cfn-resources/test/e2e/project
go test -timeout 60m -v project_test.go
search-deployment:
needs: change-detection
if: ${{ needs.change-detection.outputs.search-deployment == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
with:
python-version: '3.9'
cache: 'pip'
- run: pip install cloudformation-cli-go-plugin
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5
with:
go-version-file: 'cfn-resources/go.mod'
- uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_TEST_ENV }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_TEST_ENV }}
aws-region: eu-west-1
- name: Run E2E test
shell: bash
env:
MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.CLOUD_DEV_PUBLIC_KEY }}
MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.CLOUD_DEV_PRIVATE_KEY }}
MONGODB_ATLAS_ORG_ID: ${{ secrets.CLOUD_DEV_ORG_ID }}
MONGODB_ATLAS_BASE_URL: https://cloud-dev.mongodb.com/
MONGODB_ATLAS_SECRET_PROFILE: cfn-cloud-dev-github-action
run: |
cd cfn-resources/test/e2e/search-deployment
go test -timeout 60m -v searchdeployment_test.go