From 26e35fa5d6efadfcd9dd617546938dc29a39df5a Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Wed, 20 Oct 2021 11:16:09 +0200 Subject: [PATCH 1/5] add CI job for prototype tests --- .circleci/config.yml | 21 +++++++++++++++++++ .circleci/config.yml.in | 21 +++++++++++++++++++ .circleci/unittest/linux/scripts/install.sh | 4 ---- .circleci/unittest/windows/scripts/install.sh | 4 ---- test/test_prototype.py | 2 ++ 5 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 test/test_prototype.py diff --git a/.circleci/config.yml b/.circleci/config.yml index aee1d922767..08ee9927e48 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -254,6 +254,27 @@ jobs: pip install --user pytest python test/test_onnx.py + prototype_test: + docker: + - image: circleci/python:3.7 + steps: + - run: + name: Install torch + command: pip install --user --progress-bar=off --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html + - run: + name: Install prototype dependencies + command: pip install --user --progress-bar=off git+https://github.com/pytorch/data.git + - checkout + - run: + name: Install torchvision + command: python setup.py install + - run: + name: Install test utilities + command: pip install --user --progress-bar=off pytest + - run: + name: Run tests + command: pytest/test_prototype.py + binary_linux_wheel: <<: *binary_common docker: diff --git a/.circleci/config.yml.in b/.circleci/config.yml.in index 09957d7b339..4495c6e66aa 100644 --- a/.circleci/config.yml.in +++ b/.circleci/config.yml.in @@ -254,6 +254,27 @@ jobs: pip install --user pytest python test/test_onnx.py + prototype_test: + docker: + - image: circleci/python:3.7 + steps: + - run: + name: Install torch + command: pip install --user --progress-bar=off --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html + - run: + name: Install prototype dependencies + command: pip install --user --progress-bar=off git+https://github.com/pytorch/data.git + - checkout + - run: + name: Install torchvision + command: python setup.py install + - run: + name: Install test utilities + command: pip install --user --progress-bar=off pytest + - run: + name: Run tests + command: pytest/test_prototype.py + binary_linux_wheel: <<: *binary_common docker: diff --git a/.circleci/unittest/linux/scripts/install.sh b/.circleci/unittest/linux/scripts/install.sh index 2bf3684ead1..e9b9e80c077 100755 --- a/.circleci/unittest/linux/scripts/install.sh +++ b/.circleci/unittest/linux/scripts/install.sh @@ -26,10 +26,6 @@ fi printf "Installing PyTorch with %s\n" "${cudatoolkit}" conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest -printf "Installing torchdata from source" -pip install git+https://github.com/pytorch/data.git - - if [ $PYTHON_VERSION == "3.6" ]; then printf "Installing minimal PILLOW version\n" # Install the minimal PILLOW version. Otherwise, let setup.py install the latest diff --git a/.circleci/unittest/windows/scripts/install.sh b/.circleci/unittest/windows/scripts/install.sh index 49ef8224b59..e4756179371 100644 --- a/.circleci/unittest/windows/scripts/install.sh +++ b/.circleci/unittest/windows/scripts/install.sh @@ -29,10 +29,6 @@ printf "Installing PyTorch with %s\n" "${cudatoolkit}" # conda-forge channel is required for cudatoolkit 11.1 on Windows, see https://github.com/pytorch/vision/issues/4458 conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c conda-forge "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest -printf "Installing torchdata from source" -pip install git+https://github.com/pytorch/data.git - - if [ $PYTHON_VERSION == "3.6" ]; then printf "Installing minimal PILLOW version\n" # Install the minimal PILLOW version. Otherwise, let setup.py install the latest diff --git a/test/test_prototype.py b/test/test_prototype.py new file mode 100644 index 00000000000..f00a37d4228 --- /dev/null +++ b/test/test_prototype.py @@ -0,0 +1,2 @@ +def test_smoke(): + import torchvision.prototype # noqa: F401 From 477a8d8a45e0907ecaa953653381d4d32432fba8 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Wed, 20 Oct 2021 11:22:19 +0200 Subject: [PATCH 2/5] register prototype job --- .circleci/config.yml | 2 ++ .circleci/config.yml.in | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 08ee9927e48..a9913029d31 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1500,6 +1500,7 @@ workflows: - clang_format - torchhub_test - torch_onnx_test + - prototype_test - binary_ios_build: build_environment: binary-libtorchvision_ops-ios-12.0.0-x86_64 ios_arch: x86_64 @@ -1660,6 +1661,7 @@ workflows: - clang_format - torchhub_test - torch_onnx_test + - prototype_test - binary_ios_build: build_environment: nightly-binary-libtorchvision_ops-ios-12.0.0-x86_64 filters: diff --git a/.circleci/config.yml.in b/.circleci/config.yml.in index 4495c6e66aa..b471e49b4c1 100644 --- a/.circleci/config.yml.in +++ b/.circleci/config.yml.in @@ -998,6 +998,7 @@ workflows: - clang_format - torchhub_test - torch_onnx_test + - prototype_test {{ ios_workflows() }} {{ android_workflows() }} @@ -1019,6 +1020,7 @@ workflows: - clang_format - torchhub_test - torch_onnx_test + - prototype_test {{ ios_workflows(nightly=True) }} {{ android_workflows(nightly=True) }} {{ build_workflows(prefix="nightly_", filter_branch="nightly", upload=True) }} From 3a900182c05ada07fb09845e5e4826081f1151c9 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Wed, 20 Oct 2021 11:24:01 +0200 Subject: [PATCH 3/5] fix torchvision installation --- .circleci/config.yml | 2 +- .circleci/config.yml.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a9913029d31..0a373e2fb2a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -267,7 +267,7 @@ jobs: - checkout - run: name: Install torchvision - command: python setup.py install + command: pip install --user --progress-bar off --no-build-isolation . - run: name: Install test utilities command: pip install --user --progress-bar=off pytest diff --git a/.circleci/config.yml.in b/.circleci/config.yml.in index b471e49b4c1..ac1c4fec1e9 100644 --- a/.circleci/config.yml.in +++ b/.circleci/config.yml.in @@ -267,7 +267,7 @@ jobs: - checkout - run: name: Install torchvision - command: python setup.py install + command: pip install --user --progress-bar off --no-build-isolation . - run: name: Install test utilities command: pip install --user --progress-bar=off pytest From dd1cee0c49b39ce701b5c4053b8849722ee4890b Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Wed, 20 Oct 2021 11:39:11 +0200 Subject: [PATCH 4/5] fix test invocation --- .circleci/config.yml | 2 +- .circleci/config.yml.in | 2 +- test/test_prototype.py | 2 -- test/test_prototype_datasets.py | 2 ++ test/test_prototype_models.py | 2 ++ 5 files changed, 6 insertions(+), 4 deletions(-) delete mode 100644 test/test_prototype.py create mode 100644 test/test_prototype_datasets.py create mode 100644 test/test_prototype_models.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 0a373e2fb2a..36db2dc5d44 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -273,7 +273,7 @@ jobs: command: pip install --user --progress-bar=off pytest - run: name: Run tests - command: pytest/test_prototype.py + command: pytest test/test_prototype_*.py binary_linux_wheel: <<: *binary_common diff --git a/.circleci/config.yml.in b/.circleci/config.yml.in index ac1c4fec1e9..be2c15e7bb2 100644 --- a/.circleci/config.yml.in +++ b/.circleci/config.yml.in @@ -273,7 +273,7 @@ jobs: command: pip install --user --progress-bar=off pytest - run: name: Run tests - command: pytest/test_prototype.py + command: pytest test/test_prototype_*.py binary_linux_wheel: <<: *binary_common diff --git a/test/test_prototype.py b/test/test_prototype.py deleted file mode 100644 index f00a37d4228..00000000000 --- a/test/test_prototype.py +++ /dev/null @@ -1,2 +0,0 @@ -def test_smoke(): - import torchvision.prototype # noqa: F401 diff --git a/test/test_prototype_datasets.py b/test/test_prototype_datasets.py new file mode 100644 index 00000000000..44616f25356 --- /dev/null +++ b/test/test_prototype_datasets.py @@ -0,0 +1,2 @@ +def test_smoke(): + import torchvision.prototype.datasets # noqa: F401 diff --git a/test/test_prototype_models.py b/test/test_prototype_models.py new file mode 100644 index 00000000000..d89f326a4fc --- /dev/null +++ b/test/test_prototype_models.py @@ -0,0 +1,2 @@ +def test_smoke(): + import torchvision.prototype.models # noqa: F401 From 8d424551b0740f24cb2564112008ea8e3f260be7 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Wed, 20 Oct 2021 12:16:53 +0200 Subject: [PATCH 5/5] ignore prototype tests in normal unittests --- .circleci/unittest/linux/scripts/run_test.sh | 2 +- .circleci/unittest/windows/scripts/run_test.sh | 2 +- pytest.ini | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/unittest/linux/scripts/run_test.sh b/.circleci/unittest/linux/scripts/run_test.sh index 419b9eb562c..3f1195a492c 100755 --- a/.circleci/unittest/linux/scripts/run_test.sh +++ b/.circleci/unittest/linux/scripts/run_test.sh @@ -7,4 +7,4 @@ conda activate ./env export PYTORCH_TEST_WITH_SLOW='1' python -m torch.utils.collect_env -pytest --cov=torchvision --junitxml=test-results/junit.xml -v --durations 20 test --ignore=test/test_datasets_download.py +pytest --cov=torchvision --junitxml=test-results/junit.xml -v --durations 20 diff --git a/.circleci/unittest/windows/scripts/run_test.sh b/.circleci/unittest/windows/scripts/run_test.sh index 58e4b0d7141..c5073200276 100644 --- a/.circleci/unittest/windows/scripts/run_test.sh +++ b/.circleci/unittest/windows/scripts/run_test.sh @@ -10,4 +10,4 @@ source "$this_dir/set_cuda_envs.sh" export PYTORCH_TEST_WITH_SLOW='1' python -m torch.utils.collect_env -pytest --cov=torchvision --junitxml=test-results/junit.xml -v --durations 20 test --ignore=test/test_datasets_download.py +pytest --cov=torchvision --junitxml=test-results/junit.xml -v --durations 20 diff --git a/pytest.ini b/pytest.ini index b8f0709b571..ce7e77bfac5 100644 --- a/pytest.ini +++ b/pytest.ini @@ -6,5 +6,7 @@ addopts = --tb=native # enable all warnings -Wd + --ignore=test/test_datasets_download.py + --ignore-glob=test/test_prototype_*.py testpaths = test