Skip to content

Commit 0e39ab9

Browse files
author
Jimmy Byrd
committed
Don't run code coverage
altcover is having some issues with this project
1 parent 5baab1c commit 0e39ab9

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

.paket/Paket.Restore.targets

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,10 @@
252252
</PropertyGroup>
253253

254254
<ItemGroup>
255-
<_NuspecFiles Include="$(AdjustedNuspecOutputPath)\*.$(PackageVersion.Split(`+`)[0]).nuspec"/>
255+
<_NuspecFiles Include="$(AdjustedNuspecOutputPath)\*.$(PackageVersion).nuspec"/>
256256
</ItemGroup>
257257

258-
<Exec Condition="@(_NuspecFiles) != ''" Command='$(PaketCommand) fix-nuspecs files "@(_NuspecFiles)" project-file "$(PaketProjectFile)" ' />
259-
<Error Condition="@(_NuspecFiles) == ''" Text='Could not find nuspec files in "$(AdjustedNuspecOutputPath)" (Version: "$(PackageVersion)"), therefore we cannot call "paket fix-nuspecs" and have to error out!' />
258+
<Exec Command='$(PaketCommand) fix-nuspecs files "@(_NuspecFiles)" project-file "$(PaketProjectFile)" ' Condition="@(_NuspecFiles) != ''" />
260259

261260
<ConvertToAbsolutePath Condition="@(_NuspecFiles) != ''" Paths="@(_NuspecFiles)">
262261
<Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" />

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ $ ./build.sh // on unix
5959
* `CONFIGURATION=Debug ./build.sh` will result in things like `dotnet build -c Debug`
6060
* `GITHUB_TOKEN` will be used to upload release notes and nuget packages to github.
6161
* Be sure to set this before releasing
62+
- `DISABLE_COVERAGE` Will disable running code coverage metrics. AltCover can have [severe performance degradation](https://github.com/SteveGilham/altcover/issues/57) so it worth disabling when looking to do a quicker feedback loop.
63+
- `DISABLE_COVERAGE=1 ./build.sh`
6264

6365
### Watch Tests
6466

build.fsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ BuildServer.install [
2020
Travis.Installer
2121
]
2222

23+
let environVarAsBoolOrDefault varName defaultValue =
24+
let truthyConsts = [
25+
"1"
26+
"Y"
27+
"YES"
28+
"T"
29+
"TRUE"
30+
]
31+
try
32+
let envvar = (Environment.environVar varName).ToUpper()
33+
truthyConsts |> List.exists((=)envvar)
34+
with
35+
| _ -> defaultValue
36+
2337
//-----------------------------------------------------------------------------
2438
// Metadata and Configuration
2539
//-----------------------------------------------------------------------------
@@ -52,6 +66,9 @@ let publishUrl = "https://www.nuget.org"
5266

5367
let paketToolPath = __SOURCE_DIRECTORY__ </> ".paket" </> (if Environment.isWindows then "paket.exe" else "paket")
5468

69+
70+
let disableCodeCoverage = environVarAsBoolOrDefault "DISABLE_COVERAGE" false
71+
5572
//-----------------------------------------------------------------------------
5673
// Helpers
5774
//-----------------------------------------------------------------------------
@@ -172,7 +189,7 @@ let dotnetTest ctx =
172189
let args =
173190
[
174191
"--no-build"
175-
"/p:AltCover=false"
192+
sprintf "/p:AltCover=%b" (not disableCodeCoverage)
176193
sprintf "/p:AltCoverThreshold=%d" coverageThresholdPercent
177194
sprintf "/p:AltCoverAssemblyExcludeFilter=%s" excludeCoverage
178195
]
@@ -370,7 +387,7 @@ Target.create "Release" ignore
370387
"DotnetRestore"
371388
==> "DotnetBuild"
372389
==> "DotnetTest"
373-
==> "GenerateCoverageReport"
390+
=?> ("GenerateCoverageReport", not disableCodeCoverage)
374391
==> "DotnetPack"
375392
==> "SourcelinkTest"
376393
==> "PublishToNuget"

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ then
3535
dotnet tool install paket --tool-path "$PAKET_TOOL_PATH"
3636
fi
3737

38-
FAKE_DETAILED_ERRORS=true "$FAKE" build -t "$@"
38+
DISABLE_COVERAGE=1 FAKE_DETAILED_ERRORS=true "$FAKE" build -t "$@"

0 commit comments

Comments
 (0)