Add -mac_excluded to TF build/test tag filters

Currently, `no_mac` or `nomac` is used to exclude a test from running in the mac environment. However, it is difficult to distinguish between temporary and permanent exclusions. For example, a test may be disabled temporarily if it is broken, or it may be designed to not run on mac environment permanently. To address this issue, we introduce a new tag `mac_excluded` for platform exclusion design. `no_mac` or `nomac` will now be considered to disable broken tests, while `mac_excluded` will be used to permanently exclude a test from running on mac environment.

PiperOrigin-RevId: 515676485
This commit is contained in:
Kanglan Tang 2023-03-10 10:35:59 -08:00 committed by TensorFlower Gardener
parent c127e39cbb
commit 999ed30091
10 changed files with 11 additions and 11 deletions

View File

@ -984,7 +984,7 @@ def system_specific_test_config(environ_cp):
else:
test_and_build_filters.append('-gpu')
elif is_macos():
test_and_build_filters += ['-gpu', '-nomac', '-no_mac']
test_and_build_filters += ['-gpu', '-nomac', '-no_mac', '-mac_excluded']
elif is_linux():
if ((environ_cp.get('TF_NEED_CUDA', None) == '1') or
(environ_cp.get('TF_NEED_ROCM', None) == '1')):

View File

@ -185,8 +185,8 @@ update_test_filter_tags() {
add_test_filter_tag -no_pip -nopip
# MacOS filter tags
if [[ ${OS_TYPE} == "macos" ]]; then
remove_test_filter_tag nomac no_mac
add_test_filter_tag -nomac -no_mac
remove_test_filter_tag nomac no_mac mac_excluded
add_test_filter_tag -nomac -no_mac -mac_excluded
fi
echo "Final test filter tags: ${TF_TEST_FILTER_TAGS}"
}

View File

@ -100,7 +100,7 @@ if [[ ${IS_ROCM} == "1" ]]; then
fi
if [[ ${IS_MAC} == "1" ]]; then
# TODO(b/122370901): Fix nomac, no_mac inconsistency.
PIP_TEST_FILTER_TAG="-nomac,-no_mac,${PIP_TEST_FILTER_TAG}"
PIP_TEST_FILTER_TAG="-nomac,-no_mac,-mac_excluded,${PIP_TEST_FILTER_TAG}"
fi
# Bazel flags we need for all tests:

View File

@ -32,7 +32,7 @@ export PYTHON_BIN_PATH=$(which python2)
yes "" | $PYTHON_BIN_PATH configure.py
which bazel
# TODO(b/122370901): Fix nomac, no_mac inconsistency.
bazel test --test_tag_filters=-no_oss,-gpu,-tpu,-benchmark-test,-nomac,-no_mac \
bazel test --test_tag_filters=-no_oss,-gpu,-tpu,-benchmark-test,-nomac,-no_mac,-mac_excluded \
--test_timeout 300,450,1200,3600 \
--test_size_filters=small,medium --config=opt \
--jobs=${N_JOBS} --build_tests_only --test_output=errors -k -- \

View File

@ -33,7 +33,7 @@ export PYTHON_BIN_PATH=$(which python2)
yes "" | $PYTHON_BIN_PATH configure.py
which bazel
# TODO(b/122370901): Fix nomac, no_mac inconsistency.
bazel test --test_tag_filters=-no_oss,-gpu,-tpu,-benchmark-test,-nomac,-no_mac \
bazel test --test_tag_filters=-no_oss,-gpu,-tpu,-benchmark-test,-nomac,-no_mac,-mac_excluded \
--test_timeout 300,450,1200,3600 --config=opt \
--announce_rc \
--test_size_filters=small,medium \

View File

@ -30,7 +30,7 @@ export TF_NEED_CUDA=0
export PYTHON_BIN_PATH=$(which python3)
yes "" | $PYTHON_BIN_PATH configure.py
which bazel
bazel test --test_tag_filters=-no_oss,-gpu,-tpu,-benchmark-test,-nomac,-no_mac \
bazel test --test_tag_filters=-no_oss,-gpu,-tpu,-benchmark-test,-nomac,-no_mac,-mac_excluded \
--announce_rc \
--test_timeout 300,450,1200,3600 \
--test_size_filters=small,medium \

View File

@ -31,7 +31,7 @@ python -m venv .tf-venv && source .tf-venv/bin/activate
# Set up and install MacOS pip dependencies.
install_macos_pip_deps
tag_filters="-no_oss,-oss_serial,-no_oss_py310,-nomac,-no_mac$(maybe_skip_v1),-gpu,-tpu,-benchmark-test"
tag_filters="-no_oss,-oss_serial,-no_oss_py310,-mac_excluded,-nomac,-no_mac$(maybe_skip_v1),-gpu,-tpu,-benchmark-test"
# Get the default test targets for bazel.
source tensorflow/tools/ci_build/build_scripts/DEFAULT_TEST_TARGETS.sh

View File

@ -31,7 +31,7 @@ python -m venv .tf-venv && source .tf-venv/bin/activate
# Set up and install MacOS pip dependencies.
install_macos_pip_deps
tag_filters="-no_oss,-oss_serial,-nomac,-no_mac$(maybe_skip_v1),-gpu,-tpu,-benchmark-test"
tag_filters="-no_oss,-oss_serial,-mac_excluded,-nomac,-no_mac$(maybe_skip_v1),-gpu,-tpu,-benchmark-test"
# Get the default test targets for bazel.
source tensorflow/tools/ci_build/build_scripts/DEFAULT_TEST_TARGETS.sh

View File

@ -31,7 +31,7 @@ python -m venv .tf-venv && source .tf-venv/bin/activate
# Set up and install MacOS pip dependencies.
install_macos_pip_deps
tag_filters="-no_oss,-oss_serial,-nomac,-no_mac$(maybe_skip_v1),-gpu,-tpu,-benchmark-test"
tag_filters="-no_oss,-oss_serial,-mac_excluded,-nomac,-no_mac$(maybe_skip_v1),-gpu,-tpu,-benchmark-test"
# Get the default test targets for bazel.
source tensorflow/tools/ci_build/build_scripts/DEFAULT_TEST_TARGETS.sh

View File

@ -129,7 +129,7 @@ function bazel_test_wheel {
# Run Bazel Test
PY_MAJ_MINOR_VER=$(python -c "print(__import__('sys').version)" 2>&1 | awk '{ print $1 }' | head -n 1 | awk -F'.' '{printf "%s%s\n", $1, $2 }')
TF_TEST_FLAGS="--define=no_tensorflow_py_deps=true --test_lang_filters=py --test_output=errors --verbose_failures=true --keep_going --test_env=TF2_BEHAVIOR=1"
TF_TEST_FILTER_TAGS="-nopip,-no_pip,-nomac,-no_mac,-no_oss,-oss_serial,-no_oss_py${PY_MAJ_MINOR_VER},-v1only,-gpu,-tpu,-benchmark-test"
TF_TEST_FILTER_TAGS="-nopip,-no_pip,-nomac,-no_mac,-mac_excluded,-no_oss,-oss_serial,-no_oss_py${PY_MAJ_MINOR_VER},-v1only,-gpu,-tpu,-benchmark-test"
BAZEL_PARALLEL_TEST_FLAGS="--local_test_jobs=$(sysctl -n hw.ncpu)"
# Install additional test requirements