Skip to content

Commit a182a8b

Browse files
committed
Coax codecov into cooperating, fixes #5332
Additionally make codecoverage status work on informational level. See necessity for fix described at OpenCover/opencover#914
1 parent fbcce0d commit a182a8b

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed

appveyor.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,15 @@ dotnet_csproj:
5050
version: '{version}'
5151
assembly_version: '{version}'
5252

53+
# set up the environment variables used later in the build process
54+
environment:
55+
installer_dir: Rubberduck.Deployment\InnoSetup\Installers\
56+
codecov_token:
57+
secure: WXzsqA7du+xTCQN0p06UFYOe94bKkB1ZtyCWS0Xlsu7OwIwKIa/OPaHj8Yev1JGl
5358

5459
before_build:
5560
- development/java/Rubberduck.Parsing/Grammar/gradlew.bat -p development/java/Rubberduck.Parsing/Grammar clean build
5661
- cinst innosetup -version 5.6.1
57-
- cinst codecov
5862
- cinst opencover.portable
5963
- nuget restore RubberduckMeta.sln
6064
- nuget restore Rubberduck.sln
@@ -66,14 +70,15 @@ build:
6670
# Otherwise we might run tests against artifacts that do not exist
6771
test_script:
6872
# we use -returntargetcode to fail the build if tests fail
69-
- cmd: OpenCover.Console.exe -register:user -returntargetcode -target:"nunit3-console.exe" -targetargs:".\RubberduckTests\bin\RubberduckTests.dll" -output:".\Rubberduck_Coverage.xml"
70-
- cmd: OpenCover.Console.exe -register:user -returntargetcode -target:"nunit3-console.exe" -targetargs:".\RubberduckTestsCodeAnalysis\bin\RubberduckTestsCodeAnalysis.dll" -output:".\RubberduckCodeAnalysis_Coverage.xml"
7173
# when using test_script, after_test seems to not be executed
72-
- cmd: codecov -f "Rubberduck_Coverage.xml RubberduckCodeAnalysis_Coverage.xml"
74+
# Manually select coverage instrumentation using "-register:Path64" to fix coverage generation
75+
- |
76+
OpenCover.Console.exe -register:Path64 -returntargetcode -target:"nunit3-console.exe" -targetargs:".\RubberduckTests\bin\RubberduckTests.dll" -output:".\Rubberduck_Coverage.xml"
77+
OpenCover.Console.exe -register:Path64 -returntargetcode -target:"nunit3-console.exe" -targetargs:".\RubberduckTestsCodeAnalysis\bin\RubberduckTestsCodeAnalysis.dll" -output:".\RubberduckCodeAnalysis_Coverage.xml"
78+
curl --silent https://codecov.io/bash --output codecov
79+
bash codecov -f Rubberduck_Coverage.xml -f RubberduckCodeAnalysis_Coverage.xml
7380
7481
# Define the installer-name depending on what branch we're building on
75-
environment:
76-
installer_dir: Rubberduck.Deployment\InnoSetup\Installers\
7782
for:
7883
-
7984
branches:
@@ -116,6 +121,10 @@ artifacts:
116121
name: InspectionDocs
117122
- path: Rubberduck.Deployment\InnoSetup\Installers\*.hash
118123
name: InstallerHashes
124+
- path: Rubberduck_Coverage.xml
125+
name: MainCoverage
126+
- path: RubberduckCodeAnalysis_Coverage.xml
127+
name: AnalysisCoverage
119128
deploy:
120129
- provider: GitHub
121130
tag: RETAGMEWITHAMESSAGE

codecov.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
codecov:
2-
branch: next
3-
ci:
4-
- appveyor
52
max_report_age: off
63

74
ignore:
@@ -19,8 +16,15 @@ coverage:
1916
precision: 2
2017
range: 40..80
2118
status:
22-
# don't check patch coverage
23-
patch: off
19+
# don't block mindlessly on coverage failures
20+
informational: true
21+
# status information for PRs only
22+
only_pulls: true
23+
patch:
24+
default:
25+
# strongly suggest more than 60% of changes be covered
26+
target: 60
27+
threshold: 10
2428
project:
2529
default:
2630
target: 0 # don't force a minimum coverage
@@ -31,4 +35,6 @@ coverage:
3135
comment:
3236
layout: "flags, diff, files"
3337
behavior: once
34-
require_changes: yes
38+
require_head: no
39+
require_base: no
40+

0 commit comments

Comments
 (0)