From 19ab0387244254800a83a0b587b7f4fa20a0a7e7 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 15 Jan 2021 20:27:14 +0100 Subject: [PATCH] collect coverage for /website directory as well --- test/bdd/steps/cgi-with-coverage.php | 3 ++- test/bdd/steps/steps_api_queries.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/bdd/steps/cgi-with-coverage.php b/test/bdd/steps/cgi-with-coverage.php index 47d3cc9a..80f898a3 100644 --- a/test/bdd/steps/cgi-with-coverage.php +++ b/test/bdd/steps/cgi-with-coverage.php @@ -10,7 +10,8 @@ function coverage_shutdown($oCoverage) } $covfilter = new SebastianBergmann\CodeCoverage\Filter(); -$covfilter->addDirectoryToWhitelist($_SERVER['COV_PHP_DIR']); +$covfilter->addDirectoryToWhitelist($_SERVER['COV_PHP_DIR'].'/lib'); +$covfilter->addDirectoryToWhitelist($_SERVER['COV_PHP_DIR'].'/website'); $coverage = new SebastianBergmann\CodeCoverage\CodeCoverage(null, $covfilter); $coverage->start($_SERVER['COV_TEST_NAME']); diff --git a/test/bdd/steps/steps_api_queries.py b/test/bdd/steps/steps_api_queries.py index a56081c0..fd263af7 100644 --- a/test/bdd/steps/steps_api_queries.py +++ b/test/bdd/steps/steps_api_queries.py @@ -105,7 +105,7 @@ def send_api_query(endpoint, params, fmt, context): cmd = ['/usr/bin/env', 'php-cgi', '-f'] if context.nominatim.code_coverage_path: env['COV_SCRIPT_FILENAME'] = env['SCRIPT_FILENAME'] - env['COV_PHP_DIR'] = os.path.join(context.nominatim.src_dir, "lib") + env['COV_PHP_DIR'] = context.nominatim.src_dir env['COV_TEST_NAME'] = '%s:%s' % (context.scenario.filename, context.scenario.line) env['SCRIPT_FILENAME'] = \ os.path.join(os.path.split(__file__)[0], 'cgi-with-coverage.php') -- 2.39.5