Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSBuild data should not be passed between tasks via static fields #364

Closed
sharwell opened this issue Mar 8, 2019 · 1 comment
Closed
Labels
enhancement General enhancement request

Comments

@sharwell
Copy link
Contributor

sharwell commented Mar 8, 2019

The following static field access should be rewritten using MSBuild inputs and outputs:

https://github.com/tonerdo/coverlet/blob/062b907735901bdf3ad9d4d40953f53a4fe3f364/src/coverlet.msbuild.tasks/CoverageResultTask.cs#L69

https://github.com/tonerdo/coverlet/blob/062b907735901bdf3ad9d4d40953f53a4fe3f364/src/coverlet.msbuild.tasks/InstrumentationTask.cs#L10

I believe the most straightforward and reliable implementation would involve generating GUIDs and/or temporary file names within MSBuild, and then passing those names to the build tasks. With this approach, the instrumentation task would produce known outputs for a given set of inputs, which can be tracked by the MSBuild targets.

📝 This limitation forces test execution to use /m:1 since the static property cannot keep track of information from multiple test executions in parallel.

@MarcoRossignoli
Copy link
Collaborator

Fixed in #409

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement General enhancement request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants