I have a cake file for building my netstandard library project that you can see it in GitHub home repo.
For integration with Appveyor CI I want to upload test result in this CI and generate coverlet coverage together. for this purpose I write below stage
Task("Test")
.IsDependentOn("Build")
.Does(() => {
var settings = new DotNetCoreTestSettings {
};
var coverletSettings = new CoverletSettings {
CollectCoverage = true,
CoverletOutputFormat = CoverletOutputFormat.opencover,
CoverletOutputDirectory = Directory(@"./coverage-test/"),
CoverletOutputName = coverageResultsFileName
};
DotNetCoreTest(testProject, settings, coverletSettings);
MoveFile("./coverage-test/" + coverageResultsFileName, artifactsDir + coverageResultsFileName);
if (AppVeyor.IsRunningOnAppVeyor)
AppVeyor.UploadTestResults(artifactsDir + coverageResultsFileName, AppVeyorTestResultsType.NUnit3);
});
But as you can see in result of build test section in AppVeyor, there is not show any test result and AppVeyor does not show any test result.
My problem is how to upload test result to AppVeyor with generate coverlet coverage together?
I found one solution to upload test result in AppVeyor in stackoverflow but it is not my answer, because if I use NUnit3
class in cake file, I think indeed AppVeyor run all unit test twice and it is not efficient.