Skip to content

Commit a6d36c5

Browse files
aporialiaofacebook-github-bot
authored andcommitted
Add option to skip certain unit tests (#2878)
Summary: Add optionn to skip certain tests - useful when a few tests are broken and we need to skip them to gain visibility in other unit tests. This usually happens on our CPU unit tests, so only modifying this script. Differential Revision: D72815908
1 parent 8ec0540 commit a6d36c5

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.github/scripts/tests_to_skip.txt

Whitespace-only changes.

.github/workflows/unittest_ci_cpu.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ jobs:
7272
python -c "import numpy"
7373
echo "numpy succeeded"
7474
conda install -n build_binary -y pytest
75+
# Read the list of tests to skip from a file, ignoring empty lines and comments
76+
skip_expression=$(awk '!/^($|#)/ {printf " and not %s", $0}' ./.github/scripts/tests_to_skip.txt)
77+
# Check if skip_expression is effectively empty
78+
if [ -z "$skip_expression" ]; then
79+
skip_expression=""
80+
else
81+
skip_expression=${skip_expression:5} # Remove the leading " and "
82+
fi
7583
conda run -n build_binary \
7684
python -m pytest torchrec -v -s -W ignore::pytest.PytestCollectionWarning --continue-on-collection-errors \
77-
--ignore-glob=**/test_utils/
85+
--ignore-glob=**/test_utils/ -k "$skip_expression"

0 commit comments

Comments
 (0)