Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code-coverage OP#40949 #37

Merged
merged 7 commits into from
Feb 4, 2022
Merged

code-coverage OP#40949 #37

merged 7 commits into from
Feb 4, 2022

Conversation

individual-it
Copy link
Collaborator

@individual-it individual-it commented Feb 3, 2022

run coverage analysis after test runs, report it in github comment and fail CI if the coverage is below current percentage

Signed-off-by: Artur Neumann <artur@jankaritech.com>
Signed-off-by: Artur Neumann <artur@jankaritech.com>
Signed-off-by: Artur Neumann <artur@jankaritech.com>
Signed-off-by: Artur Neumann <artur@jankaritech.com>
@nextcloud nextcloud deleted a comment from github-actions bot Feb 3, 2022
@nextcloud nextcloud deleted a comment from github-actions bot Feb 3, 2022
@nextcloud nextcloud deleted a comment from github-actions bot Feb 3, 2022
@nextcloud nextcloud deleted a comment from github-actions bot Feb 3, 2022
@nextcloud nextcloud deleted a comment from github-actions bot Feb 3, 2022
@nextcloud nextcloud deleted a comment from github-actions bot Feb 3, 2022
@nextcloud nextcloud deleted a comment from github-actions bot Feb 3, 2022
@nextcloud nextcloud deleted a comment from github-actions bot Feb 3, 2022
@nextcloud nextcloud deleted a comment from github-actions bot Feb 3, 2022
@nextcloud nextcloud deleted a comment from github-actions bot Feb 3, 2022
Signed-off-by: Artur Neumann <artur@jankaritech.com>
Signed-off-by: Artur Neumann <artur@jankaritech.com>
Signed-off-by: Artur Neumann <artur@jankaritech.com>
@github-actions
Copy link

github-actions bot commented Feb 3, 2022

JS Code Coverage

Coverage after merging coverage into master will be
24.34%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   utils.js8.33%0%0%14.29%3–9, 9
src/components
   AdminSettings.vue0%100%0%0%101, 48–54, 66, 82–84, 88, 95–96, 98
   PersonalSettings.vue24.76%15.15%26.32%30.19%126, 126, 126, 126, 126, 137–140, 146–147, 150–151, 151, 151, 154–155, 155, 155, 158–159, 159, 159, 162–164, 164, 164, 164–165, 167–168, 168, 168–169, 172, 172, 175, 178, 178, 184, 187–188, 190–191, 191–193, 193, 193, 193–194, 199–200, 200, 200, 205, 211, 215–216, 222, 228–229, 231, 234
src/components/settings
   SettingsTitle.vue0%100%0%0%14
src/components/tab
   EmptyContent.vue100%100%100%100%
src/views
   Dashboard.vue0%0%0%0%100, 106, 106, 106–107, 109, 115, 119–120, 128, 131, 135–137, 139, 142–143, 146–147, 147–148, 152–153, 153–154, 156, 158–159, 159, 159, 159, 159–161, 161, 161, 161, 161–163, 166, 171, 171, 171, 173–174, 174, 174–175, 177, 177–179, 183, 187, 190, 190, 190, 193, 193, 193, 198, 201, 201, 201, 208, 211, 211, 211, 216, 216, 216, 221, 221, 221, 226, 229, 232, 235, 235, 235, 238, 238, 238, 24, 241, 244, 247, 25–30, 47, 53, 53, 60, 63–64, 76–77, 77, 77, 80, 83, 83, 83–85, 85, 85–87, 87–88, 90, 93, 93, 93–95, 95, 95–97, 97–98
   ProjectsTab.vue90.32%100%83.33%89.47%66–67

@github-actions
Copy link

github-actions bot commented Feb 3, 2022

PHP Code Coverage

Coverage after merging coverage into master will be
36.03%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
lib/AppInfo
   Application.php0%100%0%0%100, 102, 106, 50, 52–53, 55–57, 60–61, 64–66, 68, 71–72, 75–78, 80–85, 87, 89, 92, 96
lib/BackgroundJob
   CheckNotifications.php0%100%0%0%48, 50, 52–53, 57–58
lib/Controller
   ConfigController.php66.67%100%60%67.07%106–107, 109, 184, 194–197, 199, 201, 71–72, 74, 76–78, 80–87, 92–93, 95
   OpenProjectAPIController.php64.52%100%50%66.67%100, 102–103, 105–106, 108, 82, 98–99
lib/Dashboard
   OpenProjectWidget.php0%100%0%0%44–45, 52, 59, 66, 73, 80, 87–88
lib/Listener
   LoadSidebarScript.php0%100%0%0%37–38, 40–41
lib/Notification
   Notifier.php0%100%0%0%101, 111, 113, 115, 48–51, 61, 70, 81, 83, 86, 88–93
lib/Search
   OpenProjectSearchProvider.php0%100%0%0%101, 108–109, 112–115, 117–118, 122, 126–131, 133–135, 138–139, 141–142, 145–146, 156, 168, 176, 179, 182, 191, 202, 205, 216, 71–75, 82, 89, 96, 98
   OpenProjectSearchResultEntry.php100%100%100%100%
lib/Service
   OpenProjectAPIService.php46.67%100%46.15%46.70%104–114, 116–120, 122–127, 129–130, 133–136, 143, 146–148, 152–156, 166–167, 169–173, 175–176, 184–188, 308–312, 314–315, 319–320, 322–323, 325–329, 353, 368–369, 371, 377, 383–388, 390, 396, 424–427, 430–431, 433, 435–436, 458–459, 466, 469–472, 474, 480, 484–486, 94–97
lib/Settings
   Admin.php0%100%0%0%24–25, 32–34, 36, 41–42, 46, 50
   AdminSection.php0%100%0%0%18–19, 28, 38, 47, 54
   Personal.php0%100%0%0%30–32, 39–45, 48, 50–51, 53, 65–66, 70, 74
   PersonalSection.php0%100%0%0%18–19, 28, 38, 47, 54

@@ -6,9 +6,15 @@
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<report>
<text outputFile="php://stdout" showUncoveredFiles="true"/>
<cobertura outputFile="coverage/php/cobertura.xml"/>
<html outputDirectory="coverage/php/" lowUpperBound="50" highLowerBound="90"/>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for human readable inspection offline

<text outputFile="php://stdout" showUncoveredFiles="true"/>
<cobertura outputFile="coverage/php/cobertura.xml"/>
<html outputDirectory="coverage/php/" lowUpperBound="50" highLowerBound="90"/>
<text outputFile="php://stdout" showUncoveredFiles="false" showOnlySummary="true"/>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

direct text output after running the tests

collectCoverage: true,
collectCoverageFrom: ['./src/**'],
coverageDirectory: '<rootDir>/coverage/jest/',
coverageReporters: ['lcov', 'html', 'text']
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lcov for automatic reports, html for human readable analysis offline, text for instant output after test run

if: ${{ github.event_name == 'pull_request' }}
uses: VeryGoodOpenSource/very_good_coverage@v1.2.0
with:
min_coverage: '24'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

roughly current coverage rate

if: ${{ github.event_name == 'pull_request' }}
uses: VeryGoodOpenSource/very_good_coverage@v1.2.0
with:
min_coverage: '36'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

roughly current coverage rate

@individual-it individual-it marked this pull request as ready for review February 4, 2022 06:42
@individual-it individual-it self-assigned this Feb 4, 2022
@individual-it individual-it merged commit b3bc4ff into master Feb 4, 2022
@delete-merged-branch delete-merged-branch bot deleted the coverage branch February 4, 2022 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants