Skip to content

Commit 247374b

Browse files
pmeierdatumbox
andauthored
add CI job for prototype tests (#4664)
* add CI job for prototype tests * register prototype job * fix torchvision installation * fix test invocation * ignore prototype tests in normal unittests Co-authored-by: Vasilis Vryniotis <[email protected]>
1 parent ac56b48 commit 247374b

File tree

9 files changed

+54
-10
lines changed

9 files changed

+54
-10
lines changed

.circleci/config.yml

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.circleci/config.yml.in

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,27 @@ jobs:
254254
pip install --user pytest
255255
python test/test_onnx.py
256256

257+
prototype_test:
258+
docker:
259+
- image: circleci/python:3.7
260+
steps:
261+
- run:
262+
name: Install torch
263+
command: pip install --user --progress-bar=off --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
264+
- run:
265+
name: Install prototype dependencies
266+
command: pip install --user --progress-bar=off git+https://github.com/pytorch/data.git
267+
- checkout
268+
- run:
269+
name: Install torchvision
270+
command: pip install --user --progress-bar off --no-build-isolation .
271+
- run:
272+
name: Install test utilities
273+
command: pip install --user --progress-bar=off pytest
274+
- run:
275+
name: Run tests
276+
command: pytest test/test_prototype_*.py
277+
257278
binary_linux_wheel:
258279
<<: *binary_common
259280
docker:
@@ -977,6 +998,7 @@ workflows:
977998
- clang_format
978999
- torchhub_test
9791000
- torch_onnx_test
1001+
- prototype_test
9801002
{{ ios_workflows() }}
9811003
{{ android_workflows() }}
9821004

@@ -998,6 +1020,7 @@ workflows:
9981020
- clang_format
9991021
- torchhub_test
10001022
- torch_onnx_test
1023+
- prototype_test
10011024
{{ ios_workflows(nightly=True) }}
10021025
{{ android_workflows(nightly=True) }}
10031026
{{ build_workflows(prefix="nightly_", filter_branch="nightly", upload=True) }}

.circleci/unittest/linux/scripts/install.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ fi
2626
printf "Installing PyTorch with %s\n" "${cudatoolkit}"
2727
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest
2828

29-
printf "Installing torchdata from source"
30-
pip install git+https://github.com/pytorch/data.git
31-
32-
3329
if [ $PYTHON_VERSION == "3.6" ]; then
3430
printf "Installing minimal PILLOW version\n"
3531
# Install the minimal PILLOW version. Otherwise, let setup.py install the latest

.circleci/unittest/linux/scripts/run_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ conda activate ./env
77

88
export PYTORCH_TEST_WITH_SLOW='1'
99
python -m torch.utils.collect_env
10-
pytest --cov=torchvision --junitxml=test-results/junit.xml -v --durations 20 test --ignore=test/test_datasets_download.py
10+
pytest --cov=torchvision --junitxml=test-results/junit.xml -v --durations 20

.circleci/unittest/windows/scripts/install.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ printf "Installing PyTorch with %s\n" "${cudatoolkit}"
2929
# conda-forge channel is required for cudatoolkit 11.1 on Windows, see https://github.com/pytorch/vision/issues/4458
3030
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c conda-forge "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest
3131

32-
printf "Installing torchdata from source"
33-
pip install git+https://github.com/pytorch/data.git
34-
35-
3632
if [ $PYTHON_VERSION == "3.6" ]; then
3733
printf "Installing minimal PILLOW version\n"
3834
# Install the minimal PILLOW version. Otherwise, let setup.py install the latest

.circleci/unittest/windows/scripts/run_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ source "$this_dir/set_cuda_envs.sh"
1010

1111
export PYTORCH_TEST_WITH_SLOW='1'
1212
python -m torch.utils.collect_env
13-
pytest --cov=torchvision --junitxml=test-results/junit.xml -v --durations 20 test --ignore=test/test_datasets_download.py
13+
pytest --cov=torchvision --junitxml=test-results/junit.xml -v --durations 20

pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@ addopts =
66
--tb=native
77
# enable all warnings
88
-Wd
9+
--ignore=test/test_datasets_download.py
10+
--ignore-glob=test/test_prototype_*.py
911
testpaths =
1012
test

test/test_prototype_datasets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_smoke():
2+
import torchvision.prototype.datasets # noqa: F401

test/test_prototype_models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_smoke():
2+
import torchvision.prototype.models # noqa: F401

0 commit comments

Comments
 (0)