@@ -125,6 +125,9 @@ jobs:
125
125
steps :
126
126
- uses : actions/checkout@v3
127
127
128
+ - name : Setup Node
129
+ uses : Expensify/App/.github/actions/composite/setupNode@main
130
+
128
131
- name : Make zip directory for everything to send to AWS Device Farm
129
132
run : mkdir zip
130
133
@@ -137,7 +140,7 @@ jobs:
137
140
138
141
# The downloaded artifact will be a file named "app-e2e-release.apk" so we have to rename it
139
142
- name : Rename baseline APK
140
- run : mv "${{steps.downloadBaselineAPK.outputs.download-path}}/app-e2e-release.apk" "${{steps.downloadBaselineAPK.outputs.download-path}}/app-e2eRelease-baseline .apk"
143
+ run : mv "${{steps.downloadBaselineAPK.outputs.download-path}}/app-e2e-release.apk" "${{steps.downloadBaselineAPK.outputs.download-path}}/app-e2eRelease-main .apk"
141
144
142
145
- name : Download delta APK
143
146
uses : actions/download-artifact@e9ef242655d12993efdcda9058dee2db83a2cb9b
@@ -147,7 +150,7 @@ jobs:
147
150
path : zip
148
151
149
152
- name : Rename delta APK
150
- run : mv "${{steps.downloadDeltaAPK.outputs.download-path}}/app-e2e-release.apk" "${{steps.downloadDeltaAPK.outputs.download-path}}/app-e2eRelease-compare .apk"
153
+ run : mv "${{steps.downloadDeltaAPK.outputs.download-path}}/app-e2e-release.apk" "${{steps.downloadDeltaAPK.outputs.download-path}}/app-e2eRelease-delta .apk"
151
154
152
155
- name : Copy e2e code into zip folder
153
156
run : cp -r tests/e2e zip
@@ -162,44 +165,72 @@ jobs:
162
165
AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
163
166
AWS_REGION : us-west-2
164
167
165
- - name : Schedule AWS Device Farm test run
168
+ - name : Schedule AWS Device Farm test run on main branch
166
169
uses : realm/aws-devicefarm/test-application@7b9a91236c456c97e28d384c9e476035d5ea686b
170
+ id : schedule-awsdf-main
167
171
with :
168
172
name : App E2E Performance Regression Tests
169
173
project_arn : ${{ secrets.AWS_PROJECT_ARN }}
170
174
device_pool_arn : ${{ secrets.AWS_DEVICE_POOL_ARN }}
171
- app_file : zip/app-e2eRelease-baseline .apk
175
+ app_file : zip/app-e2eRelease-main .apk
172
176
app_type : ANDROID_APP
173
177
test_type : APPIUM_NODE
174
178
test_package_file : App.zip
175
179
test_package_type : APPIUM_NODE_TEST_PACKAGE
176
- test_spec_file : tests/e2e/TestSpec .yml
180
+ test_spec_file : tests/e2e/TestSpecMain .yml
177
181
test_spec_type : APPIUM_NODE_TEST_SPEC
178
182
remote_src : false
179
183
file_artifacts : Customer Artifacts.zip
184
+ log_artifacts : debug.log
180
185
cleanup : true
181
186
182
- - name : Unzip AWS Device Farm results
183
- if : ${{ always() }}
184
- run : unzip "Customer Artifacts.zip"
185
-
186
- - name : Print AWS Device Farm run results
187
- if : ${{ always() }}
188
- run : cat "./Host_Machine_Files/\$WORKING_DIRECTORY/output.md"
189
-
190
- - name : Print AWS Device Farm verbose run results
191
- if : ${{ always() && runner.debug != null && fromJSON(runner.debug) }}
192
- run : cat "./Host_Machine_Files/\$WORKING_DIRECTORY/debug.log"
193
-
194
- # TODO: Once tests are more reliable we should uncomment this
195
- # - name: Check if test failed, if so post the results and add the DeployBlocker label
196
- # run: |
197
- # if grep -q '🔴' ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md; then
198
- # gh pr edit ${{ inputs.PR_NUMBER }} --add-label DeployBlockerCash
199
- # gh pr comment ${{ inputs.PR_NUMBER }} -F ./Host_Machine_Files/\$WORKING_DIRECTORY/output.md
200
- # gh pr comment ${{ inputs.PR_NUMBER }} -b "@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker."
201
- # else
202
- # echo '✅ no performance regression detected'
203
- # fi
204
- # env:
205
- # GITHUB_TOKEN: ${{ github.token }}
187
+ - name : Print logs if run failed
188
+ if : failure()
189
+ run : |
190
+ echo ${{ steps.schedule-awsdf-main.outputs.data }}
191
+ unzip "Customer Artifacts.zip" -d mainResults
192
+ cat ./mainResults/Host_Machine_Files/\$WORKING_DIRECTORY/debug.log
193
+
194
+ - name : Unzip AWS Device Farm main results
195
+ run : unzip "Customer Artifacts.zip" -d mainResults
196
+
197
+ - name : Delete Customer Artifacts.zip
198
+ run : rm "Customer Artifacts.zip"
199
+
200
+ - name : Schedule AWS Device Farm test run on delta branch
201
+ uses : realm/aws-devicefarm/test-application@7b9a91236c456c97e28d384c9e476035d5ea686b
202
+ with :
203
+ name : App E2E Performance Regression Tests
204
+ project_arn : ${{ secrets.AWS_PROJECT_ARN }}
205
+ device_pool_arn : ${{ secrets.AWS_DEVICE_POOL_ARN }}
206
+ app_file : zip/app-e2eRelease-delta.apk
207
+ app_type : ANDROID_APP
208
+ test_type : APPIUM_NODE
209
+ test_package_file : App.zip
210
+ test_package_type : APPIUM_NODE_TEST_PACKAGE
211
+ test_spec_file : tests/e2e/TestSpecDelta.yml
212
+ test_spec_type : APPIUM_NODE_TEST_SPEC
213
+ remote_src : false
214
+ file_artifacts : Customer Artifacts.zip
215
+ cleanup : true
216
+
217
+ - name : Unzip AWS Device Farm delta results
218
+ run : unzip "Customer Artifacts.zip" -d deltaResults
219
+
220
+ - name : Compare results
221
+ run : node tests/e2e/merge.js --mainPath ./mainResults/Host_Machine_Files/\$WORKING_DIRECTORY/main.json --deltaPath ./deltaResults//Host_Machine_Files/\$WORKING_DIRECTORY/delta.json --outputPath ./output.md
222
+
223
+ - name : Print results
224
+ run : cat "./output.md"
225
+
226
+ - name : Check if test failed, if so post the results and add the DeployBlocker label
227
+ run : |
228
+ if grep -q '🔴' ./output.md; then
229
+ gh pr edit ${{ inputs.PR_NUMBER }} --add-label DeployBlockerCash
230
+ gh pr comment ${{ inputs.PR_NUMBER }} -F ./output.md
231
+ gh pr comment ${{ inputs.PR_NUMBER }} -b "@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker."
232
+ else
233
+ echo '✅ no performance regression detected'
234
+ fi
235
+ env :
236
+ GITHUB_TOKEN : ${{ github.token }}
0 commit comments