Skip to content

Commit 4a70eea

Browse files
aporialiaofacebook-github-bot
authored andcommitted
Add option to skip certain unit tests (#2878)
Summary: Add option 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. To use, simply add the name of the tests to skip in this txt file. such as: ``` test_sharding_fused_ebc_as_top_level ``` You can also use the class name for the test: e.g. ``` ModelParallelSparseOnlyTestGloo ``` Differential Revision: D72815908
1 parent 8ec0540 commit 4a70eea

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.github/scripts/tests_to_skip.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
test_dynamic_shape_ebc
2+
test_correctness
3+
test_numerical_stability
4+
test_basic

.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)