Skip to content

Commit 6c72f4b

Browse files
authored
Use xdist with multi-processing (#1410)
1 parent 258d4fe commit 6c72f4b

16 files changed

+521
-326
lines changed

.github/workflows/build.wheel.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ run_test() {
88
CPYTHON_VERSION=$($entry -c 'import sys; print(str(sys.version_info[0])+str(sys.version_info[1]))')
99
(cd wheelhouse && $entry -m pip install tensorflow_io_plugin_gs-*-cp${CPYTHON_VERSION}-*.whl)
1010
(cd wheelhouse && $entry -m pip install tensorflow_io-*-cp${CPYTHON_VERSION}-*.whl)
11-
$entry -m pip install -q pytest pytest-benchmark boto3 fastavro avro-python3 scikit-image pandas pyarrow==3.0.0 google-cloud-pubsub==2.1.0 google-cloud-bigtable==1.6.0 google-cloud-bigquery-storage==1.1.0 google-cloud-bigquery==2.3.1 google-cloud-storage==1.32.0 PyYAML==5.3.1 azure-storage-blob==12.8.1
12-
(cd tests && $entry -m pytest --benchmark-disable -v --import-mode=append $(find . -type f \( -iname "test_*_v1.py" \)))
13-
(cd tests && $entry -m pytest --benchmark-disable -v --import-mode=append $(find . -type f \( -iname "test_*.py" ! \( -iname "test_*_v1.py" -o -iname "test_bigquery.py" \) \)))
14-
# GRPC and test_bigquery tests have to be executed separately because of https://github.com/grpc/grpc/issues/20034
15-
(cd tests && $entry -m pytest --benchmark-disable -v --import-mode=append $(find . -type f \( -iname "test_bigquery.py" \)))
11+
$entry -m pip install -q pytest pytest-benchmark pytest-xdist boto3 fastavro avro-python3 scikit-image pandas pyarrow==3.0.0 google-cloud-pubsub==2.1.0 google-cloud-bigtable==1.6.0 google-cloud-bigquery-storage==1.1.0 google-cloud-bigquery==2.3.1 google-cloud-storage==1.32.0 PyYAML==5.3.1 azure-storage-blob==12.8.1
12+
(cd tests && $entry -m pytest --benchmark-disable -v --import-mode=append --forked --numprocesses=auto --dist loadfile $(find . -type f \( -iname "test_*.py" \)))
1613
}
1714

1815
PYTHON_VERSION=python
@@ -47,6 +44,7 @@ if [[ $(uname) == "Linux" ]]; then
4744
export CLASSPATH=$(${HADOOP_HOME}/bin/hadoop classpath --glob)
4845
export
4946
elif [[ $(uname) == "Darwin" ]]; then
50-
brew install ffmpeg
47+
echo "TODO: !!!pytest-xdist!!!"
48+
echo brew install ffmpeg
5149
fi
5250
run_test $PYTHON_VERSION

0 commit comments

Comments
 (0)