Skip to content

Commit 336b85e

Browse files
dulinrileymeta-codesync[bot]
authored andcommitted
Hook up pytest results for publishing on each Github Action (#1648)
Summary: Pull Request resolved: #1648 The pytorch test-infra jobs already support submitting test reports for display on a job. This can improve the user experience when there's a problem with the CI. Right now this is just for python tests, but cargo also supports the JUnit xml format, so we can add that later too. Reviewed By: colin2328 Differential Revision: D85294258 fbshipit-source-id: 0c0fb3b03d25cf00301fb44269b96bd3a6824543
1 parent 6854a90 commit 336b85e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/common-setup.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ setup_test_environment() {
167167
# between runs.
168168
run_test_groups() {
169169
set +e
170+
local test_results_dir="${RUNNER_TEST_RESULTS_DIR:-test-results}"
170171
local enable_actor_error_test="${2:-0}"
171172
# Validate argument enable_actor_error_test
172173
if [[ "$enable_actor_error_test" != "0" && "$enable_actor_error_test" != "1" ]]; then
@@ -186,13 +187,15 @@ run_test_groups() {
186187
--ignore-glob="**/meta/**" \
187188
--dist=no \
188189
--group="$GROUP" \
190+
--junit-xml="$test_results_dir/test-results-$GROUP.xml" \
189191
--splits=10
190192
else
191193
LC_ALL=C pytest python/tests/ -s -v -m "not oss_skip" \
192194
--ignore-glob="**/meta/**" \
193195
--dist=no \
194196
--ignore=python/tests/test_actor_error.py \
195197
--group="$GROUP" \
198+
--junit-xml="$test_results_dir/test-results-$GROUP.xml" \
196199
--splits=10
197200
fi
198201
# Check result and record failures

0 commit comments

Comments
 (0)