Skip to content

Commit

Permalink
bug/9326-9382-rachael-detox-fix-artifacts-issues (#9413)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbontrager authored Aug 21, 2024
1 parent 9675e6f commit a471fce
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/e2e_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ jobs:
disable-animations: true
arch: x86_64
avd-name: Pixel_4_XL_API_28
script: yarn e2e:android-test /e2e/tests/${{matrix.testsuite}} --take-screenshots failing --updateSnapshot --headless
script: yarn e2e:android-test /e2e/tests/${{matrix.testsuite}} --updateSnapshot
continue-on-error: true

- name: Run e2e tests for Android
Expand All @@ -217,9 +217,9 @@ jobs:
disable-animations: true
arch: x86_64
avd-name: Pixel_4_XL_API_28
script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --take-screenshots failing --updateSnapshot --headless
script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot

- name: Run e2e tests for Android
- name: Run e2e tests for Android on failure
if: failure() && steps.run_e2e_tests_nav_AF.outcome == 'failure'
uses: reactivecircus/android-emulator-runner@v2
with:
Expand All @@ -230,7 +230,7 @@ jobs:
disable-animations: true
arch: x86_64
avd-name: Pixel_4_XL_API_28
script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --take-screenshots failing --updateSnapshot --headless
script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot

- name: Upload e2e-junit
if: failure() || success()
Expand All @@ -243,8 +243,9 @@ jobs:
if: failure() || steps.run_e2e_tests.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
name: detox-artifacts-${{ runner.os }}-${{ github.run_id }}
name: detox-artifacts-${{ runner.os }}-${{ github.run_id }}-${{matrix.testsuite}}
path: VAMobile/artifacts
retention-days: 1

- name: Fail workflow if needed(View e2e step for details)
if: steps.run_e2e_tests.outcome == 'failure'
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/e2e_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,20 +190,24 @@ jobs:
id: run_e2e_tests
run: |
if [[ "${{needs.output_detox_tests_to_run.outputs.output2}}" == "" ]]; then
yarn e2e:ios-test /e2e/tests/${{matrix.testsuite}} --take-screenshots failing --updateSnapshot --headless
yarn e2e:ios-test /e2e/tests/${{matrix.testsuite}} --updateSnapshot
echo "NAV_AF_TEST_RUN=" >> "$GITHUB_OUTPUT"
else
echo "NAV_AF_TEST_RUN=true" >> "$GITHUB_OUTPUT"
yarn e2e:ios-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --take-screenshots failing --updateSnapshot --headless
yarn e2e:ios-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot
fi
continue-on-error: true

- name: Rerun e2e tests for iOS if failed
if: steps.run_e2e_tests.outcome == 'failure' && steps.run_e2e_tests.outputs.NAV_AF_TEST_RUN != ''
if: steps.run_e2e_tests.outcome == 'failure'
id: rerun_e2e_tests
run: |
yarn jest:clear;
yarn e2e:ios-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --take-screenshots failing --updateSnapshot --headless
yarn jest:clear;
if [[ "${{ steps.run_e2e_tests.outputs.NAV_AF_TEST_RUN}}" != "" ]]; then
yarn e2e:ios-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot
else
yarn e2e:ios-test /e2e/tests/${{matrix.testsuite}} --updateSnapshot
fi
- name: Upload e2e-junit
if: failure() || success()
Expand All @@ -216,11 +220,12 @@ jobs:
if: failure() || steps.run_e2e_tests.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
name: detox-artifacts-${{ runner.os }}-${{ github.run_id }}
name: detox-artifacts-${{ runner.os }}-${{ github.run_id }}-${{matrix.testsuite}}
path: VAMobile/artifacts
retention-days: 1

- name: Fail workflow if needed(View e2e step for details)
if: steps.run_e2e_tests.outcome == 'failure'
if: steps.run_e2e_tests.outcome == 'failure' && steps.rerun_e2e_tests.outcome == 'failure'
run: exit 1

output-slack-results:
Expand Down
14 changes: 14 additions & 0 deletions VAMobile/.detoxrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,19 @@
"init": {
"exposeGlobals": false
}
},
"artifacts": {
"plugins": {
"screenshot": {
"enabled": true,
"shouldTakeAutomaticSnapshots": true,
"keepOnlyFailedTestsArtifacts": false,
"takeWhen": {
"testStart": false,
"testDone": true,
"appNotReady": true
}
}
}
}
}

0 comments on commit a471fce

Please sign in to comment.