Skip to content
Snippets Groups Projects
Unverified Commit 6b80fc4c authored by Oleksandr's avatar Oleksandr Committed by GitHub
Browse files

Added test coverage measure for habitat-api with codecov (#257)

* Added test coverage measure for habitat-api with codecov

* Added codecov badge

* Removed test that caused failures and wasn't runnning as notebooks were removed from repos
parent 45830c83
Branches
Tags
No related merge requests found
...@@ -90,7 +90,7 @@ jobs: ...@@ -90,7 +90,7 @@ jobs:
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
conda create -y -n habitat python=3.6 conda create -y -n habitat python=3.6
. activate habitat . activate habitat
conda install -q -y -c conda-forge ninja ccache numpy pytest pytest-mock conda install -q -y -c conda-forge ninja ccache numpy pytest pytest-mock pytest-cov
fi fi
- run: - run:
name: Install pytorch name: Install pytorch
...@@ -191,6 +191,7 @@ jobs: ...@@ -191,6 +191,7 @@ jobs:
. activate habitat; cd habitat-api . activate habitat; cd habitat-api
python setup.py develop --all python setup.py develop --all
python setup.py test python setup.py test
bash <(curl -s https://codecov.io/bash) -f coverage.xml
workflows: workflows:
......
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/facebookresearch/habitat-api/blob/master/LICENSE) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/facebookresearch/habitat-api/blob/master/LICENSE)
[![CircleCI](https://circleci.com/gh/facebookresearch/habitat-api.svg?style=shield)](https://circleci.com/gh/facebookresearch/habitat-api) [![CircleCI](https://circleci.com/gh/facebookresearch/habitat-api.svg?style=shield)](https://circleci.com/gh/facebookresearch/habitat-api)
[![codecov](https://codecov.io/gh/facebookresearch/habitat-api/branch/master/graph/badge.svg)](https://codecov.io/gh/facebookresearch/habitat-api)
Habitat-API Habitat-API
============================== ==============================
......
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
test=pytest test=pytest
[tool:pytest] [tool:pytest]
addopts = --verbose -rsxX -q addopts = --verbose -rsxX -q --cov-report=xml --cov=./
testpaths = test testpaths = test
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import gc
import pytest
import habitat
from habitat.datasets.pointnav.pointnav_dataset import PointNavDatasetV1
try:
import torch # noqa # pylint: disable=unused-import
has_torch = True
except ImportError:
has_torch = False
@pytest.mark.skipif(not has_torch, reason="Test needs torch")
def test_demo_notebook():
config = habitat.get_config("configs/tasks/pointnav_rgbd.yaml")
config.defrost()
config.DATASET.SPLIT = "val"
if not PointNavDatasetV1.check_config_paths_exist(config.DATASET):
pytest.skip("Please download the habitat test scenes")
else:
pytest.main(
[
"--nbval-lax",
"notebooks/relative_camera_views_transform_and_warping_demo.ipynb",
]
)
# NB: Force a gc collect run as it can take a little bit for
# the cleanup to happen after the notebook and we get
# a double context crash!
gc.collect()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment