forked from opencord/voltha
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request opencord#4 from pherron/master
Initial check-in of files for unit test framework for ONU device adapter
- Loading branch information
Showing
7 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[run] | ||
omit = venv/*, test/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
htmlcov/ | ||
venv/ | ||
prof/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
THIS_MAKEFILE := $(abspath $(MAKEFILE_LIST) ) | ||
WORKING_DIR := $(dir $(THIS_MAKEFILE) ) | ||
ADAPTERS_DIR := $(dir $(patsubst %/,%,$(WORKING_DIR))) | ||
VOLTHA_DIR := $(dir $(patsubst %/,%,$(ADAPTERS_DIR))) | ||
|
||
VENVDIR=$(WORKING_DIR)venv | ||
TESTDIR=$(WORKING_DIR)test | ||
|
||
PYTHONPATH := $(PYTHONPATH):$(VOLTHA_DIR)protos/third_party; | ||
IN_VENV=. '$(VENVDIR)/bin/activate'; | ||
|
||
PROFILING=--profile-svg | ||
DOT := $(shell command -v dot 2> /dev/null) | ||
ifndef DOT | ||
$(warning "dot is not available please install graphviz") | ||
PROFILING= | ||
endif | ||
|
||
RUN_PYTEST=$(IN_VENV) PYTHONPATH=$(PYTHONPATH) py.test -vvlx $(PROFILING) --cov=$(WORKING_DIR) --cov-report term-missing --cov-report html | ||
|
||
$(VENVDIR): | ||
@virtualenv -p python2 $(VENVDIR) | ||
@virtualenv -p python2 --relocatable $(VENVDIR) | ||
|
||
.PHONY: create-venv | ||
create-venv: $(VENVDIR) | ||
|
||
.PHONY: test | ||
test: create-venv | ||
@$(IN_VENV) command -v py.test > /dev/null 2>&1 || `echo >&2 "'make requirements' first. Aborting."; exit 1;` | ||
@rm -rf $(TESTDIR)/__pycache__ | ||
@cd $(WORKING_DIR) && $(RUN_PYTEST) $(TESTDIR) | ||
|
||
.PHONY: requirements | ||
requirements: create-venv | ||
@$(IN_VENV) pip install --upgrade -r test_requirements.txt |
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from voltha.adapters.adtran_onu import adtran_onu | ||
|
||
def test_example(): | ||
assert True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-r ../../../requirements.txt | ||
pytest >= 3.0, < 4.0 | ||
pytest-cov >= 2.1.0, < 3.0 | ||
pytest-profiling >= 1.1.1, < 2.0 |