Skip to content

Commit

Permalink
Test collection step should succeed even if unit tests fail (facebook…
Browse files Browse the repository at this point in the history
…#25621)

Summary:
This is a quick change to avoid having "Collect Test Results" fail on `test_android` when unit tests have not run. If the raw Buck results are not available, avoid running the buck-to-junit conversion tool.

You can find an example of the situation we want to avoid here: https://circleci.com/gh/facebook/react-native/101397?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

## Changelog

[Internal] [Changed] - Do not fail test collection step when unit tests fail
Pull Request resolved: facebook#25621

Test Plan:
Verified on macOS + bash, the conditional will fail if all-results-raw.xml does not exist.

Circle CI:

The `test_android` job as a whole failed (as expected, master is broken), but Collect Test Results remained green even in the absence of a Buck results file.

https://pxl.cl/Fbjl

Reviewed By: fkgozali

Differential Revision: D16230885

Pulled By: hramos

fbshipit-source-id: 73a8290bc4679f2e0dfa88d1e7f71fed279c2104
  • Loading branch information
hramos authored and facebook-github-bot committed Jul 12, 2019
1 parent 0c8c95f commit 970101e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,9 @@ jobs:
find . -type f -regex ".*/build/test-results/debug/.*xml" -exec cp {} ~/reports/build/ \;
find . -type f -regex ".*/outputs/androidTest-results/connected/.*xml" -exec cp {} ~/reports/outputs/ \;
find . -type f -regex ".*/buck-out/gen/ReactAndroid/src/test/.*/.*xml" -exec cp {} ~/reports/buck/ \;
~/okbuck/tooling/junit/buck_to_junit.sh ~/reports/buck/all-results-raw.xml ~/reports/junit/all-results-junit.xml
if [ -f ~/react-native/reports/buck/all-results-raw.xml ]; then
./tooling/junit/buck_to_junit.sh ~/react-native/reports/buck/all-results-raw.xml ~/react-native/reports/junit/all-results-junit.xml
fi
when: always

- store_test_results:
Expand Down

0 comments on commit 970101e

Please sign in to comment.