summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2024-01-29 15:04:31 +0100
committerJoas Schilling <coding@schilljs.com>2024-01-29 15:04:31 +0100
commitbc1bbed106b78b102aacee1c3d24e957ab6655fa (patch)
tree399cf8b79e5070201000af586e43917d44e38ab0
parent8a4df12e7fc5d1f79023ef785ead7d687ddfc28d (diff)
feat(tests): Add coverage from integration tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--.github/workflows/integration-pgsql.yml10
-rw-r--r--tests/integration/composer.json1
-rw-r--r--tests/integration/composer.lock161
-rw-r--r--tests/integration/config/behat.yml9
4 files changed, 179 insertions, 2 deletions
diff --git a/.github/workflows/integration-pgsql.yml b/.github/workflows/integration-pgsql.yml
index 104109b72..bf601c114 100644
--- a/.github/workflows/integration-pgsql.yml
+++ b/.github/workflows/integration-pgsql.yml
@@ -118,7 +118,7 @@ jobs:
php-version: ${{ matrix.php-versions }}
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
extensions: apcu, bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, pgsql, pdo_pgsql
- coverage: none
+ coverage: xdebug
ini-file: development
# Temporary workaround for missing pcntl_* in PHP 8.3: ini-values: apc.enable_cli=on
ini-values: apc.enable_cli=on, disable_functions=
@@ -151,6 +151,14 @@ jobs:
working-directory: apps/${{ env.APP_NAME }}/tests/integration
run: bash run.sh features/${{ matrix.test-suite }}
+ - name: Upload Unit test code coverage
+ uses: codecov/codecov-action@v3
+ with:
+ files: apps/${{ env.APP_NAME }}/clover.behat.xml
+ flags: behat-${{ matrix.test-suite }}
+ env:
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
+
- name: Print logs
if: always()
run: |
diff --git a/tests/integration/composer.json b/tests/integration/composer.json
index 6518c4cc2..ae2d68b5e 100644
--- a/tests/integration/composer.json
+++ b/tests/integration/composer.json
@@ -7,6 +7,7 @@
},
"require-dev": {
"behat/behat": "^3.12.0",
+ "dvdoug/behat-code-coverage": "^5.3",
"guzzlehttp/guzzle": "^7.5.0",
"phpunit/phpunit": "^9.5.28"
}
diff --git a/tests/integration/composer.lock b/tests/integration/composer.lock
index ba2f98261..deeb04813 100644
--- a/tests/integration/composer.lock
+++ b/tests/integration/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "349b036731ddabda51155bfbea909b97",
+ "content-hash": "83837d8d86e1aa5c69e33e0ed2d32ae1",
"packages": [],
"packages-dev": [
{
@@ -207,6 +207,87 @@
"time": "2022-03-30T09:27:43+00:00"
},
{
+ "name": "composer/semver",
+ "version": "3.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/semver.git",
+ "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32",
+ "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.2 || ^7.0 || ^8.0"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1.4",
+ "symfony/phpunit-bridge": "^4.2 || ^5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\Semver\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nils Adermann",
+ "email": "naderman@naderman.de",
+ "homepage": "http://www.naderman.de"
+ },
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ },
+ {
+ "name": "Rob Bast",
+ "email": "rob.bast@gmail.com",
+ "homepage": "http://robbast.nl"
+ }
+ ],
+ "description": "Semver library that offers utilities, version constraint parsing and validation.",
+ "keywords": [
+ "semantic",
+ "semver",
+ "validation",
+ "versioning"
+ ],
+ "support": {
+ "irc": "ircs://irc.libera.chat:6697/composer",
+ "issues": "https://github.com/composer/semver/issues",
+ "source": "https://github.com/composer/semver/tree/3.4.0"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2023-08-31T09:50:34+00:00"
+ },
+ {
"name": "doctrine/instantiator",
"version": "1.5.0",
"source": {
@@ -277,6 +358,84 @@
"time": "2022-12-30T00:15:36+00:00"
},
{
+ "name": "dvdoug/behat-code-coverage",
+ "version": "v5.3.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/dvdoug/behat-code-coverage.git",
+ "reference": "dda40785dd75249888b60aa1b10de0491cb48093"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/dvdoug/behat-code-coverage/zipball/dda40785dd75249888b60aa1b10de0491cb48093",
+ "reference": "dda40785dd75249888b60aa1b10de0491cb48093",
+ "shasum": ""
+ },
+ "require": {
+ "behat/behat": "^3.10",
+ "composer-runtime-api": "^2.0",
+ "composer/semver": "^3.0",
+ "php": "^7.4 || ^8.0",
+ "phpunit/php-code-coverage": "^9.2.16||^10.0",
+ "symfony/config": "^5.1.4||^6.0||^7.0",
+ "symfony/console": "^5.3.7||^6.0.9||^7.0",
+ "symfony/dependency-injection": "^5.1.4||^6.0||^7.0",
+ "symfony/event-dispatcher": "^5.0||^6.0||^7.0"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "^3.38.0",
+ "phpunit/phpunit": "^9.5.5||^10.0",
+ "symfony/filesystem": "^5.0||^6.0||^7.0"
+ },
+ "suggest": {
+ "ext-pcov": "PCOV allows you to collect line coverage only, but is faster than Xdebug",
+ "ext-xdebug": "Xdebug allows you to collect line, branch and path coverage"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "DVDoug\\Behat\\CodeCoverage\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-2-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Doug Wright",
+ "role": "Developer"
+ }
+ ],
+ "description": "Generate Code Coverage reports for Behat tests",
+ "homepage": "https://behat.cc",
+ "keywords": [
+ "BDD",
+ "Behat",
+ "clover",
+ "cobertura",
+ "code",
+ "code-coverage",
+ "coverage",
+ "report",
+ "reports",
+ "scenario",
+ "test",
+ "tests"
+ ],
+ "support": {
+ "issues": "https://github.com/dvdoug/behat-code-coverage/issues",
+ "source": "https://github.com/dvdoug/behat-code-coverage/tree/v5.3.2"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/dvdoug",
+ "type": "github"
+ }
+ ],
+ "time": "2023-12-09T14:29:08+00:00"
+ },
+ {
"name": "guzzlehttp/guzzle",
"version": "7.8.1",
"source": {
diff --git a/tests/integration/config/behat.yml b/tests/integration/config/behat.yml
index f7d5ae2bb..33aaef42a 100644
--- a/tests/integration/config/behat.yml
+++ b/tests/integration/config/behat.yml
@@ -5,6 +5,15 @@ default:
pretty:
output_styles:
comment: [ 'bright-blue' ]
+ extensions:
+ DVDoug\Behat\CodeCoverage\Extension:
+ filter:
+ include:
+ directories:
+ 'src': '../../../lib'
+ reports:
+ clover:
+ target: '../../../clover.behat.xml'
autoload:
'': '%paths.base%/../features/bootstrap'
suites: