-
Notifications
You must be signed in to change notification settings - Fork 391
Description
We have some "legacy" .NET Core 2.2.8/2.2.207 applications. We're trying to add codecov before we can migrate up to 3.1.x or 5.x.
When we try and follow the info set out in the coverlet docs/readme, etc ... we get the following error:
Starting test execution, please wait...
Data collector 'XPlat code coverage' message: [coverlet]System.MissingMethodException: Make sure to use .NET core SDK Version >= 2.2.300 ---> System.MissingMethodException: Method not found: '!!0 Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection.SessionStartEventArgs.GetPropertyValue(System.String)'.
at Coverlet.Collector.DataCollection.CoverletCoverageCollector.GetPropertyValueWrapper(SessionStartEventArgs sessionStartEventArgs)
at Coverlet.Collector.DataCollection.CoverletCoverageCollector.GetTestModules(SessionStartEventArgs sessionStartEventArgs) in //src/coverlet.collector/DataCollection/CoverletCoverageCollector.cs:line 194
--- End of inner exception stack trace ---
at Coverlet.Collector.DataCollection.CoverletCoverageCollector.GetTestModules(SessionStartEventArgs sessionStartEventArgs) in //src/coverlet.collector/DataCollection/CoverletCoverageCollector.cs:line 205
at Coverlet.Collector.DataCollection.CoverletCoverageCollector.OnSessionStart(Object sender, SessionStartEventArgs sessionStartEventArgs) in /_/src/coverlet.collector/DataCollection/CoverletCoverageCollector.cs:line 126.
Here's a 100% simple repo:
docker pull mcr.microsoft.com/dotnet/core/sdk:2.2.207
docker run --rm -it mcr.microsoft.com/dotnet/core/sdk:2.2.207 /bin/bash
mkdir app
cd app
dotnet new xunit
dotnet add package coverlet.collector --version 1.3.0
dotnet add package microsoft.net.test.sdk
dotnet test --collect:"XPlat Code Coverage"
so we
- start a docker instance of the .NET Core 2.2.207 SDK
- create a new xunit project
- add coverlet.collector
- updated the Test sdk.
- test!
so can someone please help / what are we doing wrong?
SIDE NOTE: we understand that 2.2 is not LTS and we're just not in a position just yet to move the sdk to 2.1 or 3.1 ... so we're hoping it's easier/quicker to just get our codecov to work (against the existing codebase) instead of doing and SDK migration (which should be an easy thing .. but we've got processes to follow)