Skip to content

Commit

Permalink
remove altcover
Browse files Browse the repository at this point in the history
all this stuff is inlined and can't generate sane coverage reports
  • Loading branch information
TheAngryByrd committed Jan 29, 2024
1 parent 3175ac9 commit bd902a0
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 64 deletions.
6 changes: 0 additions & 6 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
"version": 1,
"isRoot": true,
"tools": {
"dotnet-reportgenerator-globaltool": {
"version": "4.8.13",
"commands": [
"reportgenerator"
]
},
"paket": {
"version": "8.0.3",
"commands": [
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Authors>TheAngryByrd</Authors>
<RepositoryUrl>https://github.com/TheAngryByrd/IcedTasks</RepositoryUrl>
<!-- owners is not supported in MSBuild -->
<OtherFlags>$(OtherFlags) --test:GraphBasedChecking --test:ParallelIlxGen --test:ParallelOptimization</OtherFlags>
<OtherFlags>$(OtherFlags) --test:GraphBasedChecking --test:ParallelIlxGen --test:ParallelOptimization </OtherFlags>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
</Project>
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,6 @@ or
- `CONFIGURATION=Debug ./build.sh` will result in `-c` additions to commands such as in `dotnet build -c Debug`
- `GITHUB_TOKEN` will be used to upload release notes and Nuget packages to GitHub.
- Be sure to set this before releasing
- `DISABLE_COVERAGE` Will disable running code coverage metrics. AltCover can have [severe performance degradation](https://github.com/SteveGilham/altcover/issues/57) so it's worth disabling when looking to do a quicker feedback loop.
- `DISABLE_COVERAGE=1 ./build.sh`

---

### Building
Expand Down
48 changes: 0 additions & 48 deletions build/build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,6 @@ let distGlob =
distDir
</> "*.nupkg"

let coverageThresholdPercent = 80

let coverageReportDir =
rootDirectory
</> "docs"
</> "coverage"

let docsDir =
rootDirectory
</> "docs"
Expand Down Expand Up @@ -122,8 +115,6 @@ let publishUrl = "https://www.nuget.org"

let docsSiteBaseUrl = sprintf "https://%s.github.io/%s" gitOwner gitRepoName

let disableCodeCoverage = environVarAsBoolOrDefault "DISABLE_COVERAGE" true

let githubToken = Environment.environVarOrNone "GITHUB_TOKEN"

let nugetToken = Environment.environVarOrNone "NUGET_TOKEN"
Expand Down Expand Up @@ -293,7 +284,6 @@ let clean _ =
"bin"
"temp"
distDir
coverageReportDir
]
|> Shell.cleanDirs

Expand Down Expand Up @@ -370,11 +360,6 @@ let fsharpAnalyzers _ =
)

let dotnetTest ctx =
let excludeCoverage =
!!testsGlob
|> Seq.map IO.Path.GetFileNameWithoutExtension
|> String.concat "|"

DotNet.test
(fun c ->

Expand All @@ -385,42 +370,10 @@ let dotnetTest ctx =
MSBuildParams = {
c.MSBuildParams with
MaxCpuCount = maxCpuCount.Value
Properties = [
"AltCover", $"%b{not disableCodeCoverage}"
// "AltCoverThreshold", $"%d{coverageThresholdPercent}"
"AltCoverAssemblyExcludeFilter", excludeCoverage
"AltCoverLocalSource", "true"
]
}
})
sln

let generateCoverageReport _ =
let coverageReports =
!! "tests/**/coverage*.xml"
|> String.concat ";"

let sourceDirs =
!!srcGlob
|> Seq.map Path.getDirectory
|> String.concat ";"

let independentArgs = [
sprintf "-reports:\"%s\"" coverageReports
sprintf "-targetdir:\"%s\"" coverageReportDir
// Add source dir
sprintf "-sourcedirs:\"%s\"" sourceDirs
// Ignore Tests and if AltCover.Recorder.g sneaks in
sprintf "-assemblyfilters:\"%s\"" "-*.Tests;-AltCover.Recorder.g"
sprintf "-Reporttypes:%s" "Html"
]

let args =
independentArgs
|> String.concat " "

dotnet.reportGenerator id args

let watchTests _ =
!!testsGlob
|> Seq.map (fun proj ->
Expand Down Expand Up @@ -673,7 +626,6 @@ let initTargets () =
Target.create "DotnetBuild" dotnetBuild
Target.create "FSharpAnalyzers" fsharpAnalyzers
Target.create "DotnetTest" dotnetTest
Target.create "GenerateCoverageReport" generateCoverageReport
Target.create "WatchTests" watchTests
Target.create "GenerateAssemblyInfo" generateAssemblyInfo
Target.create "DotnetPack" dotnetPack
Expand Down
1 change: 0 additions & 1 deletion paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ group Test
nuget TimeProviderExtensions
nuget YoloDev.Expecto.TestSdk >= 0.14.2
nuget Microsoft.NET.Test.Sdk >= 17.7.2
nuget altcover >= 8.6.68
nuget FSharp.Control.TaskSeq

// [ FAKE GROUP ]
Expand Down
9 changes: 4 additions & 5 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -361,14 +361,13 @@ GROUP Test
STORAGE: NONE
NUGET
remote: https://www.nuget.org/api/v2
altcover (8.6.68)
Expecto (10.1)
FSharp.Core (>= 7.0.200) - restriction: >= net6.0
Mono.Cecil (>= 0.11.4 < 1.0) - restriction: >= net6.0
FSharp.Control.TaskSeq (0.3)
FSharp.Core (>= 6.0.2) - restriction: >= netstandard2.1
FSharp.Core (7.0.401) - restriction: >= netstandard2.1
Microsoft.Bcl.AsyncInterfaces (7.0) - restriction: || (&& (>= net462) (>= net6.0)) (&& (>= net462) (>= netstandard2.0)) (&& (>= net6.0) (< net8.0)) (&& (< net6.0) (>= netstandard2.0))
Microsoft.Bcl.AsyncInterfaces (7.0) - restriction: || (>= net462) (&& (< net8.0) (>= netstandard2.0))
System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (>= net462) (&& (>= netstandard2.0) (< netstandard2.1))
Microsoft.Bcl.TimeProvider (8.0)
Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (>= net462) (&& (< net8.0) (>= netstandard2.0))
Expand All @@ -395,10 +394,10 @@ NUGET
System.Reflection.Metadata (7.0.2) - restriction: >= netcoreapp3.1
System.Collections.Immutable (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0)
System.Memory (>= 4.5.5) - restriction: || (>= net462) (&& (< net6.0) (>= netstandard2.0))
System.Runtime.CompilerServices.Unsafe (6.0) - restriction: || (&& (>= monoandroid) (>= netcoreapp3.1) (< netstandard1.1)) (&& (< monoandroid) (>= net6.0) (< netstandard1.0)) (&& (< monoandroid) (>= net6.0) (< netstandard2.0) (< xamarintvos) (< xamarinwatchos)) (&& (< monoandroid) (< netcoreapp2.1) (>= netcoreapp3.1)) (&& (< monoandroid) (>= netcoreapp3.1) (< netstandard1.1)) (&& (< monoandroid) (>= netcoreapp3.1) (< netstandard2.0)) (&& (< monoandroid) (< netstandard1.0) (>= netstandard2.0) (< win8)) (&& (>= monotouch) (>= netcoreapp3.1)) (&& (>= net45) (>= net6.0) (< netstandard2.0)) (&& (>= net45) (>= netcoreapp3.1) (< netstandard2.0)) (&& (< net45) (< netcoreapp2.1) (>= netstandard2.0) (< netstandard2.1) (< xamarintvos) (< xamarinwatchos)) (&& (>= net461) (>= net6.0)) (&& (>= net461) (>= netcoreapp3.1)) (&& (>= net461) (>= netstandard2.0)) (&& (>= net462) (>= net6.0)) (&& (>= net462) (>= netcoreapp3.1)) (&& (>= net462) (>= netstandard2.0)) (&& (>= net6.0) (< net7.0)) (&& (>= net6.0) (< netcoreapp2.1) (< netstandard2.1) (< xamarintvos) (< xamarinwatchos)) (&& (>= net6.0) (< netstandard1.0) (>= win8)) (&& (>= net6.0) (< netstandard2.0) (>= wpa81)) (&& (>= net6.0) (>= wp8)) (&& (< net6.0) (>= netcoreapp3.1) (>= xamarinios)) (&& (< net6.0) (>= netcoreapp3.1) (>= xamarinmac)) (&& (< net6.0) (>= netcoreapp3.1) (>= xamarintvos)) (&& (< net6.0) (>= netcoreapp3.1) (>= xamarinwatchos)) (&& (< netcoreapp2.0) (>= netcoreapp3.1)) (&& (>= netcoreapp3.1) (< netstandard1.1) (>= win8)) (&& (>= netcoreapp3.1) (< netstandard2.0) (>= wpa81)) (&& (>= netcoreapp3.1) (>= uap10.1)) (&& (< netstandard1.0) (>= netstandard2.0) (>= win8)) (&& (>= netstandard2.0) (>= wp8))
System.Threading.Tasks.Extensions (4.5.4) - restriction: || (&& (>= net462) (>= net6.0)) (&& (>= net462) (>= netstandard2.0)) (&& (>= net6.0) (< netstandard2.1)) (&& (>= netstandard2.0) (< netstandard2.1))
System.Runtime.CompilerServices.Unsafe (6.0) - restriction: || (&& (>= monoandroid) (>= netcoreapp3.1) (< netstandard1.1)) (&& (< monoandroid) (< netcoreapp2.1) (>= netcoreapp3.1)) (&& (< monoandroid) (>= netcoreapp3.1) (< netstandard1.1)) (&& (< monoandroid) (>= netcoreapp3.1) (< netstandard2.0)) (&& (< monoandroid) (< netstandard1.0) (>= netstandard2.0) (< win8)) (&& (>= monotouch) (>= netcoreapp3.1)) (&& (>= net45) (>= netcoreapp3.1) (< netstandard2.0)) (&& (< net45) (< netcoreapp2.1) (>= netstandard2.0) (< netstandard2.1) (< xamarintvos) (< xamarinwatchos)) (&& (>= net461) (>= netcoreapp3.1)) (&& (>= net461) (>= netstandard2.0)) (>= net462) (&& (>= net6.0) (< net7.0)) (&& (< net6.0) (>= netcoreapp3.1) (>= xamarinios)) (&& (< net6.0) (>= netcoreapp3.1) (>= xamarinmac)) (&& (< net6.0) (>= netcoreapp3.1) (>= xamarintvos)) (&& (< net6.0) (>= netcoreapp3.1) (>= xamarinwatchos)) (&& (< netcoreapp2.0) (>= netcoreapp3.1)) (&& (>= netcoreapp3.1) (< netstandard1.1) (>= win8)) (&& (>= netcoreapp3.1) (< netstandard2.0) (>= wpa81)) (&& (>= netcoreapp3.1) (>= uap10.1)) (&& (< netstandard1.0) (>= netstandard2.0) (>= win8)) (&& (>= netstandard2.0) (>= wp8))
System.Threading.Tasks.Extensions (4.5.4) - restriction: || (>= net462) (&& (>= netstandard2.0) (< netstandard2.1))
System.Runtime.CompilerServices.Unsafe (>= 4.5.3) - restriction: || (&& (< monoandroid) (< monotouch) (< net45) (>= netstandard1.0) (< netstandard2.0) (< win8) (< wpa81) (< xamarintvos) (< xamarinwatchos)) (&& (< monoandroid) (< netstandard1.0) (>= portable-net45+win8+wp8+wpa81) (< win8)) (&& (>= net45) (< netstandard2.0)) (&& (< net45) (< netcoreapp2.1) (>= netstandard2.0) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)) (>= net461) (&& (< netstandard1.0) (>= win8)) (&& (< netstandard2.0) (>= wpa81)) (>= wp8)
System.ValueTuple (4.5) - restriction: || (&& (>= net462) (>= net6.0)) (&& (>= net462) (>= netstandard2.0))
System.ValueTuple (4.5) - restriction: >= net462
TimeProviderExtensions (1.0)
Microsoft.Bcl.TimeProvider (>= 8.0) - restriction: || (&& (>= net6.0) (< net8.0)) (&& (< net6.0) (>= netstandard2.0))
YoloDev.Expecto.TestSdk (0.14.2)
Expand Down

0 comments on commit bd902a0

Please sign in to comment.