Skip to content
This repository was archived by the owner on Jan 11, 2024. It is now read-only.

Create a runtime dedicated to coverage using IL only #2077

Merged
merged 3 commits into from
Jun 28, 2018

Conversation

pjanotti
Copy link

This allows OpenCover to get source information for CoreLib (perhaps an issue to be investigated separately, since in theory it should have worked with the ni image and respective PDB). It also makes easier to experiment with tools that perform IL rewrite instead of relying on Profiler API.

Related to https://github.com/dotnet/corefx/issues/23588

@pjanotti pjanotti self-assigned this Jun 22, 2018
DependsOnTargets="GenerateWindowsPdbsForAssemblyBeingTested"
Condition="'$(CodeCoverageEnabled)'=='true' and '$(UseCoverageDedicatedRuntime)'=='true'">
<PropertyGroup>
<CoverageDedicatedRuntimeDir>$(TestHostRootPath)shared/Microsoft.NETCore.App/10.10.10</CoverageDedicatedRuntimeDir>

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -16,7 +16,7 @@
<CodeCoverageEnabled Condition="'$(SkipTests)' != 'true' and '$(RunningOnUnix)' != 'true' and '$(Coverage)' == 'true' and '$(Performance)' != 'true'">true</CodeCoverageEnabled>
<CoverageReportDir Condition="'$(CoverageReportDir)' == ''">$(TestWorkingDir)coverage\</CoverageReportDir>

<RestoreIlPdbsWithHardlinks Condition="'$(RestoreIlPdbsWithHardlinks)' == ''">true</RestoreIlPdbsWithHardlinks>
<UseCoverageDedicatedRuntime Condition="'$(UseCoverageDedicatedRuntime)' == ''">true</UseCoverageDedicatedRuntime>

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@pjanotti
Copy link
Author

FYI: Even after reviewed I will hold off merge until I'm able to fully test this in CoreFx (it takes a bit of time to run it when coverage is enabled).

@tarekgh
Copy link
Member

tarekgh commented Jun 22, 2018

@pjanotti don't block on my comments if @weshaggard and @vancem are ok with the changes. thanks for fixing this :-)

@pjanotti
Copy link
Author

Dev box runs for coverage are looking good.

@pjanotti
Copy link
Author

@weshaggard, please, take a look when you have a chance.

<RuntimeFiles Include="$(NETCoreAppTestSharedFrameworkPath)il/*.*" />
<RuntimeFilesAmd64 Include="$(NETCoreAppTestSharedFrameworkPath)amd64/*.*" />
<RuntimeFilesx86 Include="$(NETCoreAppTestSharedFrameworkPath)x86/*.*" />
<RuntimeWindowsPdbs Include="$(NETCoreAppTestSharedFrameworkPath)WindowsPDB/*.*" />

This comment was marked as spam.

This comment was marked as spam.

DestinationFolder="$(CoverageDedicatedRuntimeDir)"
SkipUnchangedFiles="true"
UseHardlinksIfPossible="false" />
<Copy SourceFiles="@(RuntimeFilesAmd64)"

This comment was marked as spam.

This comment was marked as spam.

"runtimeOptions": {
"framework": {
"name": "Microsoft.NETCore.App",
"version": "10.10.10"

This comment was marked as spam.

This comment was marked as spam.

@weshaggard
Copy link
Member

I asked a couple questions but the general approach looks good.

@pjanotti
Copy link
Author

I had to add some explicit copying/deleting for the runtimeconfig.json since SupplementalTestData by default use hard links (we don't want to overwrite the one using the "default" shared test runtime). Planning to merge as soon as tests are passing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants