-
Notifications
You must be signed in to change notification settings - Fork 18
Release 8.5.841
Steve Gilham edited this page Nov 19, 2022
·
10 revisions
This is the dotnet v7.0 release. It provides some more official work-rounds for the issues mentioned at that link.
- To support Cake 3.0, move the Cake API assembly from AltCover.Api to a new package AltCover.Cake; this contains libraries built against Cake 2.0.0 at
netcoreapp3.1
as well as the old ones built against Cake 1.0.0 at netstandard2.0 (present but in practice obsolete). - Following Fake.build's policy of deprecating releases older then 6 month, drop support for versions before 5.23.0
- [BREAKING] Rename
AltCover.Cake.DotNet.DotNetCoreTest
toAltCover.Cake.DotNet.DotNetTest
(even in the obsolete 1.0.0 build) to match the changes in the Cake APIs (and consequent chage to the test setting type in the argument list). Similarly, in the version ≥ 2.0.0 build, the typeAltCover.Cake.DotNet
is now a[CakeAliasCategory("DotNet")]
rather than[CakeAliasCategory("DotNetCore")]
- [API] New DotNet APIs for Fake support -
ToTestPropertiesList
method to emit a list of (name,value) pairs to allow customised property passing todotnet test
in the wake of the v7.0.100 regression. - [API] Additionally
ImportModuleProperties
andGetVersionProperties
values that are additonal lists of (name,value) pairs to append as needed.
This is to allow support for Cake v3.0 without needlessly bloating the AltCover.Api
package. All Cake support now moves here. Otherwise all is as previously documented.
Instead of decorating the DotNetTestSettings
so as to add extra /p:...
arguments by
testSettings.ArgumentCustomization = altcoverSettings.Concatenate(testSettings.ArgumentCustomization);
use the new ToTestPropertiesList
API to inject the values into the test process environment
using FSDotNet = AltCover.DotNet;
...
var args = FSDotNet.ToTestPropertiesList(
altcoverSettings.PreparationPhase,
altcoverSettings.CollectionPhase,
altcoverSettings.Options).ToArray();
Array.ForEach(args,
s => { testSettings.EnvironmentVariables[s.Item1] = s.Item2;});
Workrounds for running Fake at dotnet 7.0 are here.
Add the following preamble to your script
let dotnetVersion = DotNet.getVersion id
let withTestEnvironment l (o: DotNet.TestOptions) =
let before = o.Environment |> Map.toList
let after =
[ l; before ] |> List.concat |> Map.ofList
o.WithEnvironment after
let withAltCoverOptions
(prepare: Abstract.IPrepareOptions)
(collect: Abstract.ICollectOptions)
(force: DotNet.ICLIOptions)
(o: DotNet.TestOptions)
=
if dotnetVersion <> "7.0.100" then
o.WithAltCoverOptions prepare collect force
else
withTestEnvironment (DotNet.ToTestPropertiesList prepare collect force) o
let withAltCoverImportModule (o: DotNet.TestOptions) =
if dotnetVersion <> "7.0.100" then
o.WithAltCoverImportModule()
else
withTestEnvironment DotNet.ImportModuleProperties o
let withAltCoverGetVersion (o: DotNet.TestOptions) =
if dotnetVersion <> "7.0.100" then
o.WithAltCoverGetVersion()
else
withTestEnvironment DotNet.GetVersionProperties o
then replace code like
Fake.DotNet.DotNet.test (fun to' -> to'.WithAltCoverOptions prepare collect ForceTrue) "dotnettest.fsproj"
with
Fake.DotNet.DotNet.test (fun to' -> to' |> (withAltCoverOptions prepare collect ForceTrue)) "dotnettest.fsproj"
-
General purpose install -- excludes the
dotnet test
API with FAKE and CAKE integration and the AvaloniaUI visualizer - API install -- excludes the visualizer in all forms
- dotnet global tool install -- excludes the visualizer in all forms
- Visualizer dotnet global tool -- just the .net core/Avalonia Visualizer as a global tool
- FAKE build task utilities -- just AltCover related helper types for FAKE scripts (v5.23.0 or later), only in this package
- Cake build task utilities -- just AltCover related helper types for Cake scripts (v2.0.0 or later), only in this package