Skip to content

Commit

Permalink
[ci] configure phpunit to produce and report code coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Vitalii Koshura <[email protected]>
  • Loading branch information
AenBleidd committed Feb 19, 2025
1 parent 3b8dcb5 commit 85c1e7c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
codecov:
require_ci_to_pass: true
notify:
after_n_builds: 3
after_n_builds: 4
wait_for_ci: true

coverage:
Expand All @@ -19,7 +19,7 @@ comment:
require_head: true # [true :: must have a head report to post]
branches:
- master
after_n_builds: 3
after_n_builds: 4

github_checks:
annotations: false
Expand All @@ -41,6 +41,7 @@ flags:
- sched/
- db/
- tools/
- html/
android:
paths:
- android/BOINC/app/src/main/java/edu/berkeley/boinc
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is part of BOINC.
# http://boinc.berkeley.edu
# Copyright (C) 2023 University of California
# https://boinc.berkeley.edu
# Copyright (C) 2025 University of California
#
# BOINC is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License
Expand Down Expand Up @@ -207,13 +207,13 @@ jobs:

- name: Upload Google Tests Results
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
if: always() && matrix.type == 'unit-test' # run this step even if previous step failed
if: always() && matrix.type == 'unit-test'
with:
name: Linux_tests_results
path: "tests/gtest/**/*_xml_report.xml"

- name: Upload coverage report
if: success() && matrix.type == 'unit-test'
if: success() && (matrix.type == 'unit-test' || matrix.type == 'integration-test')
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand Down
23 changes: 22 additions & 1 deletion tests/server-test/tests/phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
bootstrap="vendor/autoload.php"
cacheResultFile=".phpunit.cache/test-results"
convertDeprecationsToExceptions="true"
executionOrder="depends,defects"
failOnRisky="true"
failOnWarning="true"
forceCoversAnnotation="true"
verbose="true">
<testsuites>
<testsuite name="REST API Test Suite">
<directory suffix=".php">./config-tests/</directory>
Expand All @@ -13,4 +25,13 @@
<const name="base" value="boincserver"/>
<const name="num_platforms" value="3"/>
</php>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">html</directory>
<directory suffix=".inc">html</directory>
</include>
<report>
<cobertura outputFile="cobertura.xml"/>
</report>
</coverage>
</phpunit>

0 comments on commit 85c1e7c

Please sign in to comment.