Skip to content

add CI job for prototype tests #4664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .circleci/config.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions .circleci/config.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -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: pip install --user --progress-bar off --no-build-isolation .
- run:
name: Install test utilities
command: pip install --user --progress-bar=off pytest
- run:
name: Run tests
command: pytest test/test_prototype_*.py

binary_linux_wheel:
<<: *binary_common
docker:
Expand Down Expand Up @@ -977,6 +998,7 @@ workflows:
- clang_format
- torchhub_test
- torch_onnx_test
- prototype_test
{{ ios_workflows() }}
{{ android_workflows() }}

Expand All @@ -998,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) }}
Expand Down
4 changes: 0 additions & 4 deletions .circleci/unittest/linux/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .circleci/unittest/linux/scripts/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 0 additions & 4 deletions .circleci/unittest/windows/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .circleci/unittest/windows/scripts/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ addopts =
--tb=native
# enable all warnings
-Wd
--ignore=test/test_datasets_download.py
--ignore-glob=test/test_prototype_*.py
Comment on lines +9 to +10
Copy link
Collaborator Author

@pmeier pmeier Oct 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless we invoke pytest specifically with test/test_prototype_*.py, the prototype tests will now be ignored for the normal unittests.

I've applied the same treatment to the dataset download tests. With this, invoking pytest locally is now exactly the same as in CI minus the coverage. LMK if I should split this in a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Personally I'm happy to keep it here.

testpaths =
test
2 changes: 2 additions & 0 deletions test/test_prototype_datasets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_smoke():
import torchvision.prototype.datasets # noqa: F401
2 changes: 2 additions & 0 deletions test/test_prototype_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_smoke():
import torchvision.prototype.models # noqa: F401