Skip to content

Commit f7436e6

Browse files
dulinrileyfacebook-github-bot
authored andcommitted
Hook up pytest results for publishing on each Github Action
Summary: 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. Differential Revision: D85294258
1 parent 93168b5 commit f7436e6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/workflows/test-gpu-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
pip install pytest-split
5858
5959
# Run tests with test_actor_error disabled
60-
run_test_groups 0
60+
run_test_groups ${{ env.RUNNER_TEST_RESULTS_DIR }} 0
6161
6262
# TODO(meriksen): temporarily disabled to unblock lands while debugging
6363
# mock CUDA issues on the OSS setup

scripts/common-setup.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,11 @@ setup_test_environment() {
167167
# between runs.
168168
run_test_groups() {
169169
set +e
170-
local enable_actor_error_test="${2:-0}"
170+
local test_results_dir="$2"
171+
local enable_actor_error_test="${3:-0}"
171172
# Validate argument enable_actor_error_test
172173
if [[ "$enable_actor_error_test" != "0" && "$enable_actor_error_test" != "1" ]]; then
173-
echo "Usage: run_test_groups <enable_actor_error_test: 0|1>"
174+
echo "Usage: run_test_groups <test_results_dir> <enable_actor_error_test: 0|1>"
174175
return 2
175176
fi
176177
local FAILED_GROUPS=()
@@ -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)