mirror of
https://github.com/irongut/CodeCoverageSummary.git
synced 2026-05-14 22:20:13 +02:00
Compare commits
161 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d8e7ce01d5 | |||
| f138489648 | |||
| 9986579715 | |||
| 2b7bf99d3d | |||
| 6381a94beb | |||
| 064d8225cf | |||
| dc0965bfd6 | |||
| c76d28851c | |||
| 249f92f672 | |||
| f157e9605b | |||
| e4fa71f987 | |||
| 6c9b394cdc | |||
| 79572a8bdc | |||
| 7086c364c7 | |||
| 159f0d3f03 | |||
| b371d8d706 | |||
| e58ef3d225 | |||
| 8be1ea7dcd | |||
| df694edd1f | |||
| 389bb15050 | |||
| f9552f243d | |||
| 22531c6a84 | |||
| 32b97a380b | |||
| 58d593b91d | |||
| b7e4620db9 | |||
| 835f52dd6d | |||
| 57a8504803 | |||
| de3bf184e8 | |||
| 0adb7a5e81 | |||
| 193c3d52d4 | |||
| 4472978224 | |||
| ad8e33903c | |||
| b4e48dcc98 | |||
| 2cba9cd8f8 | |||
| 31b2f90c53 | |||
| 3a1aab172a | |||
| 80e8804405 | |||
| be73105298 | |||
| 9dd4a48e5d | |||
| a989a1acc2 | |||
| b5c414e325 | |||
| 3d044cdcd5 | |||
| 3a7e9990c1 | |||
| 7142272b0a | |||
| 23dcb1b683 | |||
| d5f059c9e5 | |||
| 84eac7e593 | |||
| 74295b4928 | |||
| 3216094ffb | |||
| 59bf0ee52a | |||
| 9702896171 | |||
| 7c7e56f29d | |||
| a75666af65 | |||
| 76f7177ccc | |||
| ba2d454f72 | |||
| 1fa57f12ee | |||
| a325aae56f | |||
| a7dfd386d4 | |||
| fbd7727617 | |||
| f181f0fb43 | |||
| 5c41ceee77 | |||
| 65997c5b86 | |||
| e8b30e8bdc | |||
| c0fec16186 | |||
| 52d447d8ec | |||
| e4b6675d33 | |||
| 155e9dc09c | |||
| 12259bb15f | |||
| cde20e0aef | |||
| 51cc3a756d | |||
| df43d7d643 | |||
| 8accb9dd63 | |||
| 21fb9f6797 | |||
| 05b101a9e5 | |||
| 405344bb11 | |||
| 6575f73c8b | |||
| 9d67d209d5 | |||
| f055ebd021 | |||
| 5783d61eba | |||
| 7ede3df512 | |||
| 4149d3cd42 | |||
| e585016ed7 | |||
| 875e6d6260 | |||
| 8e03759e2f | |||
| 7cdc061845 | |||
| 4a8d89664f | |||
| 92459b634d | |||
| 7f81eacb3c | |||
| c34bdfe66a | |||
| 85a9fe6bb1 | |||
| 5b38ba1306 | |||
| 7b1923cbc6 | |||
| 1699cd4b65 | |||
| 4c876916c9 | |||
| 1c5e7f1a60 | |||
| 9196cf3448 | |||
| baf620bf17 | |||
| bc2adc7690 | |||
| ce279ec14b | |||
| 009a5455b8 | |||
| 0d078db7cc | |||
| 65684d3463 | |||
| a6a88c76f7 | |||
| 5088d5eb31 | |||
| ee53bdd6c5 | |||
| 6a542ff4b0 | |||
| 46bc9869d5 | |||
| 97f4a52b81 | |||
| 95ea154a7b | |||
| 2e00d30f70 | |||
| c4d4b9a087 | |||
| ea5d3b417b | |||
| 3d33fafb37 | |||
| 3a41f0a5ea | |||
| dd5c8d3b75 | |||
| 4986e930de | |||
| 37dca42320 | |||
| 5ec10c1882 | |||
| 56c9f3d623 | |||
| f36c88a82b | |||
| ffe316d009 | |||
| 1ea9b55e4d | |||
| fcb924f622 | |||
| ed588922f2 | |||
| 6e12bd152f | |||
| 4ae964bab0 | |||
| 60646036b5 | |||
| 1c2edd9230 | |||
| 9caa66feee | |||
| 6c68cb69dd | |||
| 914b6fe5f9 | |||
| 46007a7270 | |||
| 71ae720dab | |||
| dd7d40d268 | |||
| 065eaf7bb5 | |||
| a5c4e90cbe | |||
| f89139ddac | |||
| ac37b8e9b7 | |||
| 7a76884d03 | |||
| 2389c9883a | |||
| 02bb824606 | |||
| b97bc1147a | |||
| d8b1bc5ef2 | |||
| 7c070aea38 | |||
| 6ed1f6c50d | |||
| ecc89a90a8 | |||
| 4a0dc323d3 | |||
| 711b5c996a | |||
| 9bbe00ce6b | |||
| f9c0e2020c | |||
| 1b1147a0ce | |||
| 3766e5780e | |||
| 473d18e3ad | |||
| 61d10948c8 | |||
| 7cd8fe49e9 | |||
| 174c97ac3d | |||
| 9b11daeca8 | |||
| 6db46e287e | |||
| c5d12d4a89 | |||
| cae1cbcdad | |||
| ed258b1479 |
@@ -0,0 +1,3 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: [irongut]
|
||||||
@@ -1,7 +1,13 @@
|
|||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: nuget
|
- package-ecosystem: nuget
|
||||||
directory: "/"
|
directory: "/src"
|
||||||
schedule:
|
schedule:
|
||||||
interval: daily
|
interval: daily
|
||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
|
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# Configuration for PR Labeller Action
|
||||||
|
# See: https://github.com/actions/labeler/blob/master/README.md
|
||||||
|
|
||||||
|
# Examples
|
||||||
|
# Add 'label1' to PR if anything changes within 'example' folder or any subfolders
|
||||||
|
# label1:
|
||||||
|
# - example/**/*
|
||||||
|
|
||||||
|
# Add 'label2' to PR if any file changes within 'example2' folder
|
||||||
|
# label2: example2/*
|
||||||
|
|
||||||
|
Action:
|
||||||
|
- action.yml
|
||||||
|
|
||||||
|
Docker:
|
||||||
|
- Dockerfile
|
||||||
|
- .dockerignore
|
||||||
|
|
||||||
|
Options:
|
||||||
|
- src/CodeCoverageSummary/CommandLineOptions.cs
|
||||||
|
|
||||||
|
Parsing:
|
||||||
|
- src/CodeCoverageSummary/CodeSummary.cs
|
||||||
|
- src/CodeCoverageSummary/Program.cs
|
||||||
|
|
||||||
|
Summary:
|
||||||
|
- src/CodeCoverageSummary/CodeSummary.cs
|
||||||
|
- src/CodeCoverageSummary/Program.cs
|
||||||
|
|
||||||
|
DevOps:
|
||||||
|
- .github/**/*
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
name: Assign to Project
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types: [opened, labeled]
|
||||||
|
pull_request:
|
||||||
|
types: [opened, labeled]
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
assign-to-project:
|
||||||
|
permissions:
|
||||||
|
repository-projects: write # for srggrs/assign-one-project-github-action to assign issues and PRs to repo project
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Assign to Project
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@2e205a28d0e1da00c5f53b161f4067b052c61f34
|
||||||
|
with:
|
||||||
|
egress-policy: block
|
||||||
|
allowed-endpoints: >
|
||||||
|
api.github.com:443
|
||||||
|
|
||||||
|
- name: Assign Issues to Bugs
|
||||||
|
uses: srggrs/assign-one-project-github-action@65a8ddab497df42ef268001e67bbf976f8fd39e1
|
||||||
|
if: contains(github.event.issue.labels.*.name, 'bug')
|
||||||
|
with:
|
||||||
|
project: 'https://github.com/irongut/CodeCoverageSummary/projects/1'
|
||||||
|
column_name: 'Needs triage'
|
||||||
|
|
||||||
|
- name: Assign Issues to Enhancements
|
||||||
|
uses: srggrs/assign-one-project-github-action@65a8ddab497df42ef268001e67bbf976f8fd39e1
|
||||||
|
if: contains(github.event.issue.labels.*.name, 'enhancement')
|
||||||
|
with:
|
||||||
|
project: 'https://github.com/irongut/CodeCoverageSummary/projects/2'
|
||||||
|
column_name: 'To do'
|
||||||
|
|
||||||
|
- name: Assign PRs to Bugs
|
||||||
|
uses: srggrs/assign-one-project-github-action@65a8ddab497df42ef268001e67bbf976f8fd39e1
|
||||||
|
if: contains(github.event.pull_request.labels.*.name, 'bug')
|
||||||
|
with:
|
||||||
|
project: 'https://github.com/irongut/CodeCoverageSummary/projects/1'
|
||||||
|
column_name: 'In Progress'
|
||||||
|
|
||||||
|
- name: Assign PRs to Enhancements
|
||||||
|
uses: srggrs/assign-one-project-github-action@65a8ddab497df42ef268001e67bbf976f8fd39e1
|
||||||
|
if: contains(github.event.pull_request.labels.*.name, 'enhancement')
|
||||||
|
with:
|
||||||
|
project: 'https://github.com/irongut/CodeCoverageSummary/projects/2'
|
||||||
|
column_name: 'In Progress'
|
||||||
@@ -1,18 +1,25 @@
|
|||||||
# Assign PR to Author
|
# Assign PR to Author
|
||||||
# https://github.com/samspills/assign-pr-to-author
|
# https://github.com/samspills/assign-pr-to-author
|
||||||
|
|
||||||
# Disabled due to #14 HttpError: Resource not accessible by integration:
|
name: Auto Assign PR
|
||||||
# https://github.com/samspills/assign-pr-to-author/issues/14
|
|
||||||
|
|
||||||
#name: Auto Assign PR
|
on:
|
||||||
#on: [pull_request]
|
pull_request:
|
||||||
|
types: [opened]
|
||||||
|
|
||||||
#jobs:
|
jobs:
|
||||||
# assignAuthor:
|
assignAuthor:
|
||||||
# runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# steps:
|
steps:
|
||||||
# - name: Auto Assign PR
|
|
||||||
# uses: samspills/assign-pr-to-author@v1.0
|
- name: Harden Runner
|
||||||
# if: github.event_name == 'pull_request' && github.event.action == 'opened'
|
uses: step-security/harden-runner@2e205a28d0e1da00c5f53b161f4067b052c61f34
|
||||||
# with:
|
with:
|
||||||
# repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
egress-policy: block
|
||||||
|
allowed-endpoints: >
|
||||||
|
api.github.com:443
|
||||||
|
|
||||||
|
- name: Auto Assign PR
|
||||||
|
uses: samspills/assign-pr-to-author@b313feb250ff414d3aff26525b986f080ee7bd7a
|
||||||
|
with:
|
||||||
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
|
|||||||
@@ -6,18 +6,38 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
env:
|
||||||
|
DOTNET_NOLOGO: true # Disable the .NET logo in the console output
|
||||||
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience to skip caching NuGet packages and speed up the build
|
||||||
|
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry to Microsoft
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: CI Build
|
name: CI Build
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@2e205a28d0e1da00c5f53b161f4067b052c61f34
|
||||||
|
with:
|
||||||
|
egress-policy: block
|
||||||
|
allowed-endpoints: >
|
||||||
|
api.nuget.org:443
|
||||||
|
dotnetbuilds.azureedge.net:443
|
||||||
|
dotnetcli.azureedge.net:443
|
||||||
|
dotnetcli.blob.core.windows.net:443
|
||||||
|
github.com:443
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
|
|
||||||
- name: Setup .Net
|
- name: Setup .Net
|
||||||
uses: actions/setup-dotnet@v1
|
uses: actions/setup-dotnet@4d4a70f4a5b2a5a5329f13be4ac933f2c9206ac0
|
||||||
with:
|
with:
|
||||||
dotnet-version: 5.0.x
|
dotnet-version: 6.0.x
|
||||||
|
|
||||||
- name: Restore Dependencies
|
- name: Restore Dependencies
|
||||||
run: dotnet restore src/CodeCoverageSummary.sln
|
run: dotnet restore src/CodeCoverageSummary.sln
|
||||||
@@ -25,5 +45,5 @@ jobs:
|
|||||||
- name: Build CodeCoverageSummary
|
- name: Build CodeCoverageSummary
|
||||||
run: dotnet build src/CodeCoverageSummary.sln --configuration Release --no-restore
|
run: dotnet build src/CodeCoverageSummary.sln --configuration Release --no-restore
|
||||||
|
|
||||||
- name: Test with sample file
|
- name: Test with sample files
|
||||||
run: dotnet src/CodeCoverageSummary/bin/Release/net5.0/CodeCoverageSummary.dll src/coverage.cobertura.xml --badge true
|
run: dotnet src/CodeCoverageSummary/bin/Release/net6.0/CodeCoverageSummary.dll --files **/coverage.*.xml --badge true
|
||||||
|
|||||||
@@ -0,0 +1,73 @@
|
|||||||
|
name: CodeQL Scan
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "master" ]
|
||||||
|
paths-ignore:
|
||||||
|
- '**/*.md'
|
||||||
|
- '**/*.gitignore'
|
||||||
|
- '**/*.gitattributes'
|
||||||
|
pull_request:
|
||||||
|
branches: [ "master" ]
|
||||||
|
schedule:
|
||||||
|
- cron: '15 5 * * 5'
|
||||||
|
|
||||||
|
permissions: # added using https://github.com/step-security/secure-workflows
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
env:
|
||||||
|
DOTNET_NOLOGO: true # Disable the .NET logo in the console output
|
||||||
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience to skip caching NuGet packages and speed up the build
|
||||||
|
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry to Microsoft
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
language: [ 'csharp' ]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@2e205a28d0e1da00c5f53b161f4067b052c61f34
|
||||||
|
with:
|
||||||
|
egress-policy: block
|
||||||
|
allowed-endpoints: >
|
||||||
|
api.github.com:443
|
||||||
|
api.nuget.org:443
|
||||||
|
dotnetbuilds.azureedge.net:443
|
||||||
|
dotnetcli.azureedge.net:443
|
||||||
|
dotnetcli.blob.core.windows.net:443
|
||||||
|
github.com:443
|
||||||
|
uploads.github.com:443
|
||||||
|
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
|
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@cc7986c02bac29104a72998e67239bb5ee2ee110
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
# queries: security-extended,security-and-quality # https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||||
|
|
||||||
|
- name: Setup .Net
|
||||||
|
uses: actions/setup-dotnet@4d4a70f4a5b2a5a5329f13be4ac933f2c9206ac0
|
||||||
|
with:
|
||||||
|
dotnet-version: 6.0.x
|
||||||
|
|
||||||
|
- name: Restore Dependencies
|
||||||
|
run: dotnet restore src/CodeCoverageSummary.sln
|
||||||
|
|
||||||
|
- name: Build CodeCoverageSummary
|
||||||
|
run: dotnet build src/CodeCoverageSummary.sln --configuration Release --no-restore /p:UseSharedCompilation=false
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@cc7986c02bac29104a72998e67239bb5ee2ee110
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
# hadolint is a Dockerfile linter written in Haskell
|
||||||
|
# More details at https://github.com/hadolint/hadolint
|
||||||
|
|
||||||
|
name: Docker Linter
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "master" ]
|
||||||
|
paths-ignore:
|
||||||
|
- '**/*.md'
|
||||||
|
- '**/*.gitignore'
|
||||||
|
- '**/*.gitattributes'
|
||||||
|
pull_request:
|
||||||
|
branches: [ "master" ]
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '35 11 * * 0'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
hadolint:
|
||||||
|
name: Run hadolint scan
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read # for actions/checkout
|
||||||
|
security-events: write # for github/codeql-action/upload-sarif
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@2e205a28d0e1da00c5f53b161f4067b052c61f34
|
||||||
|
with:
|
||||||
|
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
|
|
||||||
|
- name: Run hadolint
|
||||||
|
uses: hadolint/hadolint-action@f988afea3da57ee48710a9795b6bb677cc901183
|
||||||
|
with:
|
||||||
|
dockerfile: ./Dockerfile
|
||||||
|
format: sarif
|
||||||
|
output-file: hadolint-results.sarif
|
||||||
|
no-fail: true
|
||||||
|
|
||||||
|
- name: Upload Results
|
||||||
|
uses: github/codeql-action/upload-sarif@cc7986c02bac29104a72998e67239bb5ee2ee110
|
||||||
|
with:
|
||||||
|
sarif_file: hadolint-results.sarif
|
||||||
|
wait-for-processing: true
|
||||||
@@ -4,14 +4,27 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
- cron: "30 1 * * *"
|
- cron: "30 1 * * *"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stale:
|
stale:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
issues: write # for actions/stale to close stale issues
|
||||||
|
pull-requests: write # for actions/stale to close stale PRs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@2e205a28d0e1da00c5f53b161f4067b052c61f34
|
||||||
|
with:
|
||||||
|
egress-policy: block
|
||||||
|
allowed-endpoints: >
|
||||||
|
api.github.com:443
|
||||||
|
|
||||||
- name: Mark Stale
|
- name: Mark Stale
|
||||||
uses: actions/stale@v3
|
uses: actions/stale@9c1b1c6e115ca2af09755448e0dbba24e5061cc8
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
exempt-all-milestones: true
|
exempt-all-milestones: true
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
# Applies labels to pull requests based on paths & files modified in the pull request.
|
||||||
|
#
|
||||||
|
# .github/labeler.yml contains the list of labels & files / folders to match, see:
|
||||||
|
# https://github.com/actions/labeler/blob/master/README.md
|
||||||
|
|
||||||
|
name: PR Labeler
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
label:
|
||||||
|
permissions:
|
||||||
|
contents: read # for actions/labeler to determine modified files
|
||||||
|
pull-requests: write # for actions/labeler to add labels to PRs
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@2e205a28d0e1da00c5f53b161f4067b052c61f34
|
||||||
|
with:
|
||||||
|
egress-policy: block
|
||||||
|
allowed-endpoints: >
|
||||||
|
api.github.com:443
|
||||||
|
|
||||||
|
- uses: actions/labeler@5c7539237e04b714afd8ad9b4aed733815b9fab4
|
||||||
|
with:
|
||||||
|
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
@@ -4,7 +4,13 @@ on:
|
|||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
DOTNET_NOLOGO: true # Disable the .NET logo in the console output
|
||||||
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience to skip caching NuGet packages and speed up the build
|
||||||
|
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry to Microsoft
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
@@ -13,15 +19,27 @@ jobs:
|
|||||||
name: Test Build
|
name: Test Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@2e205a28d0e1da00c5f53b161f4067b052c61f34
|
||||||
|
with:
|
||||||
|
egress-policy: block
|
||||||
|
allowed-endpoints: >
|
||||||
|
api.nuget.org:443
|
||||||
|
dotnetbuilds.azureedge.net:443
|
||||||
|
dotnetcli.azureedge.net:443
|
||||||
|
dotnetcli.blob.core.windows.net:443
|
||||||
|
github.com:443
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup .Net
|
- name: Setup .Net
|
||||||
uses: actions/setup-dotnet@v1
|
uses: actions/setup-dotnet@4d4a70f4a5b2a5a5329f13be4ac933f2c9206ac0
|
||||||
with:
|
with:
|
||||||
dotnet-version: 5.0.x
|
dotnet-version: 6.0.x
|
||||||
|
|
||||||
- name: Restore Dependencies
|
- name: Restore Dependencies
|
||||||
run: dotnet restore src/CodeCoverageSummary.sln
|
run: dotnet restore src/CodeCoverageSummary.sln
|
||||||
@@ -30,29 +48,7 @@ jobs:
|
|||||||
run: dotnet build src/CodeCoverageSummary.sln --configuration Release --no-restore
|
run: dotnet build src/CodeCoverageSummary.sln --configuration Release --no-restore
|
||||||
|
|
||||||
- name: Test with sample file
|
- name: Test with sample file
|
||||||
run: dotnet src/CodeCoverageSummary/bin/Release/net5.0/CodeCoverageSummary.dll src/coverage.cobertura.xml --badge true
|
run: dotnet src/CodeCoverageSummary/bin/Release/net6.0/CodeCoverageSummary.dll --files **/coverage.*.xml --badge true
|
||||||
|
|
||||||
- name: Get Previous Tag
|
|
||||||
id: get_previous_tag
|
|
||||||
run: |
|
|
||||||
PREV_TAG=$(git describe --abbrev=0 --tags "${{ github.ref }}^")
|
|
||||||
echo "::set-output name=baseRef::${PREV_TAG}"
|
|
||||||
|
|
||||||
- name: Generate Changelog
|
|
||||||
id: generate_changelog
|
|
||||||
uses: nblagoev/pull-release-notes-action@v1.0.2
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
base-ref: ${{ steps.get_previous_tag.outputs.baseRef }}
|
|
||||||
head-ref: ${{ github.ref }}
|
|
||||||
|
|
||||||
- name: Add Changelog to Release
|
|
||||||
uses: irongut/EditRelease@v1.0.0
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
id: ${{ github.event.release.id }}
|
|
||||||
body: ${{ steps.generate_changelog.outputs.result }}
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
name: Deploy to GHCR
|
name: Deploy to GHCR
|
||||||
@@ -61,12 +57,40 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
id-token: write # Used for identity challenge with sigstore/fulcio
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
- name: Harden Runner
|
||||||
|
uses: step-security/harden-runner@2e205a28d0e1da00c5f53b161f4067b052c61f34
|
||||||
|
with:
|
||||||
|
egress-policy: block
|
||||||
|
allowed-endpoints: >
|
||||||
|
api.github.com:443
|
||||||
|
api.nuget.org:443
|
||||||
|
auth.docker.io:443
|
||||||
|
fulcio.sigstore.dev:443
|
||||||
|
ghcr.io:443
|
||||||
|
github.com:443
|
||||||
|
mcr.microsoft.com:443
|
||||||
|
pipelines.actions.githubusercontent.com:443
|
||||||
|
pkg-containers.githubusercontent.com:443
|
||||||
|
registry-1.docker.io:443
|
||||||
|
storage.googleapis.com:443
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
|
|
||||||
|
- name: Install Cosign
|
||||||
|
uses: sigstore/cosign-installer@9becc617647dfa20ae7b1151972e9b3a2c338a2b
|
||||||
|
with:
|
||||||
|
cosign-release: 'v1.9.0'
|
||||||
|
|
||||||
|
- name: Setup Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
@@ -74,14 +98,23 @@ jobs:
|
|||||||
|
|
||||||
- name: Extract Docker metadata
|
- name: Extract Docker metadata
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v3
|
uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
|
||||||
- name: Build + Push Docker image
|
- name: Build + Push Docker image
|
||||||
uses: docker/build-push-action@v2
|
id: build-and-push
|
||||||
|
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
|
# Sign the Docker image digest
|
||||||
|
# Uses the identity token to provision an ephemeral certificate against the community Fulcio instance
|
||||||
|
# https://github.com/sigstore/cosign
|
||||||
|
- name: Sign the Docker image
|
||||||
|
env:
|
||||||
|
COSIGN_EXPERIMENTAL: "true"
|
||||||
|
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
name: Test Linux Runner
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: CI Build
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
|
|
||||||
|
- name: Test Action
|
||||||
|
uses: irongut/CodeCoverageSummary@master
|
||||||
|
with:
|
||||||
|
filename: /src/coverage.*.xml
|
||||||
|
badge: true
|
||||||
|
fail_below_min: true
|
||||||
|
format: markdown
|
||||||
|
hide_branch_rate: false
|
||||||
|
hide_complexity: true
|
||||||
|
indicators: true
|
||||||
|
output: both
|
||||||
|
thresholds: '60 80'
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
name: Test MacOS Runner
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
branches: [master]
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: macos-latest
|
||||||
|
name: CI Build
|
||||||
|
steps:
|
||||||
|
- name: Test Action
|
||||||
|
uses: irongut/CodeCoverageSummary@master
|
||||||
|
with:
|
||||||
|
filename: /app/sample.coverage.xml,/app/sample.coverage.xml
|
||||||
|
badge: true
|
||||||
|
fail_below_min: true
|
||||||
|
format: markdown
|
||||||
|
hide_branch_rate: false
|
||||||
|
hide_complexity: true
|
||||||
|
indicators: true
|
||||||
|
output: both
|
||||||
|
thresholds: '60 80'
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
name: Test Windows Runner
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
branches: [master]
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: windows-latest
|
||||||
|
name: CI Build
|
||||||
|
steps:
|
||||||
|
- name: Test Action
|
||||||
|
uses: irongut/CodeCoverageSummary@master
|
||||||
|
with:
|
||||||
|
filename: /app/sample.coverage.xml,/app/sample.coverage.xml
|
||||||
|
badge: true
|
||||||
|
fail_below_min: true
|
||||||
|
format: markdown
|
||||||
|
hide_branch_rate: false
|
||||||
|
hide_complexity: true
|
||||||
|
indicators: true
|
||||||
|
output: both
|
||||||
|
thresholds: '60 80'
|
||||||
+6
-7
@@ -1,11 +1,10 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||||
|
COPY ["src/coverage.cobertura.xml", "/publish/sample.coverage.xml"]
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY ["src/CodeCoverageSummary/CodeCoverageSummary.csproj", "CodeCoverageSummary/"]
|
COPY ["src/CodeCoverageSummary/CodeCoverageSummary.csproj", "CodeCoverageSummary/"]
|
||||||
RUN dotnet restore CodeCoverageSummary/CodeCoverageSummary.csproj
|
RUN dotnet restore CodeCoverageSummary/CodeCoverageSummary.csproj
|
||||||
COPY ["src/CodeCoverageSummary", "CodeCoverageSummary/"]
|
COPY ["src/CodeCoverageSummary", "CodeCoverageSummary/"]
|
||||||
COPY ["src/coverage.cobertura.xml", "sample.coverage.xml"]
|
RUN dotnet publish CodeCoverageSummary/CodeCoverageSummary.csproj --configuration Release --no-restore --output /publish
|
||||||
RUN dotnet build CodeCoverageSummary/CodeCoverageSummary.csproj --configuration Release --no-restore --output /app/build
|
|
||||||
RUN dotnet publish CodeCoverageSummary/CodeCoverageSummary.csproj --configuration Release --no-restore --output /app/publish
|
|
||||||
|
|
||||||
# Label the container
|
# Label the container
|
||||||
LABEL maintainer="Irongut <murray.dave@outlook.com>"
|
LABEL maintainer="Irongut <murray.dave@outlook.com>"
|
||||||
@@ -18,8 +17,8 @@ LABEL com.github.actions.description="A GitHub Action that reads Cobertura forma
|
|||||||
LABEL com.github.actions.icon="book-open"
|
LABEL com.github.actions.icon="book-open"
|
||||||
LABEL com.github.actions.color="purple"
|
LABEL com.github.actions.color="purple"
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/runtime:5.0 AS final
|
FROM mcr.microsoft.com/dotnet/runtime:6.0 AS final
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build /app/publish .
|
COPY --from=build /publish .
|
||||||
COPY --from=build /src/sample.coverage.xml .
|
ENV DOTNET_EnableDiagnostics=0
|
||||||
ENTRYPOINT ["dotnet", "/app/CodeCoverageSummary.dll"]
|
ENTRYPOINT ["dotnet", "/app/CodeCoverageSummary.dll"]
|
||||||
@@ -1,29 +1,83 @@
|
|||||||
# Code Coverage Summary
|
# Code Coverage Summary
|
||||||
|
|
||||||
A GitHub Action that reads Cobertura format code coverage files from your test suite and outputs a text or markdown summary. This summary can then be posted as a Pull Request comment, included in Release Notes, etc by another action to give you an immediate insight into the health of your code without using a third-party site.
|
<div align="center">
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
[](https://bestpractices.coreinfrastructure.org/projects/6292)
|
||||||
|
|
||||||
|
[](https://github.com/irongut/CodeCoverageSummary/actions/workflows/ci-build.yml)
|
||||||
|
|
||||||
|
[](https://github.com/irongut/CodeCoverageSummary/actions/workflows/codeql-scan.yml)
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
A GitHub Action that reads Cobertura format code coverage files from your test suite and outputs a text or markdown summary. This summary can be posted as a Pull Request comment or included in Release Notes by other actions to give you an immediate insight into the health of your code without using a third-party site.
|
||||||
|
|
||||||
|
Code Coverage Summary is designed for use with any test framework that outputs coverage in Cobertura XML format including [Coverlet](https://github.com/coverlet-coverage/coverlet), [gcovr](https://github.com/gcovr/gcovr), [simplecov](https://github.com/simplecov-ruby/simplecov) and [MATLAB](https://uk.mathworks.com/help/matlab/ref/matlab.unittest.plugins.codecoverageplugin-class.html). See the [FAQ](https://github.com/irongut/CodeCoverageSummary/wiki/Frequently-Asked-Questions#which-testing-tools-does-ccs-work-with) for more details. If it doesn't work with your tooling please [open an issue][new-issue] to discuss the problem.
|
||||||
|
|
||||||
|
Code Coverage Summary is compatible with [StepSecurity Secure Workflows](https://github.com/step-security/secure-workflows) and uses a Docker image that is cryptographically signed using [Sigstore](https://www.sigstore.dev/). For instructions how to verify the Docker image please see the [Wiki](https://github.com/irongut/CodeCoverageSummary/wiki/Verify-the-Docker-Image).
|
||||||
|
|
||||||
|
**As a Docker based action Code Coverage Summary requires a Linux runner.**
|
||||||
|
|
||||||
Code Coverage Summary was designed for use with [Coverlet](https://github.com/coverlet-coverage/coverlet) and .Net but it should work with any test framework that outputs coverage in Cobertura format.
|
|
||||||
|
|
||||||
## Inputs
|
## Inputs
|
||||||
|
|
||||||
#### `filename`
|
### `filename`
|
||||||
**Required**
|
**Required**
|
||||||
|
|
||||||
Code coverage file to analyse.
|
A comma separated list of code coverage files to analyse. Also supports using glob patterns to match multiple files. If there are any spaces in a path or filename this value must be in quotes.
|
||||||
|
|
||||||
Note: Coverlet creates the coverage file in a random named directory (guid) so you need to copy it to a predictable path before running this Action, see the [.Net 5 Workflow Example](#net-5-workflow-example) below.
|
|
||||||
|
|
||||||
#### `badge`
|
### `badge`
|
||||||
|
|
||||||
Include a badge reporting the Line Rate coverage in the output using [shields.io](https://shields.io/) - `true` or `false` (default).
|
Include a badge reporting the Line Rate coverage in the output using [shields.io](https://shields.io/) - `true` or `false` (default).
|
||||||
|
|
||||||
If the overall Line Rate is less than 50% the badge will be red, if it is 50% - 74% it will be yellow and if it is 75% or over it will be green.
|
Line Rate | Badge
|
||||||
|
--------- | -----
|
||||||
|
less than lower threshold (50%) | 
|
||||||
|
between thresholds (50% - 74%) | 
|
||||||
|
equal or greater than upper threshold (75%) | 
|
||||||
|
|
||||||
#### `format`
|
See [`thresholds`](#thresholds) to change these values.
|
||||||
|
|
||||||
|
|
||||||
|
### `fail_below_min`
|
||||||
|
|
||||||
|
Fail the workflow if the overall Line Rate is below lower threshold - `true` or `false` (default). The default lower threshold is 50%, see [`thresholds`](#thresholds).
|
||||||
|
|
||||||
|
|
||||||
|
### `format`
|
||||||
|
|
||||||
Output Format - `markdown` or `text` (default).
|
Output Format - `markdown` or `text` (default).
|
||||||
|
|
||||||
#### `output`
|
|
||||||
|
### `hide_branch_rate`
|
||||||
|
|
||||||
|
Hide Branch Rate metrics in the output - `true` or `false` (default).
|
||||||
|
|
||||||
|
|
||||||
|
### `hide_complexity`
|
||||||
|
|
||||||
|
Hide Complexity metrics in the output - `true` or `false` (default).
|
||||||
|
|
||||||
|
|
||||||
|
### `indicators`
|
||||||
|
|
||||||
|
Include health indicators in the output - `true` (default) or `false`.
|
||||||
|
|
||||||
|
Line Rate | Indicator
|
||||||
|
--------- | ---------
|
||||||
|
less than lower threshold (50%) | ❌
|
||||||
|
between thresholds (50% - 74%) | ➖
|
||||||
|
equal or greater than upper threshold (75%) | ✔
|
||||||
|
|
||||||
|
See [`thresholds`](#thresholds) to change these values.
|
||||||
|
|
||||||
|
|
||||||
|
### `output`
|
||||||
|
|
||||||
Output Type - `console` (default), `file` or `both`.
|
Output Type - `console` (default), `file` or `both`.
|
||||||
|
|
||||||
@@ -33,34 +87,52 @@ Output Type - `console` (default), `file` or `both`.
|
|||||||
|
|
||||||
`both` will output the coverage summary to the Action log and a file as above.
|
`both` will output the coverage summary to the Action log and a file as above.
|
||||||
|
|
||||||
|
|
||||||
|
### `thresholds`
|
||||||
|
|
||||||
|
Lower and upper threshold percentages for badge and health indicators, lower threshold can also be used to fail the action. Separate the values with a space and enclose them in quotes; default `'50 75'`.
|
||||||
|
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
#### Text Example
|
### Text Example
|
||||||
```
|
```
|
||||||
https://img.shields.io/badge/Code%20Coverage-77%25-success?style=flat
|
https://img.shields.io/badge/Code%20Coverage-83%25-success?style=flat
|
||||||
Line Rate = 77%, Lines Covered = 1107 / 1433
|
|
||||||
Branch Rate = 60%, Branches Covered = 321 / 532
|
Company.Example: Line Rate = 83%, Branch Rate = 69%, Complexity = 671, ✔
|
||||||
Complexity = 917
|
Company.Example.Library: Line Rate = 27%, Branch Rate = 100%, Complexity = 11, ❌
|
||||||
Company.Example: Line Rate = 78%, Branch Rate = 60%, Complexity = 906
|
Summary: Line Rate = 83% (1212 / 1460), Branch Rate = 69% (262 / 378), Complexity = 682, ✔
|
||||||
Company.Example.Library: Line Rate = 27%, Branch Rate = 100%, Complexity = 11
|
Minimum allowed line rate is 50%
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Markdown Example
|
|
||||||

|
### Markdown Example
|
||||||
|
|
||||||
|
> 
|
||||||
|
>
|
||||||
|
> Package | Line Rate | Branch Rate | Complexity | Health
|
||||||
|
> -------- | --------- | ----------- | ---------- | ------
|
||||||
|
> Company.Example | 83% | 69% | 671 | ✔
|
||||||
|
> Company.Example.Library | 27% | 100% | 11 | ❌
|
||||||
|
> **Summary** | **83%** (1212 / 1460) | **69%** (262 / 378) | 682 | ✔
|
||||||
|
>
|
||||||
|
> _Minimum allowed line rate is `50%`_
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: Code Coverage Summary Report
|
name: Code Coverage Summary Report
|
||||||
uses: irongut/CodeCoverageSummary@v1.0.3
|
uses: irongut/CodeCoverageSummary@v1.3.0
|
||||||
with:
|
with:
|
||||||
filename: coverage/coverage.cobertura.xml
|
filename: coverage.cobertura.xml
|
||||||
```
|
```
|
||||||
|
|
||||||
### .Net 5 Workflow Example
|
|
||||||
|
### .Net Workflow Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: .Net 5 CI Build
|
name: .Net 6 CI Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -79,7 +151,7 @@ jobs:
|
|||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
uses: actions/setup-dotnet@v1
|
uses: actions/setup-dotnet@v1
|
||||||
with:
|
with:
|
||||||
dotnet-version: 5.0.x
|
dotnet-version: 6.0.x
|
||||||
|
|
||||||
- name: Restore Dependencies
|
- name: Restore Dependencies
|
||||||
run: dotnet restore src/Example.sln
|
run: dotnet restore src/Example.sln
|
||||||
@@ -90,16 +162,18 @@ jobs:
|
|||||||
- name: Test
|
- name: Test
|
||||||
run: dotnet test src/Example.sln --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
|
run: dotnet test src/Example.sln --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
|
||||||
|
|
||||||
- name: Copy Coverage To Predictable Location
|
- name: Code Coverage Report
|
||||||
run: cp coverage/**/coverage.cobertura.xml coverage/coverage.cobertura.xml
|
uses: irongut/CodeCoverageSummary@v1.3.0
|
||||||
|
|
||||||
- name: Code Coverage Summary Report
|
|
||||||
uses: irongut/CodeCoverageSummary@v1.0.3
|
|
||||||
with:
|
with:
|
||||||
filename: coverage/coverage.cobertura.xml
|
filename: coverage/**/coverage.cobertura.xml
|
||||||
badge: true
|
badge: true
|
||||||
format: 'markdown'
|
fail_below_min: true
|
||||||
output: 'both'
|
format: markdown
|
||||||
|
hide_branch_rate: false
|
||||||
|
hide_complexity: true
|
||||||
|
indicators: true
|
||||||
|
output: both
|
||||||
|
thresholds: '60 80'
|
||||||
|
|
||||||
- name: Add Coverage PR Comment
|
- name: Add Coverage PR Comment
|
||||||
uses: marocchino/sticky-pull-request-comment@v2
|
uses: marocchino/sticky-pull-request-comment@v2
|
||||||
@@ -109,6 +183,17 @@ jobs:
|
|||||||
path: code-coverage-results.md
|
path: code-coverage-results.md
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Version Numbers
|
||||||
|
|
||||||
|
Version numbers will be assigned according to the [Semantic Versioning](https://semver.org/) scheme.
|
||||||
|
This means, given a version number MAJOR.MINOR.PATCH, we will increment the:
|
||||||
|
|
||||||
|
1. MAJOR version when we make incompatible API changes
|
||||||
|
2. MINOR version when we add functionality in a backwards compatible manner
|
||||||
|
3. PATCH version when we make backwards compatible bug fixes
|
||||||
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
### Report Bugs
|
### Report Bugs
|
||||||
@@ -117,10 +202,12 @@ Please make sure the bug is not already reported by searching existing [issues].
|
|||||||
|
|
||||||
If you're unable to find an existing issue addressing the problem please [open a new one][new-issue]. Be sure to include a title and clear description, as much relevant information as possible, a workflow sample and any logs demonstrating the problem.
|
If you're unable to find an existing issue addressing the problem please [open a new one][new-issue]. Be sure to include a title and clear description, as much relevant information as possible, a workflow sample and any logs demonstrating the problem.
|
||||||
|
|
||||||
|
|
||||||
### Suggest an Enhancement
|
### Suggest an Enhancement
|
||||||
|
|
||||||
Please [open a new issue][new-issue].
|
Please [open a new issue][new-issue].
|
||||||
|
|
||||||
|
|
||||||
### Submit a Pull Request
|
### Submit a Pull Request
|
||||||
|
|
||||||
Discuss your idea first, so that your changes have a good chance of being merged in.
|
Discuss your idea first, so that your changes have a good chance of being merged in.
|
||||||
@@ -129,6 +216,7 @@ Submit your pull request against the `master` branch.
|
|||||||
|
|
||||||
Pull requests that include documentation and relevant updates to README.md are merged faster, because you won't have to wait for somebody else to complete your contribution.
|
Pull requests that include documentation and relevant updates to README.md are merged faster, because you won't have to wait for somebody else to complete your contribution.
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Code Coverage Summary is available under the MIT license, see the [LICENSE](LICENSE) file for more info.
|
Code Coverage Summary is available under the MIT license, see the [LICENSE](LICENSE) file for more info.
|
||||||
|
|||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
Version | Supported
|
||||||
|
------- | ------------------
|
||||||
|
1.3.0 | :white_check_mark:
|
||||||
|
1.3.0-beta | :x:
|
||||||
|
1.2.0 | :x:
|
||||||
|
1.1.0 | :x:
|
||||||
|
1.0.x | :x:
|
||||||
|
|
||||||
|
Only the latest version is supported. If you find a security vulnerability in an eariler version please check it exists in the latest version before reporting.
|
||||||
|
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
Please make sure the vulnerability is not already reported by searching existing [issues].
|
||||||
|
|
||||||
|
If you're unable to find an existing issue addressing the vulnerability please [open a new issue][new-issue].
|
||||||
|
Be sure to include a title and clear description and as much relevant information as possible.
|
||||||
|
Please tag the issue with the `Security` label.
|
||||||
|
|
||||||
|
|
||||||
|
[issues]: https://github.com/irongut/CodeCoverageSummary/issues
|
||||||
|
[new-issue]: https://github.com/irongut/CodeCoverageSummary/issues/new
|
||||||
+34
-3
@@ -6,28 +6,59 @@ branding:
|
|||||||
color: purple
|
color: purple
|
||||||
inputs:
|
inputs:
|
||||||
filename:
|
filename:
|
||||||
description: 'Code coverage file to analyse.'
|
description: 'A comma separated list of code coverage files to analyse. Also supports using glob patterns to match multiple files.'
|
||||||
required: true
|
required: true
|
||||||
badge:
|
badge:
|
||||||
description: 'Include a badge in the output - true / false (default).'
|
description: 'Include a Line Rate coverage badge in the output using shields.io - true / false (default).'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
fail_below_min:
|
||||||
|
description: 'Fail if overall Line Rate below lower threshold - true / false (default).'
|
||||||
required: false
|
required: false
|
||||||
default: 'false'
|
default: 'false'
|
||||||
format:
|
format:
|
||||||
description: 'Output Format - markdown or text (default).'
|
description: 'Output Format - markdown or text (default).'
|
||||||
required: false
|
required: false
|
||||||
default: 'text'
|
default: 'text'
|
||||||
|
hide_branch_rate:
|
||||||
|
description: 'Hide Branch Rate values in the output - true / false (default).'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
hide_complexity:
|
||||||
|
description: 'Hide Complexity values in the output - true / false (default).'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
indicators:
|
||||||
|
description: 'Include health indicators in the output - true (default) / false.'
|
||||||
|
required: false
|
||||||
|
default: 'true'
|
||||||
output:
|
output:
|
||||||
description: 'Output Type - console (default), file or both.'
|
description: 'Output Type - console (default), file or both.'
|
||||||
required: false
|
required: false
|
||||||
default: 'console'
|
default: 'console'
|
||||||
|
thresholds:
|
||||||
|
description: 'Threshold percentages for badge and health indicators, lower threshold can also be used to fail the action.'
|
||||||
|
required: false
|
||||||
|
default: '50 75'
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'docker://ghcr.io/irongut/codecoveragesummary:v1.0.2'
|
image: 'docker://ghcr.io/irongut/codecoveragesummary:v1.3.0'
|
||||||
args:
|
args:
|
||||||
|
- '--files'
|
||||||
- ${{ inputs.filename }}
|
- ${{ inputs.filename }}
|
||||||
- '--badge'
|
- '--badge'
|
||||||
- ${{ inputs.badge }}
|
- ${{ inputs.badge }}
|
||||||
|
- '--fail'
|
||||||
|
- ${{ inputs.fail_below_min }}
|
||||||
- '--format'
|
- '--format'
|
||||||
- ${{ inputs.format }}
|
- ${{ inputs.format }}
|
||||||
|
- '--hidebranch'
|
||||||
|
- ${{ inputs.hide_branch_rate }}
|
||||||
|
- '--hidecomplexity'
|
||||||
|
- ${{ inputs.hide_complexity }}
|
||||||
|
- '--indicators'
|
||||||
|
- ${{ inputs.indicators }}
|
||||||
- '--output'
|
- '--output'
|
||||||
- ${{ inputs.output }}
|
- ${{ inputs.output }}
|
||||||
|
- '--thresholds'
|
||||||
|
- ${{ inputs.thresholds }}
|
||||||
|
|||||||
@@ -2,24 +2,25 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||||
<Company>Taranis Software</Company>
|
<Company>Taranis Software</Company>
|
||||||
<Authors>Irongut</Authors>
|
<Authors>Irongut</Authors>
|
||||||
<Description>A GitHub Action that reads Cobertura format code coverage files and outputs a text or markdown summary.</Description>
|
<Description>A GitHub Action that reads Cobertura format code coverage files and outputs a text or markdown summary.</Description>
|
||||||
<Copyright>Copyright © 2021 Taranis Software</Copyright>
|
<Copyright>Copyright © 2021 - 2022 Taranis Software</Copyright>
|
||||||
<PackageId>Taranis.CodeCoverageSummary</PackageId>
|
<PackageId>Taranis.CodeCoverageSummary</PackageId>
|
||||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
<PackageProjectUrl>https://github.com/irongut/CodeCoverageSummary</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/irongut/CodeCoverageSummary</PackageProjectUrl>
|
||||||
<RepositoryUrl>https://github.com/irongut/CodeCoverageSummary</RepositoryUrl>
|
<RepositoryUrl>https://github.com/irongut/CodeCoverageSummary</RepositoryUrl>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<PackageTags>coverage test-coverage cobertura action code-coverage coverlet github-actions</PackageTags>
|
<PackageTags>coverage test-coverage cobertura action code-coverage coverlet github-actions</PackageTags>
|
||||||
<Version>1.0.3</Version>
|
<Version>1.3.0</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="CommandLineParser" Version="2.8.0" />
|
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.11.1" />
|
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="6.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace CodeCoverageSummary
|
|||||||
|
|
||||||
public double BranchRate { get; set; }
|
public double BranchRate { get; set; }
|
||||||
|
|
||||||
public int Complexity { get; set; }
|
public double Complexity { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CodeSummary
|
public class CodeSummary
|
||||||
@@ -27,13 +27,10 @@ namespace CodeCoverageSummary
|
|||||||
|
|
||||||
public int BranchesValid { get; set; }
|
public int BranchesValid { get; set; }
|
||||||
|
|
||||||
public int Complexity { get; set; }
|
public double Complexity { get; set; }
|
||||||
|
|
||||||
public List<CodeCoverage> Packages { get; set; }
|
public List<CodeCoverage> Packages { get; set; }
|
||||||
|
|
||||||
public CodeSummary()
|
public CodeSummary() => Packages = new();
|
||||||
{
|
|
||||||
Packages = new List<CodeCoverage>();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,46 @@
|
|||||||
using CommandLine;
|
using CommandLine;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace CodeCoverageSummary
|
namespace CodeCoverageSummary
|
||||||
{
|
{
|
||||||
public class CommandLineOptions
|
public class CommandLineOptions
|
||||||
{
|
{
|
||||||
[Value(index: 0, Required = true, HelpText = "Code coverage file to analyse.")]
|
[Option(longName: "files", Separator = ',', Required = true, HelpText = "A comma separated list of code coverage files to analyse. Also accepts glob patterns.")]
|
||||||
public string Filename { get; set; }
|
public IEnumerable<string> Files { get; set; }
|
||||||
|
|
||||||
[Option(longName: "badge", Required = false, HelpText = "Include a badge reporting the Line Rate coverage in the output using shields.io - true or false.", Default = false)]
|
[Option(longName: "badge", Required = false, HelpText = "Include a Line Rate coverage badge in the output using shields.io - true or false.", Default = "false")]
|
||||||
public bool Badge { get; set; }
|
public string BadgeString { get; set; }
|
||||||
|
|
||||||
|
public bool Badge => BadgeString.Equals("true", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
[Option(longName: "fail", Required = false, HelpText = "Fail if overall Line Rate below lower threshold - true or false.", Default = "false")]
|
||||||
|
public string FailString { get; set; }
|
||||||
|
|
||||||
|
public bool FailBelowThreshold => FailString.Equals("true", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
[Option(longName: "format", Required = false, HelpText = "Output Format - markdown or text.", Default = "text")]
|
[Option(longName: "format", Required = false, HelpText = "Output Format - markdown or text.", Default = "text")]
|
||||||
public string Format { get; set; }
|
public string Format { get; set; }
|
||||||
|
|
||||||
|
[Option(longName: "hidebranch", Required = false, HelpText = "Hide Branch Rate values in the output - true or false.", Default = "false")]
|
||||||
|
public string HideBranchString { get; set; }
|
||||||
|
|
||||||
|
public bool HideBranchRate => HideBranchString.Equals("true", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
[Option(longName: "hidecomplexity", Required = false, HelpText = "Hide Complexity values in the output - true or false.", Default = "false")]
|
||||||
|
public string HideComplexityString { get; set; }
|
||||||
|
|
||||||
|
public bool HideComplexity => HideComplexityString.Equals("true", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
[Option(longName: "indicators", Required = false, HelpText = "Include health indicators in the output - true or false.", Default = "true")]
|
||||||
|
public string IndicatorsString { get; set; }
|
||||||
|
|
||||||
|
public bool Indicators => IndicatorsString.Equals("true", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
[Option(longName: "output", Required = false, HelpText = "Output Type - console, file or both.", Default = "console")]
|
[Option(longName: "output", Required = false, HelpText = "Output Type - console, file or both.", Default = "console")]
|
||||||
public string Output { get; set; }
|
public string Output { get; set; }
|
||||||
|
|
||||||
|
[Option(longName: "thresholds", Required = false, HelpText = "Threshold percentages for badge and health indicators, lower threshold can also be used to fail the action.", Default = "50 75")]
|
||||||
|
public string Thresholds { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,3 +6,4 @@
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
[assembly: SuppressMessage("Performance", "RCS1197:Optimize StringBuilder.Append/AppendLine call.", Scope = "type", Target = "~T:CodeCoverageSummary.Program")]
|
[assembly: SuppressMessage("Performance", "RCS1197:Optimize StringBuilder.Append/AppendLine call.", Scope = "type", Target = "~T:CodeCoverageSummary.Program")]
|
||||||
|
[assembly: SuppressMessage("Style", "IDE0057:Use range operator", Scope = "member", Target = "~M:CodeCoverageSummary.Program.SetThresholds(System.String)")]
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using CommandLine;
|
using CommandLine;
|
||||||
|
using Microsoft.Extensions.FileSystemGlobbing;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -9,6 +11,9 @@ namespace CodeCoverageSummary
|
|||||||
{
|
{
|
||||||
internal static class Program
|
internal static class Program
|
||||||
{
|
{
|
||||||
|
private static double lowerThreshold = 0.5;
|
||||||
|
private static double upperThreshold = 0.75;
|
||||||
|
|
||||||
private static int Main(string[] args)
|
private static int Main(string[] args)
|
||||||
{
|
{
|
||||||
return Parser.Default.ParseArguments<CommandLineOptions>(args)
|
return Parser.Default.ParseArguments<CommandLineOptions>(args)
|
||||||
@@ -16,22 +21,57 @@ namespace CodeCoverageSummary
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!File.Exists(o.Filename))
|
// use glob patterns to match files
|
||||||
|
Matcher matcher = new();
|
||||||
|
matcher.AddIncludePatterns(o.Files.ToArray());
|
||||||
|
IEnumerable<string> matchingFiles = matcher.GetResultsInFullPath(".");
|
||||||
|
|
||||||
|
if (matchingFiles?.Any() == false)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Error: Code coverage file not found.");
|
Console.WriteLine("Error: No files found matching glob pattern.");
|
||||||
return -2; // error
|
return -2; // error
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse code coverage file
|
// check files exist
|
||||||
Console.WriteLine($"Code Coverage File: {o.Filename}");
|
foreach (var file in matchingFiles)
|
||||||
CodeSummary summary = ParseTestResults(o.Filename);
|
|
||||||
if (summary == null)
|
|
||||||
{
|
{
|
||||||
Console.WriteLine("Error: Parsing code coverage file.");
|
if (!File.Exists(file))
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Error: Coverage file not found - {file}.");
|
||||||
|
return -2; // error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// parse code coverage file
|
||||||
|
CodeSummary summary = new();
|
||||||
|
foreach (var file in matchingFiles)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Coverage File: {file}");
|
||||||
|
summary = ParseTestResults(file, summary);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (summary == null)
|
||||||
|
return -2; // error
|
||||||
|
|
||||||
|
summary.LineRate /= matchingFiles.Count();
|
||||||
|
summary.BranchRate /= matchingFiles.Count();
|
||||||
|
|
||||||
|
if (summary.Packages.Count == 0)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Parsing Error: No packages found in coverage files.");
|
||||||
return -2; // error
|
return -2; // error
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// hide branch rate if metrics missing
|
||||||
|
bool hideBranchRate = o.HideBranchRate;
|
||||||
|
if (summary.BranchRate == 0 && summary.BranchesCovered == 0 && summary.BranchesValid == 0)
|
||||||
|
hideBranchRate = true;
|
||||||
|
|
||||||
|
// set health badge thresholds
|
||||||
|
if (!string.IsNullOrWhiteSpace(o.Thresholds))
|
||||||
|
SetThresholds(o.Thresholds);
|
||||||
|
|
||||||
// generate badge
|
// generate badge
|
||||||
string badgeUrl = o.Badge ? GenerateBadge(summary) : null;
|
string badgeUrl = o.Badge ? GenerateBadge(summary) : null;
|
||||||
|
|
||||||
@@ -41,12 +81,16 @@ namespace CodeCoverageSummary
|
|||||||
if (o.Format.Equals("text", StringComparison.OrdinalIgnoreCase))
|
if (o.Format.Equals("text", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
fileExt = "txt";
|
fileExt = "txt";
|
||||||
output = GenerateTextOutput(summary, badgeUrl);
|
output = GenerateTextOutput(summary, badgeUrl, o.Indicators, hideBranchRate, o.HideComplexity);
|
||||||
|
if (o.FailBelowThreshold)
|
||||||
|
output += $"Minimum allowed line rate is {lowerThreshold * 100:N0}%{Environment.NewLine}";
|
||||||
}
|
}
|
||||||
else if (o.Format.Equals("md", StringComparison.OrdinalIgnoreCase) || o.Format.Equals("markdown", StringComparison.OrdinalIgnoreCase))
|
else if (o.Format.Equals("md", StringComparison.OrdinalIgnoreCase) || o.Format.Equals("markdown", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
fileExt = "md";
|
fileExt = "md";
|
||||||
output = GenerateMarkdownOutput(summary, badgeUrl);
|
output = GenerateMarkdownOutput(summary, badgeUrl, o.Indicators, hideBranchRate, o.HideComplexity);
|
||||||
|
if (o.FailBelowThreshold)
|
||||||
|
output += $"{Environment.NewLine}_Minimum allowed line rate is `{lowerThreshold * 100:N0}%`_{Environment.NewLine}";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -57,6 +101,7 @@ namespace CodeCoverageSummary
|
|||||||
// output
|
// output
|
||||||
if (o.Output.Equals("console", StringComparison.OrdinalIgnoreCase))
|
if (o.Output.Equals("console", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
|
Console.WriteLine();
|
||||||
Console.WriteLine(output);
|
Console.WriteLine(output);
|
||||||
}
|
}
|
||||||
else if (o.Output.Equals("file", StringComparison.OrdinalIgnoreCase))
|
else if (o.Output.Equals("file", StringComparison.OrdinalIgnoreCase))
|
||||||
@@ -65,6 +110,7 @@ namespace CodeCoverageSummary
|
|||||||
}
|
}
|
||||||
else if (o.Output.Equals("both", StringComparison.OrdinalIgnoreCase))
|
else if (o.Output.Equals("both", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
|
Console.WriteLine();
|
||||||
Console.WriteLine(output);
|
Console.WriteLine(output);
|
||||||
File.WriteAllText($"code-coverage-results.{fileExt}", output);
|
File.WriteAllText($"code-coverage-results.{fileExt}", output);
|
||||||
}
|
}
|
||||||
@@ -74,6 +120,12 @@ namespace CodeCoverageSummary
|
|||||||
return -2; // error
|
return -2; // error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (o.FailBelowThreshold && summary.LineRate < lowerThreshold)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"FAIL: Overall line rate below minimum threshold of {lowerThreshold * 100:N0}%.");
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
|
||||||
return 0; // success
|
return 0; // success
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,9 +138,11 @@ namespace CodeCoverageSummary
|
|||||||
_ => -1); // invalid arguments
|
_ => -1); // invalid arguments
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CodeSummary ParseTestResults(string filename)
|
private static CodeSummary ParseTestResults(string filename, CodeSummary summary)
|
||||||
{
|
{
|
||||||
CodeSummary summary = new();
|
if (summary == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string rss = File.ReadAllText(filename);
|
string rss = File.ReadAllText(filename);
|
||||||
@@ -98,72 +152,131 @@ namespace CodeCoverageSummary
|
|||||||
var coverage = from item in xdoc.Descendants("coverage")
|
var coverage = from item in xdoc.Descendants("coverage")
|
||||||
select item;
|
select item;
|
||||||
|
|
||||||
|
if (!coverage.Any())
|
||||||
|
throw new Exception("Coverage file invalid, data not found");
|
||||||
|
|
||||||
var lineR = from item in coverage.Attributes()
|
var lineR = from item in coverage.Attributes()
|
||||||
where item.Name == "line-rate"
|
where item.Name == "line-rate"
|
||||||
select item;
|
select item;
|
||||||
summary.LineRate = double.Parse(lineR.First().Value);
|
|
||||||
|
if (!lineR.Any())
|
||||||
|
throw new Exception("Overall line rate not found");
|
||||||
|
|
||||||
|
summary.LineRate += double.Parse(lineR.First().Value);
|
||||||
|
|
||||||
var linesCovered = from item in coverage.Attributes()
|
var linesCovered = from item in coverage.Attributes()
|
||||||
where item.Name == "lines-covered"
|
where item.Name == "lines-covered"
|
||||||
select item;
|
select item;
|
||||||
summary.LinesCovered = int.Parse(linesCovered.First().Value);
|
|
||||||
|
if (!linesCovered.Any())
|
||||||
|
throw new Exception("Overall lines covered not found");
|
||||||
|
|
||||||
|
summary.LinesCovered += int.Parse(linesCovered.First().Value);
|
||||||
|
|
||||||
var linesValid = from item in coverage.Attributes()
|
var linesValid = from item in coverage.Attributes()
|
||||||
where item.Name == "lines-valid"
|
where item.Name == "lines-valid"
|
||||||
select item;
|
select item;
|
||||||
summary.LinesValid = int.Parse(linesValid.First().Value);
|
|
||||||
|
if (!linesValid.Any())
|
||||||
|
throw new Exception("Overall lines valid not found");
|
||||||
|
|
||||||
|
summary.LinesValid += int.Parse(linesValid.First().Value);
|
||||||
|
|
||||||
var branchR = from item in coverage.Attributes()
|
var branchR = from item in coverage.Attributes()
|
||||||
where item.Name == "branch-rate"
|
where item.Name == "branch-rate"
|
||||||
select item;
|
select item;
|
||||||
summary.BranchRate = double.Parse(branchR.First().Value);
|
|
||||||
|
|
||||||
var branchesCovered = from item in coverage.Attributes()
|
if (branchR.Any())
|
||||||
where item.Name == "branches-covered"
|
{
|
||||||
select item;
|
summary.BranchRate += double.TryParse(branchR.First().Value, out double bRate) ? bRate : 0;
|
||||||
summary.BranchesCovered = int.Parse(branchesCovered.First().Value);
|
|
||||||
|
|
||||||
var branchesValid = from item in coverage.Attributes()
|
var branchesCovered = from item in coverage.Attributes()
|
||||||
where item.Name == "branches-valid"
|
where item.Name == "branches-covered"
|
||||||
select item;
|
select item;
|
||||||
summary.BranchesValid = int.Parse(branchesValid.First().Value);
|
|
||||||
|
|
||||||
summary.Complexity = 0;
|
summary.BranchesCovered += int.TryParse(branchesCovered?.First().Value ?? "0", out int bCovered) ? bCovered : 0;
|
||||||
|
|
||||||
|
var branchesValid = from item in coverage.Attributes()
|
||||||
|
where item.Name == "branches-valid"
|
||||||
|
select item;
|
||||||
|
|
||||||
|
summary.BranchesValid += int.TryParse(branchesValid?.First().Value ?? "0", out int bValid) ? bValid : 0;
|
||||||
|
}
|
||||||
|
|
||||||
// test coverage for individual packages
|
// test coverage for individual packages
|
||||||
var packages = from item in coverage.Descendants("package")
|
var packages = from item in coverage.Descendants("package")
|
||||||
select item;
|
select item;
|
||||||
|
|
||||||
|
if (!packages.Any())
|
||||||
|
throw new Exception("No package data found");
|
||||||
|
|
||||||
|
int i = 1;
|
||||||
foreach (var item in packages)
|
foreach (var item in packages)
|
||||||
{
|
{
|
||||||
CodeCoverage packageCoverage = new()
|
CodeCoverage packageCoverage = new()
|
||||||
{
|
{
|
||||||
Name = item.Attribute("name").Value,
|
Name = string.IsNullOrWhiteSpace(item.Attribute("name")?.Value) ? $"{Path.GetFileNameWithoutExtension(filename)} Package {i}" : item.Attribute("name").Value,
|
||||||
LineRate = double.Parse(item.Attribute("line-rate").Value),
|
LineRate = double.Parse(item.Attribute("line-rate")?.Value ?? "0"),
|
||||||
BranchRate = double.Parse(item.Attribute("branch-rate").Value),
|
BranchRate = double.TryParse(item.Attribute("branch-rate")?.Value ?? "0", out double bRate) ? bRate : 0,
|
||||||
Complexity = int.Parse(item.Attribute("complexity")?.Value ?? "0")
|
Complexity = double.TryParse(item.Attribute("complexity")?.Value ?? "0", out double complex) ? complex : 0
|
||||||
};
|
};
|
||||||
summary.Packages.Add(packageCoverage);
|
summary.Packages.Add(packageCoverage);
|
||||||
summary.Complexity += packageCoverage.Complexity;
|
summary.Complexity += packageCoverage.Complexity;
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return summary;
|
return summary;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Parse Error: {ex.Message}");
|
Console.WriteLine($"Parsing Error: {ex.Message} - {filename}");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void SetThresholds(string thresholds)
|
||||||
|
{
|
||||||
|
int lowerPercentage;
|
||||||
|
int upperPercentage = (int)(upperThreshold * 100);
|
||||||
|
int s = thresholds.IndexOf(" ");
|
||||||
|
if (s == 0)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Threshold parameter set incorrectly.");
|
||||||
|
}
|
||||||
|
else if (s < 0)
|
||||||
|
{
|
||||||
|
if (!int.TryParse(thresholds, out lowerPercentage))
|
||||||
|
throw new ArgumentException("Threshold parameter set incorrectly.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!int.TryParse(thresholds.AsSpan(0, s), out lowerPercentage))
|
||||||
|
throw new ArgumentException("Threshold parameter set incorrectly.");
|
||||||
|
|
||||||
|
if (!int.TryParse(thresholds.AsSpan(s + 1), out upperPercentage))
|
||||||
|
throw new ArgumentException("Threshold parameter set incorrectly.");
|
||||||
|
}
|
||||||
|
lowerThreshold = lowerPercentage / 100.0;
|
||||||
|
upperThreshold = upperPercentage / 100.0;
|
||||||
|
|
||||||
|
if (lowerThreshold > 1.0)
|
||||||
|
lowerThreshold = 1.0;
|
||||||
|
|
||||||
|
if (lowerThreshold > upperThreshold)
|
||||||
|
upperThreshold = lowerThreshold + 0.1;
|
||||||
|
|
||||||
|
if (upperThreshold > 1.0)
|
||||||
|
upperThreshold = 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
private static string GenerateBadge(CodeSummary summary)
|
private static string GenerateBadge(CodeSummary summary)
|
||||||
{
|
{
|
||||||
string colour;
|
string colour;
|
||||||
if (summary.LineRate < 0.5)
|
if (summary.LineRate < lowerThreshold)
|
||||||
{
|
{
|
||||||
colour = "critical";
|
colour = "critical";
|
||||||
}
|
}
|
||||||
else if (summary.LineRate < 0.75)
|
else if (summary.LineRate < upperThreshold)
|
||||||
{
|
{
|
||||||
colour = "yellow";
|
colour = "yellow";
|
||||||
}
|
}
|
||||||
@@ -174,47 +287,79 @@ namespace CodeCoverageSummary
|
|||||||
return $"https://img.shields.io/badge/Code%20Coverage-{summary.LineRate * 100:N0}%25-{colour}?style=flat";
|
return $"https://img.shields.io/badge/Code%20Coverage-{summary.LineRate * 100:N0}%25-{colour}?style=flat";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GenerateTextOutput(CodeSummary summary, string badgeUrl)
|
private static string GenerateHealthIndicator(double rate)
|
||||||
|
{
|
||||||
|
if (rate < lowerThreshold)
|
||||||
|
{
|
||||||
|
return "❌";
|
||||||
|
}
|
||||||
|
else if (rate < upperThreshold)
|
||||||
|
{
|
||||||
|
return "➖";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "✔";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string GenerateTextOutput(CodeSummary summary, string badgeUrl, bool indicators, bool hideBranchRate, bool hideComplexity)
|
||||||
{
|
{
|
||||||
StringBuilder textOutput = new();
|
StringBuilder textOutput = new();
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(badgeUrl))
|
if (!string.IsNullOrWhiteSpace(badgeUrl))
|
||||||
{
|
{
|
||||||
textOutput.AppendLine(badgeUrl);
|
textOutput.AppendLine(badgeUrl)
|
||||||
|
.AppendLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
textOutput.AppendLine($"Line Rate = {summary.LineRate * 100:N0}%, Lines Covered = {summary.LinesCovered} / {summary.LinesValid}")
|
|
||||||
.AppendLine($"Branch Rate = {summary.BranchRate * 100:N0}%, Branches Covered = {summary.BranchesCovered} / {summary.BranchesValid}")
|
|
||||||
.AppendLine($"Complexity = {summary.Complexity}");
|
|
||||||
|
|
||||||
foreach (CodeCoverage package in summary.Packages)
|
foreach (CodeCoverage package in summary.Packages)
|
||||||
{
|
{
|
||||||
textOutput.AppendLine($"{package.Name}: Line Rate = {package.LineRate * 100:N0}%, Branch Rate = {package.BranchRate * 100:N0}%, Complexity = {package.Complexity}");
|
textOutput.Append($"{package.Name}: Line Rate = {package.LineRate * 100:N0}%")
|
||||||
|
.Append(hideBranchRate ? string.Empty : $", Branch Rate = {package.BranchRate * 100:N0}%")
|
||||||
|
.Append(hideComplexity ? string.Empty : (package.Complexity % 1 == 0) ? $", Complexity = {package.Complexity}" : $", Complexity = {package.Complexity:N4}")
|
||||||
|
.AppendLine(indicators ? $", {GenerateHealthIndicator(package.LineRate)}" : string.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
textOutput.Append($"Summary: Line Rate = {summary.LineRate * 100:N0}% ({summary.LinesCovered} / {summary.LinesValid})")
|
||||||
|
.Append(hideBranchRate ? string.Empty : $", Branch Rate = {summary.BranchRate * 100:N0}% ({summary.BranchesCovered} / {summary.BranchesValid})")
|
||||||
|
.Append(hideComplexity ? string.Empty : (summary.Complexity % 1 == 0) ? $", Complexity = {summary.Complexity}" : $", Complexity = {summary.Complexity:N4}")
|
||||||
|
.AppendLine(indicators ? $", {GenerateHealthIndicator(summary.LineRate)}" : string.Empty);
|
||||||
|
|
||||||
return textOutput.ToString();
|
return textOutput.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GenerateMarkdownOutput(CodeSummary summary, string badgeUrl)
|
private static string GenerateMarkdownOutput(CodeSummary summary, string badgeUrl, bool indicators, bool hideBranchRate, bool hideComplexity)
|
||||||
{
|
{
|
||||||
StringBuilder markdownOutput = new();
|
StringBuilder markdownOutput = new();
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(badgeUrl))
|
if (!string.IsNullOrWhiteSpace(badgeUrl))
|
||||||
{
|
{
|
||||||
markdownOutput.AppendLine($"");
|
markdownOutput.AppendLine($"")
|
||||||
markdownOutput.AppendLine("");
|
.AppendLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
markdownOutput.AppendLine("Package | Line Rate | Branch Rate | Complexity")
|
markdownOutput.Append("Package | Line Rate")
|
||||||
.AppendLine("-------- | --------- | ----------- | ----------");
|
.Append(hideBranchRate ? string.Empty : " | Branch Rate")
|
||||||
|
.Append(hideComplexity ? string.Empty : " | Complexity")
|
||||||
|
.AppendLine(indicators ? " | Health" : string.Empty)
|
||||||
|
.Append("-------- | ---------")
|
||||||
|
.Append(hideBranchRate ? string.Empty : " | -----------")
|
||||||
|
.Append(hideComplexity ? string.Empty : " | ----------")
|
||||||
|
.AppendLine(indicators ? " | ------" : string.Empty);
|
||||||
|
|
||||||
foreach (CodeCoverage package in summary.Packages)
|
foreach (CodeCoverage package in summary.Packages)
|
||||||
{
|
{
|
||||||
markdownOutput.AppendLine($"{package.Name} | {package.LineRate * 100:N0}% | {package.BranchRate * 100:N0}% | {package.Complexity}");
|
markdownOutput.Append($"{package.Name} | {package.LineRate * 100:N0}%")
|
||||||
|
.Append(hideBranchRate ? string.Empty : $" | {package.BranchRate * 100:N0}%")
|
||||||
|
.Append(hideComplexity ? string.Empty : (package.Complexity % 1 == 0) ? $" | {package.Complexity}" : $" | {package.Complexity:N4}" )
|
||||||
|
.AppendLine(indicators ? $" | {GenerateHealthIndicator(package.LineRate)}" : string.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
markdownOutput.Append($"**Summary** | **{summary.LineRate * 100:N0}%** ({summary.LinesCovered} / {summary.LinesValid}) | ")
|
markdownOutput.Append($"**Summary** | **{summary.LineRate * 100:N0}%** ({summary.LinesCovered} / {summary.LinesValid})")
|
||||||
.AppendLine($"**{summary.BranchRate * 100:N0}%** ({summary.BranchesCovered} / {summary.BranchesValid}) | {summary.Complexity}");
|
.Append(hideBranchRate ? string.Empty : $" | **{summary.BranchRate * 100:N0}%** ({summary.BranchesCovered} / {summary.BranchesValid})")
|
||||||
|
.Append(hideComplexity ? string.Empty : (summary.Complexity % 1 == 0) ? $" | **{summary.Complexity}**" : $" | **{summary.Complexity:N4}**")
|
||||||
|
.AppendLine(indicators ? $" | {GenerateHealthIndicator(summary.LineRate)}" : string.Empty);
|
||||||
|
|
||||||
return markdownOutput.ToString();
|
return markdownOutput.ToString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"CodeCoverageSummary": {
|
"CodeCoverageSummary": {
|
||||||
"commandName": "Project"
|
"commandName": "Project",
|
||||||
|
"commandLineArgs": "--files **/coverage.*.xml --format=text --badge true --thresholds=\"85 90\" --fail true"
|
||||||
},
|
},
|
||||||
"Docker": {
|
"Docker": {
|
||||||
"commandName": "Docker",
|
"commandName": "Docker",
|
||||||
"commandLineArgs": "/src/coverage.cobertura.xml --format=md --badge=true"
|
"commandLineArgs": "--files /app/sample.coverage.xml --format=text --badge=true"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
<!-- Portions (C) International Organization for Standardization 1986:
|
||||||
|
Permission to copy in any form is granted for use with
|
||||||
|
conforming SGML systems and applications as defined in
|
||||||
|
ISO 8879, provided this notice is included in all copies.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!ELEMENT coverage (sources?,packages)>
|
||||||
|
<!ATTLIST coverage line-rate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST coverage branch-rate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST coverage lines-covered CDATA #REQUIRED>
|
||||||
|
<!ATTLIST coverage lines-valid CDATA #REQUIRED>
|
||||||
|
<!ATTLIST coverage branches-covered CDATA #REQUIRED>
|
||||||
|
<!ATTLIST coverage branches-valid CDATA #REQUIRED>
|
||||||
|
<!ATTLIST coverage complexity CDATA #REQUIRED>
|
||||||
|
<!ATTLIST coverage version CDATA #REQUIRED>
|
||||||
|
<!ATTLIST coverage timestamp CDATA #REQUIRED>
|
||||||
|
|
||||||
|
<!ELEMENT sources (source*)>
|
||||||
|
|
||||||
|
<!ELEMENT source (#PCDATA)>
|
||||||
|
|
||||||
|
<!ELEMENT packages (package*)>
|
||||||
|
|
||||||
|
<!ELEMENT package (classes)>
|
||||||
|
<!ATTLIST package name CDATA #REQUIRED>
|
||||||
|
<!ATTLIST package line-rate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST package branch-rate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST package complexity CDATA #REQUIRED>
|
||||||
|
|
||||||
|
<!ELEMENT classes (class*)>
|
||||||
|
|
||||||
|
<!ELEMENT class (methods,lines)>
|
||||||
|
<!ATTLIST class name CDATA #REQUIRED>
|
||||||
|
<!ATTLIST class filename CDATA #REQUIRED>
|
||||||
|
<!ATTLIST class line-rate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST class branch-rate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST class complexity CDATA #REQUIRED>
|
||||||
|
|
||||||
|
<!ELEMENT methods (method*)>
|
||||||
|
|
||||||
|
<!ELEMENT method (lines)>
|
||||||
|
<!ATTLIST method name CDATA #REQUIRED>
|
||||||
|
<!ATTLIST method signature CDATA #REQUIRED>
|
||||||
|
<!ATTLIST method line-rate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST method branch-rate CDATA #REQUIRED>
|
||||||
|
|
||||||
|
<!ELEMENT lines (line*)>
|
||||||
|
|
||||||
|
<!ELEMENT line (conditions*)>
|
||||||
|
<!ATTLIST line number CDATA #REQUIRED>
|
||||||
|
<!ATTLIST line hits CDATA #REQUIRED>
|
||||||
|
<!ATTLIST line branch CDATA "false">
|
||||||
|
<!ATTLIST line condition-coverage CDATA "100%">
|
||||||
|
|
||||||
|
<!ELEMENT conditions (condition*)>
|
||||||
|
|
||||||
|
<!ELEMENT condition EMPTY>
|
||||||
|
<!ATTLIST condition number CDATA #REQUIRED>
|
||||||
|
<!ATTLIST condition type CDATA #REQUIRED>
|
||||||
|
<!ATTLIST condition coverage CDATA #REQUIRED>
|
||||||
@@ -0,0 +1,476 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<coverage branch-rate="NaN" branches-covered="NaN" branches-valid="NaN" complexity="NaN" line-rate="0.3705" lines-covered="103" lines-valid="278" timestamp="1656158672.7938" version="">
|
||||||
|
<sources>
|
||||||
|
<source>/home/runner/work/climatedatastore/climatedatastore/climatedatastoreToolbox/</source>
|
||||||
|
</sources>
|
||||||
|
<packages>
|
||||||
|
<package branch-rate="NaN" complexity="NaN" line-rate="0.3705" name="">
|
||||||
|
<classes>
|
||||||
|
<class branch-rate="NaN" complexity="NaN" filename="climateDataStoreDownload.m" line-rate="0.91667" name="climateDataStoreDownload">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line hits="5" number="42"/>
|
||||||
|
<line hits="5" number="44"/>
|
||||||
|
<line hits="5" number="45"/>
|
||||||
|
<line hits="5" number="46"/>
|
||||||
|
<line hits="0" number="47"/>
|
||||||
|
<line hits="5" number="50"/>
|
||||||
|
<line hits="5" number="51"/>
|
||||||
|
<line hits="5" number="52"/>
|
||||||
|
<line hits="3" number="53"/>
|
||||||
|
<line hits="2" number="55"/>
|
||||||
|
<line hits="2" number="57"/>
|
||||||
|
<line hits="2" number="58"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class branch-rate="NaN" complexity="NaN" filename="climateDataStoreDownloadAsync.m" line-rate="0.8" name="climateDataStoreDownloadAsync">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line hits="5" number="54"/>
|
||||||
|
<line hits="4" number="56"/>
|
||||||
|
<line hits="5" number="57"/>
|
||||||
|
<line hits="0" number="58"/>
|
||||||
|
<line hits="5" number="61"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class branch-rate="NaN" complexity="NaN" filename="climateDataStoreDownloadFuture.m" line-rate="0.86275" name="climateDataStoreDownloadFuture">
|
||||||
|
<methods>
|
||||||
|
<method branch-rate="NaN" line-rate="0.90909" name="climateDataStoreDownloadFuture" signature="obj = climateDataStoreDownloadFuture(datasetName, datasetOptions, options)">
|
||||||
|
<lines>
|
||||||
|
<line hits="10" number="83"/>
|
||||||
|
<line hits="10" number="84"/>
|
||||||
|
<line hits="10" number="85"/>
|
||||||
|
<line hits="10" number="86"/>
|
||||||
|
<line hits="10" number="89"/>
|
||||||
|
<line hits="10" number="99"/>
|
||||||
|
<line hits="10" number="101"/>
|
||||||
|
<line hits="10" number="102"/>
|
||||||
|
<line hits="7" number="103"/>
|
||||||
|
<line hits="3" number="104"/>
|
||||||
|
<line hits="3" number="105"/>
|
||||||
|
<line hits="3" number="106"/>
|
||||||
|
<line hits="3" number="107"/>
|
||||||
|
<line hits="2" number="108"/>
|
||||||
|
<line hits="1" number="109"/>
|
||||||
|
<line hits="1" number="110"/>
|
||||||
|
<line hits="0" number="112"/>
|
||||||
|
<line hits="0" number="115"/>
|
||||||
|
<line hits="3" number="117"/>
|
||||||
|
<line hits="3" number="118"/>
|
||||||
|
<line hits="7" number="122"/>
|
||||||
|
<line hits="7" number="123"/>
|
||||||
|
</lines>
|
||||||
|
</method>
|
||||||
|
<method branch-rate="NaN" line-rate="0.875" name="cancel" signature="cancel(obj)">
|
||||||
|
<lines>
|
||||||
|
<line hits="1" number="131"/>
|
||||||
|
<line hits="0" number="132"/>
|
||||||
|
<line hits="1" number="135"/>
|
||||||
|
<line hits="1" number="136"/>
|
||||||
|
<line hits="1" number="138"/>
|
||||||
|
<line hits="1" number="139"/>
|
||||||
|
<line hits="1" number="140"/>
|
||||||
|
<line hits="1" number="141"/>
|
||||||
|
</lines>
|
||||||
|
</method>
|
||||||
|
<method branch-rate="NaN" line-rate="0.9" name="wait" signature="wait(obj, timeout)">
|
||||||
|
<lines>
|
||||||
|
<line hits="8" number="158"/>
|
||||||
|
<line hits="2" number="159"/>
|
||||||
|
<line hits="6" number="162"/>
|
||||||
|
<line hits="6" number="163"/>
|
||||||
|
<line hits="6" number="164"/>
|
||||||
|
<line hits="2" number="165"/>
|
||||||
|
<line hits="2" number="166"/>
|
||||||
|
<line hits="2" number="167"/>
|
||||||
|
<line hits="6" number="169"/>
|
||||||
|
<line hits="0" number="170"/>
|
||||||
|
</lines>
|
||||||
|
</method>
|
||||||
|
<method branch-rate="NaN" line-rate="1" name="get.OutputArguments" signature="result = get.OutputArguments(obj)">
|
||||||
|
<lines>
|
||||||
|
<line hits="16" number="178"/>
|
||||||
|
<line hits="16" number="179"/>
|
||||||
|
</lines>
|
||||||
|
</method>
|
||||||
|
<method branch-rate="NaN" line-rate="1" name="get.RunningDuration" signature="result = get.RunningDuration(obj)">
|
||||||
|
<lines>
|
||||||
|
<line hits="3" number="183"/>
|
||||||
|
<line hits="3" number="184"/>
|
||||||
|
<line hits="2" number="186"/>
|
||||||
|
<line hits="1" number="189"/>
|
||||||
|
</lines>
|
||||||
|
</method>
|
||||||
|
<method branch-rate="NaN" line-rate="1" name="get.State" signature="result = get.State(obj)">
|
||||||
|
<lines>
|
||||||
|
<line hits="15" number="194"/>
|
||||||
|
<line hits="15" number="195"/>
|
||||||
|
</lines>
|
||||||
|
</method>
|
||||||
|
<method branch-rate="NaN" line-rate="0.5625" name="update" signature="update(obj)">
|
||||||
|
<lines>
|
||||||
|
<line hits="50" number="210"/>
|
||||||
|
<line hits="5" number="211"/>
|
||||||
|
<line hits="45" number="214"/>
|
||||||
|
<line hits="45" number="215"/>
|
||||||
|
<line hits="0" number="216"/>
|
||||||
|
<line hits="0" number="217"/>
|
||||||
|
<line hits="0" number="218"/>
|
||||||
|
<line hits="0" number="219"/>
|
||||||
|
<line hits="0" number="221"/>
|
||||||
|
<line hits="0" number="223"/>
|
||||||
|
<line hits="0" number="224"/>
|
||||||
|
<line hits="45" number="228"/>
|
||||||
|
<line hits="45" number="229"/>
|
||||||
|
<line hits="34" number="230"/>
|
||||||
|
<line hits="11" number="231"/>
|
||||||
|
<line hits="3" number="232"/>
|
||||||
|
</lines>
|
||||||
|
</method>
|
||||||
|
<method branch-rate="NaN" line-rate="1" name="getResultsIfAvailable" signature="getResultsIfAvailable(obj)">
|
||||||
|
<lines>
|
||||||
|
<line hits="34" number="237"/>
|
||||||
|
<line hits="29" number="238"/>
|
||||||
|
<line hits="5" number="243"/>
|
||||||
|
<line hits="5" number="244"/>
|
||||||
|
<line hits="5" number="246"/>
|
||||||
|
<line hits="5" number="247"/>
|
||||||
|
<line hits="5" number="248"/>
|
||||||
|
<line hits="5" number="249"/>
|
||||||
|
<line hits="5" number="252"/>
|
||||||
|
<line hits="5" number="255"/>
|
||||||
|
<line hits="5" number="259"/>
|
||||||
|
<line hits="3" number="261"/>
|
||||||
|
<line hits="3" number="262"/>
|
||||||
|
<line hits="3" number="265"/>
|
||||||
|
<line hits="2" number="268"/>
|
||||||
|
<line hits="2" number="269"/>
|
||||||
|
<line hits="2" number="270"/>
|
||||||
|
<line hits="5" number="272"/>
|
||||||
|
<line hits="5" number="273"/>
|
||||||
|
</lines>
|
||||||
|
</method>
|
||||||
|
<method branch-rate="NaN" line-rate="0.72727" name="getErrorInfo" signature="getErrorInfo(obj)">
|
||||||
|
<lines>
|
||||||
|
<line hits="3" number="278"/>
|
||||||
|
<line hits="2" number="279"/>
|
||||||
|
<line hits="1" number="282"/>
|
||||||
|
<line hits="1" number="293"/>
|
||||||
|
<line hits="1" number="294"/>
|
||||||
|
<line hits="0" number="295"/>
|
||||||
|
<line hits="0" number="296"/>
|
||||||
|
<line hits="0" number="298"/>
|
||||||
|
<line hits="1" number="300"/>
|
||||||
|
<line hits="1" number="301"/>
|
||||||
|
<line hits="1" number="302"/>
|
||||||
|
</lines>
|
||||||
|
</method>
|
||||||
|
<method branch-rate="NaN" line-rate="1" name="makeStringsChars" signature="theStruct = makeStringsChars(theStruct)">
|
||||||
|
<lines>
|
||||||
|
<line hits="10" number="308"/>
|
||||||
|
<line hits="10" number="309"/>
|
||||||
|
<line hits="70" number="310"/>
|
||||||
|
<line hits="70" number="311"/>
|
||||||
|
<line hits="60" number="313"/>
|
||||||
|
<line hits="10" number="316"/>
|
||||||
|
</lines>
|
||||||
|
</method>
|
||||||
|
</methods>
|
||||||
|
<lines>
|
||||||
|
<line hits="10" number="73"/>
|
||||||
|
<line hits="10" number="83"/>
|
||||||
|
<line hits="10" number="84"/>
|
||||||
|
<line hits="10" number="85"/>
|
||||||
|
<line hits="10" number="86"/>
|
||||||
|
<line hits="10" number="89"/>
|
||||||
|
<line hits="10" number="99"/>
|
||||||
|
<line hits="10" number="101"/>
|
||||||
|
<line hits="10" number="102"/>
|
||||||
|
<line hits="7" number="103"/>
|
||||||
|
<line hits="3" number="104"/>
|
||||||
|
<line hits="3" number="105"/>
|
||||||
|
<line hits="3" number="106"/>
|
||||||
|
<line hits="3" number="107"/>
|
||||||
|
<line hits="2" number="108"/>
|
||||||
|
<line hits="1" number="109"/>
|
||||||
|
<line hits="1" number="110"/>
|
||||||
|
<line hits="0" number="112"/>
|
||||||
|
<line hits="0" number="115"/>
|
||||||
|
<line hits="3" number="117"/>
|
||||||
|
<line hits="3" number="118"/>
|
||||||
|
<line hits="7" number="122"/>
|
||||||
|
<line hits="7" number="123"/>
|
||||||
|
<line hits="1" number="131"/>
|
||||||
|
<line hits="0" number="132"/>
|
||||||
|
<line hits="1" number="135"/>
|
||||||
|
<line hits="1" number="136"/>
|
||||||
|
<line hits="1" number="138"/>
|
||||||
|
<line hits="1" number="139"/>
|
||||||
|
<line hits="1" number="140"/>
|
||||||
|
<line hits="1" number="141"/>
|
||||||
|
<line hits="8" number="155"/>
|
||||||
|
<line hits="8" number="158"/>
|
||||||
|
<line hits="2" number="159"/>
|
||||||
|
<line hits="6" number="162"/>
|
||||||
|
<line hits="6" number="163"/>
|
||||||
|
<line hits="6" number="164"/>
|
||||||
|
<line hits="2" number="165"/>
|
||||||
|
<line hits="2" number="166"/>
|
||||||
|
<line hits="2" number="167"/>
|
||||||
|
<line hits="6" number="169"/>
|
||||||
|
<line hits="0" number="170"/>
|
||||||
|
<line hits="16" number="178"/>
|
||||||
|
<line hits="16" number="179"/>
|
||||||
|
<line hits="3" number="183"/>
|
||||||
|
<line hits="3" number="184"/>
|
||||||
|
<line hits="2" number="186"/>
|
||||||
|
<line hits="1" number="189"/>
|
||||||
|
<line hits="15" number="194"/>
|
||||||
|
<line hits="15" number="195"/>
|
||||||
|
<line hits="50" number="210"/>
|
||||||
|
<line hits="5" number="211"/>
|
||||||
|
<line hits="45" number="214"/>
|
||||||
|
<line hits="45" number="215"/>
|
||||||
|
<line hits="0" number="216"/>
|
||||||
|
<line hits="0" number="217"/>
|
||||||
|
<line hits="0" number="218"/>
|
||||||
|
<line hits="0" number="219"/>
|
||||||
|
<line hits="0" number="221"/>
|
||||||
|
<line hits="0" number="223"/>
|
||||||
|
<line hits="0" number="224"/>
|
||||||
|
<line hits="45" number="228"/>
|
||||||
|
<line hits="45" number="229"/>
|
||||||
|
<line hits="34" number="230"/>
|
||||||
|
<line hits="11" number="231"/>
|
||||||
|
<line hits="3" number="232"/>
|
||||||
|
<line hits="34" number="237"/>
|
||||||
|
<line hits="29" number="238"/>
|
||||||
|
<line hits="5" number="243"/>
|
||||||
|
<line hits="5" number="244"/>
|
||||||
|
<line hits="5" number="246"/>
|
||||||
|
<line hits="5" number="247"/>
|
||||||
|
<line hits="5" number="248"/>
|
||||||
|
<line hits="5" number="249"/>
|
||||||
|
<line hits="5" number="252"/>
|
||||||
|
<line hits="5" number="255"/>
|
||||||
|
<line hits="5" number="259"/>
|
||||||
|
<line hits="3" number="261"/>
|
||||||
|
<line hits="3" number="262"/>
|
||||||
|
<line hits="3" number="265"/>
|
||||||
|
<line hits="2" number="268"/>
|
||||||
|
<line hits="2" number="269"/>
|
||||||
|
<line hits="2" number="270"/>
|
||||||
|
<line hits="5" number="272"/>
|
||||||
|
<line hits="5" number="273"/>
|
||||||
|
<line hits="3" number="278"/>
|
||||||
|
<line hits="2" number="279"/>
|
||||||
|
<line hits="1" number="282"/>
|
||||||
|
<line hits="1" number="293"/>
|
||||||
|
<line hits="1" number="294"/>
|
||||||
|
<line hits="0" number="295"/>
|
||||||
|
<line hits="0" number="296"/>
|
||||||
|
<line hits="0" number="298"/>
|
||||||
|
<line hits="1" number="300"/>
|
||||||
|
<line hits="1" number="301"/>
|
||||||
|
<line hits="1" number="302"/>
|
||||||
|
<line hits="10" number="308"/>
|
||||||
|
<line hits="10" number="309"/>
|
||||||
|
<line hits="70" number="310"/>
|
||||||
|
<line hits="70" number="311"/>
|
||||||
|
<line hits="60" number="313"/>
|
||||||
|
<line hits="10" number="316"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class branch-rate="NaN" complexity="NaN" filename="doc/readSatelliteSeaIceThickness.m" line-rate="0" name="readSatelliteSeaIceThickness">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line hits="0" number="4"/>
|
||||||
|
<line hits="0" number="7"/>
|
||||||
|
<line hits="0" number="8"/>
|
||||||
|
<line hits="0" number="9"/>
|
||||||
|
<line hits="0" number="10"/>
|
||||||
|
<line hits="0" number="11"/>
|
||||||
|
<line hits="0" number="12"/>
|
||||||
|
<line hits="0" number="13"/>
|
||||||
|
<line hits="0" number="14"/>
|
||||||
|
<line hits="0" number="15"/>
|
||||||
|
<line hits="0" number="16"/>
|
||||||
|
<line hits="0" number="17"/>
|
||||||
|
<line hits="0" number="18"/>
|
||||||
|
<line hits="0" number="19"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class branch-rate="NaN" complexity="NaN" filename="doc/ComparingIceThickness.mlx" line-rate="0" name="ComparingIceThickness">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line hits="0" number="1"/>
|
||||||
|
<line hits="0" number="2"/>
|
||||||
|
<line hits="0" number="3"/>
|
||||||
|
<line hits="0" number="4"/>
|
||||||
|
<line hits="0" number="5"/>
|
||||||
|
<line hits="0" number="6"/>
|
||||||
|
<line hits="0" number="7"/>
|
||||||
|
<line hits="0" number="8"/>
|
||||||
|
<line hits="0" number="9"/>
|
||||||
|
<line hits="0" number="10"/>
|
||||||
|
<line hits="0" number="11"/>
|
||||||
|
<line hits="0" number="12"/>
|
||||||
|
<line hits="0" number="13"/>
|
||||||
|
<line hits="0" number="14"/>
|
||||||
|
<line hits="0" number="15"/>
|
||||||
|
<line hits="0" number="16"/>
|
||||||
|
<line hits="0" number="17"/>
|
||||||
|
<line hits="0" number="18"/>
|
||||||
|
<line hits="0" number="19"/>
|
||||||
|
<line hits="0" number="21"/>
|
||||||
|
<line hits="0" number="22"/>
|
||||||
|
<line hits="0" number="23"/>
|
||||||
|
<line hits="0" number="24"/>
|
||||||
|
<line hits="0" number="25"/>
|
||||||
|
<line hits="0" number="26"/>
|
||||||
|
<line hits="0" number="27"/>
|
||||||
|
<line hits="0" number="28"/>
|
||||||
|
<line hits="0" number="29"/>
|
||||||
|
<line hits="0" number="30"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class branch-rate="NaN" complexity="NaN" filename="doc/GettingStarted.mlx" line-rate="0" name="GettingStarted">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line hits="0" number="1"/>
|
||||||
|
<line hits="0" number="2"/>
|
||||||
|
<line hits="0" number="3"/>
|
||||||
|
<line hits="0" number="4"/>
|
||||||
|
<line hits="0" number="5"/>
|
||||||
|
<line hits="0" number="6"/>
|
||||||
|
<line hits="0" number="7"/>
|
||||||
|
<line hits="0" number="8"/>
|
||||||
|
<line hits="0" number="9"/>
|
||||||
|
<line hits="0" number="10"/>
|
||||||
|
<line hits="0" number="11"/>
|
||||||
|
<line hits="0" number="12"/>
|
||||||
|
<line hits="0" number="13"/>
|
||||||
|
<line hits="0" number="14"/>
|
||||||
|
<line hits="0" number="15"/>
|
||||||
|
<line hits="0" number="16"/>
|
||||||
|
<line hits="0" number="17"/>
|
||||||
|
<line hits="0" number="19"/>
|
||||||
|
<line hits="0" number="20"/>
|
||||||
|
<line hits="0" number="21"/>
|
||||||
|
<line hits="0" number="22"/>
|
||||||
|
<line hits="0" number="23"/>
|
||||||
|
<line hits="0" number="24"/>
|
||||||
|
<line hits="0" number="25"/>
|
||||||
|
<line hits="0" number="26"/>
|
||||||
|
<line hits="0" number="27"/>
|
||||||
|
<line hits="0" number="28"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class branch-rate="NaN" complexity="NaN" filename="util/getUserDirectory.m" line-rate="0" name="getUserDirectory">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line hits="0" number="5"/>
|
||||||
|
<line hits="0" number="6"/>
|
||||||
|
<line hits="0" number="7"/>
|
||||||
|
<line hits="0" number="9"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class branch-rate="NaN" complexity="NaN" filename="util/setupCDSAPIIfNeeded.m" line-rate="0" name="setupCDSAPIIfNeeded">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line hits="0" number="8"/>
|
||||||
|
<line hits="0" number="10"/>
|
||||||
|
<line hits="0" number="12"/>
|
||||||
|
<line hits="0" number="14"/>
|
||||||
|
<line hits="0" number="18"/>
|
||||||
|
<line hits="0" number="19"/>
|
||||||
|
<line hits="0" number="21"/>
|
||||||
|
<line hits="0" number="22"/>
|
||||||
|
<line hits="0" number="23"/>
|
||||||
|
<line hits="0" number="28"/>
|
||||||
|
<line hits="0" number="30"/>
|
||||||
|
<line hits="0" number="32"/>
|
||||||
|
<line hits="0" number="33"/>
|
||||||
|
<line hits="0" number="35"/>
|
||||||
|
<line hits="0" number="36"/>
|
||||||
|
<line hits="0" number="37"/>
|
||||||
|
<line hits="0" number="38"/>
|
||||||
|
<line hits="0" number="39"/>
|
||||||
|
<line hits="0" number="42"/>
|
||||||
|
<line hits="0" number="43"/>
|
||||||
|
<line hits="0" number="46"/>
|
||||||
|
<line hits="0" number="47"/>
|
||||||
|
<line hits="0" number="50"/>
|
||||||
|
<line hits="0" number="51"/>
|
||||||
|
<line hits="0" number="52"/>
|
||||||
|
<line hits="0" number="53"/>
|
||||||
|
<line hits="0" number="55"/>
|
||||||
|
<line hits="0" number="56"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class branch-rate="NaN" complexity="NaN" filename="util/setupPythonIfNeeded.m" line-rate="0" name="setupPythonIfNeeded">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line hits="0" number="8"/>
|
||||||
|
<line hits="0" number="9"/>
|
||||||
|
<line hits="0" number="13"/>
|
||||||
|
<line hits="0" number="15"/>
|
||||||
|
<line hits="0" number="17"/>
|
||||||
|
<line hits="0" number="22"/>
|
||||||
|
<line hits="0" number="25"/>
|
||||||
|
<line hits="0" number="27"/>
|
||||||
|
<line hits="0" number="29"/>
|
||||||
|
<line hits="0" number="31"/>
|
||||||
|
<line hits="0" number="34"/>
|
||||||
|
<line hits="0" number="35"/>
|
||||||
|
<line hits="0" number="36"/>
|
||||||
|
<line hits="0" number="37"/>
|
||||||
|
<line hits="0" number="38"/>
|
||||||
|
<line hits="0" number="39"/>
|
||||||
|
<line hits="0" number="41"/>
|
||||||
|
<line hits="0" number="42"/>
|
||||||
|
<line hits="0" number="43"/>
|
||||||
|
<line hits="0" number="44"/>
|
||||||
|
<line hits="0" number="45"/>
|
||||||
|
<line hits="0" number="51"/>
|
||||||
|
<line hits="0" number="53"/>
|
||||||
|
<line hits="0" number="55"/>
|
||||||
|
<line hits="0" number="63"/>
|
||||||
|
<line hits="0" number="64"/>
|
||||||
|
<line hits="0" number="65"/>
|
||||||
|
<line hits="0" number="66"/>
|
||||||
|
<line hits="0" number="67"/>
|
||||||
|
<line hits="0" number="68"/>
|
||||||
|
<line hits="0" number="69"/>
|
||||||
|
<line hits="0" number="70"/>
|
||||||
|
<line hits="0" number="71"/>
|
||||||
|
<line hits="0" number="72"/>
|
||||||
|
<line hits="0" number="73"/>
|
||||||
|
<line hits="0" number="74"/>
|
||||||
|
<line hits="0" number="75"/>
|
||||||
|
<line hits="0" number="76"/>
|
||||||
|
<line hits="0" number="77"/>
|
||||||
|
<line hits="0" number="80"/>
|
||||||
|
<line hits="0" number="85"/>
|
||||||
|
<line hits="0" number="86"/>
|
||||||
|
<line hits="0" number="87"/>
|
||||||
|
<line hits="0" number="89"/>
|
||||||
|
<line hits="0" number="90"/>
|
||||||
|
<line hits="0" number="95"/>
|
||||||
|
<line hits="0" number="96"/>
|
||||||
|
<line hits="0" number="97"/>
|
||||||
|
<line hits="0" number="99"/>
|
||||||
|
<line hits="0" number="100"/>
|
||||||
|
<line hits="0" number="106"/>
|
||||||
|
<line hits="0" number="107"/>
|
||||||
|
<line hits="0" number="108"/>
|
||||||
|
<line hits="0" number="109"/>
|
||||||
|
<line hits="0" number="112"/>
|
||||||
|
<line hits="0" number="113"/>
|
||||||
|
<line hits="0" number="114"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
</classes>
|
||||||
|
</package>
|
||||||
|
</packages>
|
||||||
|
</coverage>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,441 @@
|
|||||||
|
<?xml version='1.0'?>
|
||||||
|
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
|
||||||
|
<!-- Generated by simplecov-cobertura version 2.1.0 (https://github.com/dashingrocket/simplecov-cobertura) -->
|
||||||
|
<coverage line-rate="0.97" lines-covered="350" lines-valid="362" complexity="0" version="0" timestamp="1645060052">
|
||||||
|
<sources>
|
||||||
|
<source>/Users/pboling/src/my/oauth2</source>
|
||||||
|
</sources>
|
||||||
|
<packages>
|
||||||
|
<package name="oauth2" line-rate="0.97" complexity="0">
|
||||||
|
<classes>
|
||||||
|
<class name="oauth2" filename="lib/oauth2.rb" line-rate="1.0" complexity="0">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line number="1" hits="1"/>
|
||||||
|
<line number="2" hits="1"/>
|
||||||
|
<line number="3" hits="1"/>
|
||||||
|
<line number="4" hits="1"/>
|
||||||
|
<line number="5" hits="1"/>
|
||||||
|
<line number="6" hits="1"/>
|
||||||
|
<line number="7" hits="1"/>
|
||||||
|
<line number="8" hits="1"/>
|
||||||
|
<line number="9" hits="1"/>
|
||||||
|
<line number="10" hits="1"/>
|
||||||
|
<line number="11" hits="1"/>
|
||||||
|
<line number="12" hits="1"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class name="access_token" filename="lib/oauth2/access_token.rb" line-rate="0.96" complexity="0">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line number="1" hits="1"/>
|
||||||
|
<line number="2" hits="1"/>
|
||||||
|
<line number="3" hits="1"/>
|
||||||
|
<line number="4" hits="1"/>
|
||||||
|
<line number="7" hits="1"/>
|
||||||
|
<line number="13" hits="1"/>
|
||||||
|
<line number="14" hits="7"/>
|
||||||
|
<line number="15" hits="7"/>
|
||||||
|
<line number="23" hits="1"/>
|
||||||
|
<line number="24" hits="1"/>
|
||||||
|
<line number="41" hits="1"/>
|
||||||
|
<line number="42" hits="151"/>
|
||||||
|
<line number="43" hits="151"/>
|
||||||
|
<line number="44" hits="151"/>
|
||||||
|
<line number="45" hits="151"/>
|
||||||
|
<line number="46" hits="453"/>
|
||||||
|
<line number="48" hits="151"/>
|
||||||
|
<line number="49" hits="151"/>
|
||||||
|
<line number="50" hits="151"/>
|
||||||
|
<line number="51" hits="151"/>
|
||||||
|
<line number="52" hits="151"/>
|
||||||
|
<line number="55" hits="151"/>
|
||||||
|
<line number="61" hits="1"/>
|
||||||
|
<line number="62" hits="6"/>
|
||||||
|
<line number="68" hits="1"/>
|
||||||
|
<line number="69" hits="11"/>
|
||||||
|
<line number="75" hits="1"/>
|
||||||
|
<line number="76" hits="3"/>
|
||||||
|
<line number="83" hits="1"/>
|
||||||
|
<line number="84" hits="2"/>
|
||||||
|
<line number="86" hits="2"/>
|
||||||
|
<line number="87" hits="2"/>
|
||||||
|
<line number="88" hits="2"/>
|
||||||
|
<line number="89" hits="2"/>
|
||||||
|
<line number="90" hits="2"/>
|
||||||
|
<line number="91" hits="2"/>
|
||||||
|
<line number="97" hits="1"/>
|
||||||
|
<line number="98" hits="1"/>
|
||||||
|
<line number="107" hits="1"/>
|
||||||
|
<line number="108" hits="20"/>
|
||||||
|
<line number="109" hits="20"/>
|
||||||
|
<line number="115" hits="1"/>
|
||||||
|
<line number="116" hits="2"/>
|
||||||
|
<line number="122" hits="1"/>
|
||||||
|
<line number="123" hits="18"/>
|
||||||
|
<line number="129" hits="1"/>
|
||||||
|
<line number="130" hits="2"/>
|
||||||
|
<line number="136" hits="1"/>
|
||||||
|
<line number="137" hits="0"/>
|
||||||
|
<line number="143" hits="1"/>
|
||||||
|
<line number="144" hits="2"/>
|
||||||
|
<line number="148" hits="1"/>
|
||||||
|
<line number="149" hits="8"/>
|
||||||
|
<line number="152" hits="1"/>
|
||||||
|
<line number="154" hits="1"/>
|
||||||
|
<line number="155" hits="20"/>
|
||||||
|
<line number="157" hits="8"/>
|
||||||
|
<line number="158" hits="8"/>
|
||||||
|
<line number="160" hits="8"/>
|
||||||
|
<line number="161" hits="8"/>
|
||||||
|
<line number="163" hits="4"/>
|
||||||
|
<line number="164" hits="4"/>
|
||||||
|
<line number="165" hits="4"/>
|
||||||
|
<line number="167" hits="0"/>
|
||||||
|
<line number="171" hits="0"/>
|
||||||
|
<line number="175" hits="1"/>
|
||||||
|
<line number="176" hits="13"/>
|
||||||
|
<line number="178" hits="12"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class name="authenticator" filename="lib/oauth2/authenticator.rb" line-rate="1.0" complexity="0">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line number="1" hits="1"/>
|
||||||
|
<line number="3" hits="1"/>
|
||||||
|
<line number="4" hits="1"/>
|
||||||
|
<line number="5" hits="1"/>
|
||||||
|
<line number="7" hits="1"/>
|
||||||
|
<line number="8" hits="106"/>
|
||||||
|
<line number="9" hits="106"/>
|
||||||
|
<line number="10" hits="106"/>
|
||||||
|
<line number="22" hits="1"/>
|
||||||
|
<line number="23" hits="106"/>
|
||||||
|
<line number="25" hits="14"/>
|
||||||
|
<line number="27" hits="89"/>
|
||||||
|
<line number="29" hits="1"/>
|
||||||
|
<line number="31" hits="1"/>
|
||||||
|
<line number="33" hits="1"/>
|
||||||
|
<line number="37" hits="1"/>
|
||||||
|
<line number="38" hits="15"/>
|
||||||
|
<line number="41" hits="1"/>
|
||||||
|
<line number="45" hits="1"/>
|
||||||
|
<line number="46" hits="89"/>
|
||||||
|
<line number="51" hits="1"/>
|
||||||
|
<line number="52" hits="1"/>
|
||||||
|
<line number="57" hits="1"/>
|
||||||
|
<line number="58" hits="14"/>
|
||||||
|
<line number="59" hits="14"/>
|
||||||
|
<line number="60" hits="14"/>
|
||||||
|
<line number="64" hits="1"/>
|
||||||
|
<line number="65" hits="14"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class name="client" filename="lib/oauth2/client.rb" line-rate="0.95" complexity="0">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line number="1" hits="1"/>
|
||||||
|
<line number="2" hits="1"/>
|
||||||
|
<line number="4" hits="1"/>
|
||||||
|
<line number="6" hits="1"/>
|
||||||
|
<line number="7" hits="1"/>
|
||||||
|
<line number="9" hits="1"/>
|
||||||
|
<line number="10" hits="1"/>
|
||||||
|
<line number="11" hits="1"/>
|
||||||
|
<line number="31" hits="1"/>
|
||||||
|
<line number="32" hits="204"/>
|
||||||
|
<line number="33" hits="204"/>
|
||||||
|
<line number="34" hits="204"/>
|
||||||
|
<line number="35" hits="204"/>
|
||||||
|
<line number="36" hits="204"/>
|
||||||
|
<line number="39" hits="204"/>
|
||||||
|
<line number="49" hits="204"/>
|
||||||
|
<line number="55" hits="1"/>
|
||||||
|
<line number="56" hits="0"/>
|
||||||
|
<line number="57" hits="0"/>
|
||||||
|
<line number="61" hits="1"/>
|
||||||
|
<line number="62" hits="423"/>
|
||||||
|
<line number="63" hits="158"/>
|
||||||
|
<line number="64" hits="158"/>
|
||||||
|
<line number="65" hits="134"/>
|
||||||
|
<line number="66" hits="134"/>
|
||||||
|
<line number="69" hits="158"/>
|
||||||
|
<line number="76" hits="1"/>
|
||||||
|
<line number="77" hits="11"/>
|
||||||
|
<line number="78" hits="11"/>
|
||||||
|
<line number="84" hits="1"/>
|
||||||
|
<line number="85" hits="100"/>
|
||||||
|
<line number="100" hits="1"/>
|
||||||
|
<line number="101" hits="141"/>
|
||||||
|
<line number="103" hits="141"/>
|
||||||
|
<line number="105" hits="141"/>
|
||||||
|
<line number="106" hits="141"/>
|
||||||
|
<line number="107" hits="141"/>
|
||||||
|
<line number="109" hits="141"/>
|
||||||
|
<line number="111" hits="141"/>
|
||||||
|
<line number="113" hits="3"/>
|
||||||
|
<line number="114" hits="3"/>
|
||||||
|
<line number="115" hits="3"/>
|
||||||
|
<line number="117" hits="2"/>
|
||||||
|
<line number="118" hits="1"/>
|
||||||
|
<line number="119" hits="1"/>
|
||||||
|
<line number="121" hits="2"/>
|
||||||
|
<line number="124" hits="127"/>
|
||||||
|
<line number="126" hits="11"/>
|
||||||
|
<line number="127" hits="11"/>
|
||||||
|
<line number="129" hits="2"/>
|
||||||
|
<line number="130" hits="2"/>
|
||||||
|
<line number="132" hits="0"/>
|
||||||
|
<line number="133" hits="0"/>
|
||||||
|
<line number="143" hits="1"/>
|
||||||
|
<line number="144" hits="97"/>
|
||||||
|
<line number="145" hits="182"/>
|
||||||
|
<line number="146" hits="2"/>
|
||||||
|
<line number="148" hits="180"/>
|
||||||
|
<line number="151" hits="97"/>
|
||||||
|
<line number="153" hits="97"/>
|
||||||
|
<line number="154" hits="97"/>
|
||||||
|
<line number="155" hits="97"/>
|
||||||
|
<line number="156" hits="97"/>
|
||||||
|
<line number="157" hits="79"/>
|
||||||
|
<line number="158" hits="79"/>
|
||||||
|
<line number="160" hits="18"/>
|
||||||
|
<line number="161" hits="18"/>
|
||||||
|
<line number="163" hits="97"/>
|
||||||
|
<line number="164" hits="97"/>
|
||||||
|
<line number="167" hits="97"/>
|
||||||
|
<line number="169" hits="0"/>
|
||||||
|
<line number="172" hits="97"/>
|
||||||
|
<line number="173" hits="3"/>
|
||||||
|
<line number="174" hits="3"/>
|
||||||
|
<line number="176" hits="94"/>
|
||||||
|
<line number="182" hits="1"/>
|
||||||
|
<line number="183" hits="48"/>
|
||||||
|
<line number="189" hits="1"/>
|
||||||
|
<line number="190" hits="5"/>
|
||||||
|
<line number="196" hits="1"/>
|
||||||
|
<line number="197" hits="11"/>
|
||||||
|
<line number="203" hits="1"/>
|
||||||
|
<line number="204" hits="21"/>
|
||||||
|
<line number="207" hits="1"/>
|
||||||
|
<line number="208" hits="9"/>
|
||||||
|
<line number="227" hits="1"/>
|
||||||
|
<line number="228" hits="55"/>
|
||||||
|
<line number="229" hits="2"/>
|
||||||
|
<line number="231" hits="53"/>
|
||||||
|
<line number="235" hits="1"/>
|
||||||
|
<line number="236" hits="91"/>
|
||||||
|
<line number="237" hits="91"/>
|
||||||
|
<line number="240" hits="1"/>
|
||||||
|
<line number="242" hits="1"/>
|
||||||
|
<line number="243" hits="97"/>
|
||||||
|
<line number="244" hits="97"/>
|
||||||
|
<line number="246" hits="93"/>
|
||||||
|
<line number="250" hits="93"/>
|
||||||
|
<line number="251" hits="1"/>
|
||||||
|
<line number="253" hits="92"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class name="error" filename="lib/oauth2/error.rb" line-rate="1.0" complexity="0">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line number="1" hits="1"/>
|
||||||
|
<line number="2" hits="1"/>
|
||||||
|
<line number="3" hits="1"/>
|
||||||
|
<line number="7" hits="1"/>
|
||||||
|
<line number="8" hits="14"/>
|
||||||
|
<line number="9" hits="14"/>
|
||||||
|
<line number="11" hits="14"/>
|
||||||
|
<line number="12" hits="7"/>
|
||||||
|
<line number="13" hits="7"/>
|
||||||
|
<line number="14" hits="7"/>
|
||||||
|
<line number="17" hits="14"/>
|
||||||
|
<line number="23" hits="1"/>
|
||||||
|
<line number="24" hits="14"/>
|
||||||
|
<line number="26" hits="14"/>
|
||||||
|
<line number="28" hits="14"/>
|
||||||
|
<line number="29" hits="7"/>
|
||||||
|
<line number="30" hits="7"/>
|
||||||
|
<line number="32" hits="7"/>
|
||||||
|
<line number="35" hits="14"/>
|
||||||
|
<line number="37" hits="14"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class name="mac_token" filename="lib/oauth2/mac_token.rb" line-rate="0.95" complexity="0">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line number="1" hits="1"/>
|
||||||
|
<line number="2" hits="1"/>
|
||||||
|
<line number="3" hits="1"/>
|
||||||
|
<line number="4" hits="1"/>
|
||||||
|
<line number="6" hits="1"/>
|
||||||
|
<line number="7" hits="1"/>
|
||||||
|
<line number="14" hits="1"/>
|
||||||
|
<line number="15" hits="3"/>
|
||||||
|
<line number="18" hits="1"/>
|
||||||
|
<line number="30" hits="1"/>
|
||||||
|
<line number="31" hits="19"/>
|
||||||
|
<line number="32" hits="19"/>
|
||||||
|
<line number="34" hits="18"/>
|
||||||
|
<line number="43" hits="1"/>
|
||||||
|
<line number="44" hits="4"/>
|
||||||
|
<line number="46" hits="4"/>
|
||||||
|
<line number="47" hits="4"/>
|
||||||
|
<line number="49" hits="4"/>
|
||||||
|
<line number="53" hits="1"/>
|
||||||
|
<line number="54" hits="1"/>
|
||||||
|
<line number="61" hits="1"/>
|
||||||
|
<line number="62" hits="9"/>
|
||||||
|
<line number="63" hits="9"/>
|
||||||
|
<line number="65" hits="9"/>
|
||||||
|
<line number="67" hits="8"/>
|
||||||
|
<line number="69" hits="7"/>
|
||||||
|
<line number="71" hits="7"/>
|
||||||
|
<line number="80" hits="1"/>
|
||||||
|
<line number="82" hits="8"/>
|
||||||
|
<line number="91" hits="8"/>
|
||||||
|
<line number="97" hits="1"/>
|
||||||
|
<line number="98" hits="19"/>
|
||||||
|
<line number="101" hits="1"/>
|
||||||
|
<line number="103" hits="0"/>
|
||||||
|
<line number="107" hits="17"/>
|
||||||
|
<line number="109" hits="0"/>
|
||||||
|
<line number="112" hits="1"/>
|
||||||
|
<line number="116" hits="1"/>
|
||||||
|
<line number="120" hits="1"/>
|
||||||
|
<line number="124" hits="1"/>
|
||||||
|
<line number="125" hits="8"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class name="response" filename="lib/oauth2/response.rb" line-rate="1.0" complexity="0">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line number="1" hits="1"/>
|
||||||
|
<line number="2" hits="1"/>
|
||||||
|
<line number="3" hits="1"/>
|
||||||
|
<line number="5" hits="1"/>
|
||||||
|
<line number="7" hits="1"/>
|
||||||
|
<line number="8" hits="1"/>
|
||||||
|
<line number="9" hits="1"/>
|
||||||
|
<line number="14" hits="62"/>
|
||||||
|
<line number="15" hits="44"/>
|
||||||
|
<line number="16" hits="3"/>
|
||||||
|
<line number="20" hits="1"/>
|
||||||
|
<line number="32" hits="1"/>
|
||||||
|
<line number="33" hits="3"/>
|
||||||
|
<line number="34" hits="3"/>
|
||||||
|
<line number="35" hits="3"/>
|
||||||
|
<line number="36" hits="6"/>
|
||||||
|
<line number="46" hits="1"/>
|
||||||
|
<line number="47" hits="147"/>
|
||||||
|
<line number="48" hits="147"/>
|
||||||
|
<line number="52" hits="1"/>
|
||||||
|
<line number="53" hits="6"/>
|
||||||
|
<line number="57" hits="1"/>
|
||||||
|
<line number="58" hits="150"/>
|
||||||
|
<line number="62" hits="1"/>
|
||||||
|
<line number="63" hits="154"/>
|
||||||
|
<line number="69" hits="1"/>
|
||||||
|
<line number="70" hits="134"/>
|
||||||
|
<line number="72" hits="131"/>
|
||||||
|
<line number="76" hits="1"/>
|
||||||
|
<line number="77" hits="244"/>
|
||||||
|
<line number="81" hits="1"/>
|
||||||
|
<line number="82" hits="244"/>
|
||||||
|
<line number="84" hits="244"/>
|
||||||
|
<line number="89" hits="1"/>
|
||||||
|
<line number="90" hits="1"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class name="assertion" filename="lib/oauth2/strategy/assertion.rb" line-rate="0.89" complexity="0">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line number="1" hits="1"/>
|
||||||
|
<line number="3" hits="1"/>
|
||||||
|
<line number="4" hits="1"/>
|
||||||
|
<line number="23" hits="1"/>
|
||||||
|
<line number="27" hits="1"/>
|
||||||
|
<line number="28" hits="1"/>
|
||||||
|
<line number="45" hits="1"/>
|
||||||
|
<line number="46" hits="8"/>
|
||||||
|
<line number="47" hits="8"/>
|
||||||
|
<line number="50" hits="1"/>
|
||||||
|
<line number="51" hits="8"/>
|
||||||
|
<line number="53" hits="8"/>
|
||||||
|
<line number="60" hits="1"/>
|
||||||
|
<line number="62" hits="8"/>
|
||||||
|
<line number="67" hits="8"/>
|
||||||
|
<line number="68" hits="8"/>
|
||||||
|
<line number="69" hits="0"/>
|
||||||
|
<line number="70" hits="0"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class name="auth_code" filename="lib/oauth2/strategy/auth_code.rb" line-rate="1.0" complexity="0">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line number="1" hits="1"/>
|
||||||
|
<line number="2" hits="1"/>
|
||||||
|
<line number="6" hits="1"/>
|
||||||
|
<line number="10" hits="1"/>
|
||||||
|
<line number="11" hits="3"/>
|
||||||
|
<line number="17" hits="1"/>
|
||||||
|
<line number="18" hits="3"/>
|
||||||
|
<line number="27" hits="1"/>
|
||||||
|
<line number="28" hits="44"/>
|
||||||
|
<line number="30" hits="44"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class name="base" filename="lib/oauth2/strategy/base.rb" line-rate="1.0" complexity="0">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line number="1" hits="1"/>
|
||||||
|
<line number="2" hits="1"/>
|
||||||
|
<line number="3" hits="1"/>
|
||||||
|
<line number="4" hits="1"/>
|
||||||
|
<line number="5" hits="95"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class name="client_credentials" filename="lib/oauth2/strategy/client_credentials.rb" line-rate="1.0" complexity="0">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line number="1" hits="1"/>
|
||||||
|
<line number="2" hits="1"/>
|
||||||
|
<line number="6" hits="1"/>
|
||||||
|
<line number="10" hits="1"/>
|
||||||
|
<line number="11" hits="1"/>
|
||||||
|
<line number="18" hits="1"/>
|
||||||
|
<line number="19" hits="20"/>
|
||||||
|
<line number="20" hits="20"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class name="implicit" filename="lib/oauth2/strategy/implicit.rb" line-rate="1.0" complexity="0">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line number="1" hits="1"/>
|
||||||
|
<line number="2" hits="1"/>
|
||||||
|
<line number="6" hits="1"/>
|
||||||
|
<line number="10" hits="1"/>
|
||||||
|
<line number="11" hits="3"/>
|
||||||
|
<line number="17" hits="1"/>
|
||||||
|
<line number="18" hits="3"/>
|
||||||
|
<line number="24" hits="1"/>
|
||||||
|
<line number="25" hits="1"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
<class name="password" filename="lib/oauth2/strategy/password.rb" line-rate="1.0" complexity="0">
|
||||||
|
<methods/>
|
||||||
|
<lines>
|
||||||
|
<line number="1" hits="1"/>
|
||||||
|
<line number="2" hits="1"/>
|
||||||
|
<line number="6" hits="1"/>
|
||||||
|
<line number="10" hits="1"/>
|
||||||
|
<line number="11" hits="1"/>
|
||||||
|
<line number="19" hits="1"/>
|
||||||
|
<line number="20" hits="10"/>
|
||||||
|
<line number="23" hits="10"/>
|
||||||
|
</lines>
|
||||||
|
</class>
|
||||||
|
</classes>
|
||||||
|
</package>
|
||||||
|
</packages>
|
||||||
|
</coverage>
|
||||||
Reference in New Issue
Block a user