Skip to content

Commit

Permalink
Only print coverage report to console on success.
Browse files Browse the repository at this point in the history
This makes it much easier to see errors when they happen.

Also:
- Make ./scion.sh test and ./scion.sh coverage work with test filenames
  directly. E.g., this now works:
    ./scion.sh coverage test/lib_zookeeper_test.py
- Cleaned up .gitignore a bit, making patterns anchored at the root of
  the repository when applicable (as this was hiding some issues).
  • Loading branch information
kormat committed Aug 26, 2015
1 parent 080b470 commit 9692c47
Showing 3 changed files with 18 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -3,3 +3,8 @@ exclude_lines =
pragma: no cover
def __repr__
def __str__
raise NotImplementedError
[run]
omit = external/*
[html]
title = SCION unit test coverage
21 changes: 10 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -26,11 +26,10 @@ Thumbs.db

# SCION generated files #
#########################
logs/*
topology/ISD*
topology/SIM
topology/conf-gen
traces/*
/logs/
/topology/ISD*/
/topology/SIM/
/traces/


# Python generated files #
@@ -45,19 +44,19 @@ __pycache__

# Crypto library generated files #
#########################
lib/crypto/python-tweetnacl-20140309/build/
/lib/crypto/python-tweetnacl-20140309/build/


# Documentation and Environment files
#########################
sphinx-doc/_build/
venv/
/sphinx-doc/_build/
/venv/

# Docker working directory
##########################
docker/_build/
/docker/_build/

# Test coverage
##########################
.coverage
htmlcov/
/.coverage
/htmlcov/
6 changes: 3 additions & 3 deletions scion.sh
Original file line number Diff line number Diff line change
@@ -42,13 +42,13 @@ cmd_status() {
}

cmd_test(){
PYTHONPATH=. nosetests -w test "$@"
PYTHONPATH=. nosetests "$@"
}

cmd_coverage(){
set -e
PYTHONPATH=. nosetests --with-cov -w test "$@"
coverage html --omit 'external/*'
PYTHONPATH=. nosetests --with-cov --cov-report html "$@"
coverage report
echo "Coverage report here: file://$PWD/htmlcov/index.html"
}

0 comments on commit 9692c47

Please sign in to comment.