Coder Social home page Coder Social logo

Comments (4)

groogiam avatar groogiam commented on June 26, 2024

I've compared the two files generated by the .NET 8 runtime and .NET 7 Runtime. For some reason the filename in the .NET 8 generated one is a url to devops not an actual file path.

.NET 7

<class name="MyProject.CopyRequest" filename="C:\agent\my-agent\_work\1\s\src\MyProject\CopyRequest.cs" line-rate="1" branch-rate="1" complexity="1">

.NET 8

<class name="MyProject.CopyRequest" filename="https://dev.azure.com/MyOrg/MyProject/_apis/git/repositories/my-repo/items?api-version=1.0&amp;versionType=commit&amp;version=CommitHash&amp;path=/src/MyProject/CopyRequest.cs" line-rate="1" branch-rate="1" complexity="1">

from azure-pipelines-tasks.

groogiam avatar groogiam commented on June 26, 2024

The link being output appears to be a result of using the SourceLink flag. However unsetting this flag does not seem to fix the issue it changes the filename to be a relative path MyProject\CopyRequest.cs in .NET 8 where as it is a fully qualified path in .NET 7. In either case it seems like this was changed in .NET 8 and this task does not account for the change. I'm not sure if this should be addressed by the publish task, the .NET sdk or coverlet?

<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
	<DataCollectionRunSettings>
		<DataCollectors>
			<DataCollector friendlyName="XPlat Code Coverage">
				<Configuration>
					<Format>cobertura,opencover</Format>
					<UseSourceLink>true</UseSourceLink>
					<SkipAutoProps>true</SkipAutoProps>
				</Configuration>
			</DataCollector>
		</DataCollectors>
	</DataCollectionRunSettings>
</RunSettings>

from azure-pipelines-tasks.

groogiam avatar groogiam commented on June 26, 2024

It looks like setting DeterministicReport true will revert the functionality to use a fully qualified path in .NET 8. However this flag is only supported by cobertura and not open cover. My particular configuration requires both as Sonar Cloud does not support cobetura. It really seems like this task needs to be updated to handle the path format change introduced via .NET 8 SDK.

from azure-pipelines-tasks.

groogiam avatar groogiam commented on June 26, 2024

I was able to to resolve this by just using the opencover format which is supported by PublishCodeCoverageResults@2 but not documented. The documentation page for this task https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/publish-code-coverage-results-v2?view=azure-pipelines does not appear to list what formats are supported.

from azure-pipelines-tasks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.