Skip to content
Permalink
Browse files

Make regular unit test job record coverage data

Instead of the dedicated coverage recording unit test job we now
do it while executing the regular global unit test job.

Change-Id: I0a190a6edae8392a795b927da4ef79eb904d5bef
  • Loading branch information
LarsMichelsen committed Mar 10, 2020
1 parent 52e774b commit f614045f39ee1f8343a46656a429d9f4447ad3f2
Showing with 22 additions and 6 deletions.
  1. +1 −0 .gitignore
  2. +14 −1 buildscripts/scripts/test-python3-unit.jenkins
  3. +7 −5 tests-py3/Makefile
@@ -11,6 +11,7 @@
.bugs/.my_ids
.cache
.coverage
.coverage.*
.directory
.metadata
.mypy_cache
@@ -37,10 +37,23 @@ node (NODE) {
TEST_IMAGE.inside("--ulimit nofile=1024:1024 --init") {
stage('test python3 unit') {
dir ('tests-py3') {
sh "bash -c \"make test-unit\""
sh "bash -c \"make test-unit-coverage-html\""
}
}

stage('publish coverage') {
publishHTML([
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: '$WORKSPACE/tests-py3/htmlcov',
reportFiles: 'index.html',
reportName: 'Unit Test Coverage',
reportTitles: ''
])
}
}
}
}


@@ -4,7 +4,6 @@

SHELL := /bin/bash -e
PIPENV3 := ../scripts/run-pipenv 3
COVERAGE := $(PIPENV3) run coverage
PYTEST := $(PIPENV3) run py.test -vv
YAPF := $(PIPENV3) run yapf
MYPY := ../scripts/run-mypy
@@ -16,6 +15,7 @@ MYPY := ../scripts/run-mypy
test-integration-docker-debug \
test-composition-docker test-composition \
test-format-python test-format-python3 \
test-unit-coverage-html

help:
@echo "test-mypy - Run mypy tests"
@@ -50,11 +50,13 @@ test-pylint:
test-unit:
$(PYTEST) -T unit unit

# TODO: We should perhaps use the pytest --cov/--cov-report options, which the
# pytest-cov plugin package adds to pyttest.
test-unit-coverage-html:
$(COVERAGE) run --rcfile=.coveragerc_unit -m pytest -T unit unit
$(COVERAGE) html --rcfile=.coveragerc_unit
$(PYTEST) \
--cov=cmk \
--cov-report=html \
--cov-config=.coveragerc_unit \
--no-cov-on-fail \
-T unit unit


MYPY3_FILES=$(shell \

0 comments on commit f614045

Please sign in to comment.
You can’t perform that action at this time.