diff options
-rw-r--r-- | service/.coveragerc | 7 | ||||
-rw-r--r-- | service/.gitignore | 3 | ||||
-rwxr-xr-x | service/go | 42 | ||||
-rw-r--r-- | service/test_requirements.txt | 1 |
4 files changed, 53 insertions, 0 deletions
diff --git a/service/.coveragerc b/service/.coveragerc new file mode 100644 index 00000000..6f970475 --- /dev/null +++ b/service/.coveragerc @@ -0,0 +1,7 @@ +[run] +branch = True +source = pixelated +omit = test/* + +[report] +ingore-errors = True diff --git a/service/.gitignore b/service/.gitignore index 2a85c8d7..f1cd03b6 100644 --- a/service/.gitignore +++ b/service/.gitignore @@ -1,4 +1,7 @@ .virtualenv/ +.venv/ soledad-test/ build/ test/perf/**/results +.coverage +htmlcov/ @@ -1,6 +1,11 @@ #!/bin/bash NUM_OF_CORES='' +TRIAL_PATH='' + +function getTrialAbsolutePath { + TRIAL_PATH="$(which trial)" +} function resolveNumOfCores { if [ "$(uname)" == "Darwin" ]; then @@ -56,6 +61,37 @@ function runJSHint { echo "Done." } +function runCoverageUnit { + echo "Generating Unit Test Converage Information." + coverage erase + getTrialAbsolutePath + coverage run -p --source=pixelated $TRIAL_PATH --reporter=text $* test.unit + coverage combine + coverage html + echo "Done." +} + +function runCoverageIntegration { + echo "Generating Integration Test Converage Information." + coverage erase + getTrialAbsolutePath + coverage run -p --source=pixelated $TRIAL_PATH --reporter=text $* test.integration + coverage combine + coverage html + echo "Done." +} + +function runCoverageUnitAndIntegration { + echo "Generating Unit and Integration Test Converage Information." + coverage erase + getTrialAbsolutePath + coverage run -p --source=pixelated $TRIAL_PATH --reporter=text test.unit + coverage run -p --source=pixelated $TRIAL_PATH --reporter=text test.integration + coverage combine + coverage html + echo "Done." +} + if [ "$1" == 'test' ]; then runJSHint runPep8 @@ -74,6 +110,12 @@ elif [ "$1" == 'setupjs' ]; then elif [ "$1" == 'setup' ]; then setupjs setuppy "${@:2}" +elif [ "$1" == 'coverage_unit' ]; then + runCoverageUnit "${@:2}" +elif [ "$1" == 'coverage_integration' ]; then + runCoverageIntegration "${@:2}" +elif [ "$1" == 'coverage_all' ]; then + runCoverageUnitAndIntegration "${@:2}" elif [ "$1" == 'start' ]; then /usr/bin/env pixelated-user-agent "${@:2}" else diff --git a/service/test_requirements.txt b/service/test_requirements.txt index 98d86650..5179330a 100644 --- a/service/test_requirements.txt +++ b/service/test_requirements.txt @@ -8,4 +8,5 @@ funkload==1.16.1 tornado==4.0.2 pep8==1.5.7 tempdir==0.6 +coverage |