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

Adding elements to code coverage config passed via commandline, #3162

Merged
10 commits merged into from
Nov 12, 2021

Conversation

fhnaseer
Copy link
Member

@fhnaseer fhnaseer commented Nov 10, 2021

Adding elements to code coverage config passed via commandline,

e.g.
Input:
--collect:"Code Coverage;CLRIEInstrumentationNetCore=true;CLRIEInstrumentationNetFramework=false"

Output:

      <DataCollector friendlyName="Code Coverage" enabled="True">
        <Configuration>
          <CLRIEInstrumentationNetCore>true</CLRIEInstrumentationNetCore>
          <CLRIEInstrumentationNetFramework>false</CLRIEInstrumentationNetFramework>
        </Configuration>
      </DataCollector>

e.g.
Input:
--collect:"Code Coverage;CLRIEInstrumentationNetCore=true;CLRIEInstrumentationNetFramework=false"

Output:
      <DataCollector friendlyName="Code Coverage" enabled="True">
        <Configuration>
          <CLRIEInstrumentationNetCore>true</CLRIEInstrumentationNetCore>
          <CLRIEInstrumentationNetFramework>false</CLRIEInstrumentationNetFramework>
        </Configuration>
      </DataCollector>
@fhnaseer fhnaseer requested a review from nohwnd November 10, 2021 16:33
@jakubch1
Copy link
Member

Please add acceptance tests for code coverage which will cover Format setting.
If runsettings are also specified, will this overwrite value in runsettings?

Copy link
Member

@jakubch1 jakubch1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fhnaseer currently if you do:

dotnet test --collect "Code Coverage;XPlat Code Coverage"

we are enabling both collectors and getting 2 reports from dynamic and coverlet so we have to keep this logic.
It means that we can support arguments only using such thing:

--collect "datacollector1;arg1=val1,arg2=val2"

and for more collectors:

--collect "datacollector1;arg1=val1,arg2=val2;datacollector2;arg3=val3,arg4=val4"

you probably need to be checking if = is in the collector name and then treat as argument to previous collector. Adding acceptance tests for both scenarios would be great.

@ghost
Copy link

ghost commented Nov 12, 2021

Hello @fhnaseer!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit ee559af into main Nov 12, 2021
@ghost ghost deleted the dev/fhnaseer/cc-commandline-config branch November 12, 2021 13:48
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants