From f8d9359d6186f42183f5c7ead527f35cd5b26830 Mon Sep 17 00:00:00 2001 From: Christine Lytwynec Date: Wed, 4 Feb 2015 16:42:51 -0500 Subject: [PATCH] split diff-coverage into separate paver task --- pavelib/tests.py | 17 ++++++++++++++++- scripts/jenkins-report.sh | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/pavelib/tests.py b/pavelib/tests.py index 3e665def77..11e82d9e5c 100644 --- a/pavelib/tests.py +++ b/pavelib/tests.py @@ -3,7 +3,7 @@ Unit test tasks """ import os import sys -from paver.easy import sh, task, cmdopts, needs +from paver.easy import sh, task, cmdopts, needs, call_task from pavelib.utils.test import suites from pavelib.utils.envs import Env from optparse import make_option @@ -204,6 +204,21 @@ def coverage(options): dir=directory )) + + call_task('diff_coverage', options=dict(options)) + + +@task +@needs('pavelib.prereqs.install_prereqs') +@cmdopts([ + ("compare_branch=", "b", "Branch to compare against, defaults to origin/master"), +]) +def diff_coverage(options): + """ + Build the diff coverage reports + """ + compare_branch = getattr(options, 'compare_branch', 'origin/master') + # Find all coverage XML files (both Python and JavaScript) xml_reports = [] diff --git a/scripts/jenkins-report.sh b/scripts/jenkins-report.sh index a0f436b56a..85bc3d1b79 100755 --- a/scripts/jenkins-report.sh +++ b/scripts/jenkins-report.sh @@ -2,7 +2,7 @@ source scripts/jenkins-common.sh # Run coverage again to get the diff coverage report -paver coverage +paver diff_coverage # JUnit test reporter will fail the build # if it thinks test results are old