FortuneN / FineCodeCoverage

Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)
https://marketplace.visualstudio.com/items?itemName=FortuneNgwenya.FineCodeCoverage
Other
516 stars 39 forks source link

Setting 'Enabled=True' in settings file doesn't enable FCC coverage when 'Enabled=False' in global Visual Studio settings #362

Closed CNBoland closed 7 months ago

CNBoland commented 8 months ago

Installed product versions

Description

Setting Enabled=True in settings file (finecodecoverage-settings.xml at project or solution level, MSBuild properties in .csproj file) doesn't enable FCC coverage when Enabled=False in global Visual Studio settings.

The converse is true, however: Enabled=False in settings file disables FCC coverage when Enabled=True in global Visual Studio settings, though FCC UI indicates this differently by displaying a different message on Coverage log tab: (FCCEnabledSettingIssue) Failed. See the FCC Output Pane. Viewing the FCC Output Pane shows log entries:

Fine Code Coverage 12/8/2023 2:10:23 PM: ================================== START ==================================
Fine Code Coverage 12/8/2023 2:10:23 PM: (FCCEnabledSettingIssue) Failed.
Disabled
Fine Code Coverage 12/8/2023 2:10:23 PM: ================================== DONE ==================================

Steps to recreate

  1. Install FCC add-in.
  2. Display the FCC UI in Visual Studio.
  3. Open Visual Studio Settings, navigate to Fine Code Coverage > Run (Common) and set: Enabled = False.
  4. Create a new file at the solution level named finecodecoverage-settings.xml with the following contents:
    <FineCodeCoverage>
    <Enabled>
    True
    </Enabled>
    </FineCodeCoverage>
  5. Run a unit test.

Current behavior

On the FCC UI, Coverage log tab, is displayed: Coverage not collected as FCC is disabled.

Expected behavior

The Enabled=True setting in finecodecoverage-settings.xml should override global Enabled=False, code coverage should be collected, and FCC display the results.

Attached repro solution: FCCEnabledSettingIssue.zip

Side Notes

tonyhallett commented 7 months ago

The VS Enabled option set to false prevented code coverage running. There is now an additional option DisabledNoCoverage that you can set to false to prevent this from occurring.