Skip to content
Snippets Groups Projects
Commit f77a99af authored by Steven Ayers's avatar Steven Ayers
Browse files

Issue #3516242: Code Coverage Metrics

parent 01bc0a34
No related branches found
No related tags found
1 merge request!24Issue #3516242 by bluegeek9: Code Coverage Metrics
Pipeline #486126 passed
......@@ -52,6 +52,38 @@ variables:
OPT_IN_TEST_NEXT_MINOR: 1
OPT_IN_TEST_NEXT_MAJOR: 1
OPT_IN_TEST_MAX_PHP: 1
_PHPUNIT_CONCURRENT: 0
phpunit (coverage):
extends: phpunit
rules:
- if: '$SKIP_PHPUNIT == "1"'
when: never
- when: on_success
before_script:
# Install and enable PCOV.
- echo -e '[pcov]\npcov.directory=.' > /usr/local/etc/php/conf.d/pcov.ini
- docker-php-ext-enable pcov
variables:
REPORT_COVERAGE: "true"
_PHPUNIT_EXTRA:
value: --coverage-cobertura $CI_PROJECT_DIR/coverage.xml --coverage-text --colors=never --coverage-html $CI_PROJECT_DIR/public/coverage
coverage: /^\s*Lines:\s*\d+.\d+\%/
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
paths:
- junit.xml
- apache.access.log.txt
- $BROWSERTEST_OUTPUT_DIRECTORY
- coverage.xml
- public
phpunit:
rules:
- when: never
###################################################################################
......
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="web/core/tests/bootstrap.php"
executionOrder="depends,defects"
beStrictAboutOutputDuringTests="true"
failOnRisky="false"
failOnWarning="false">
<php>
<!-- Example for changing the driver args to webdriver tests MINK_DRIVER_ARGS_WEBDRIVER value: '["chrome", { "goog:chromeOptions": { "w3c": false } }, "http://localhost:4444/wd/hub"]' For using the Firefox browser, replace "chrome" with "firefox" -->
<env name="MINK_DRIVER_ARGS_WEBDRIVER" value='["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox"]}}, "http://chromedriver:9515"]'/>
</php>
<extensions>
<!-- Functional tests HTML output logging. -->
<bootstrap class="Drupal\TestTools\Extension\HtmlLogging\HtmlOutputLogger">
<!-- The directory where the browser output will be stored. If a relative
path is specified, it will be relative to the current working directory
of the process running the PHPUnit CLI. In CI environments, this can be
overridden by the value set for the "BROWSERTEST_OUTPUT_DIRECTORY"
environment variable.
-->
<parameter name="outputDirectory" value="sites/simpletest/browser_output"/>
<!-- By default browser tests print the individual links in the test run
report. To avoid overcrowding the output in CI environments, you can
set the "verbose" parameter or the "BROWSERTEST_OUTPUT_VERBOSE"
environment variable to "false". In GitLabCI, the output is saved
anyway as an artifact that can be browsed or downloaded from Gitlab.
-->
</bootstrap>
</extensions>
<source>
<include>
<directory>web/modules/custom/*</directory>
<directory suffix=".module">web/modules/custom/*</directory>
<directory suffix=".install">web/modules/custom/*</directory>
</include>
<exclude>
<directory>web/modules/custom/*/tests</directory>
<directory suffix=".module">web/modules/custom/*/tests</directory>
<directory>web/modules/custom/*/modules/*/tests</directory>
<directory suffix=".module">web/modules/custom/*/modules/*/tests</directory>
<directory suffix=".api.php">web/modules/custom/*</directory>
</exclude>
</source>
</phpunit>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment