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

Enable the independent unload of instrumented modules without generating final report #1688

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

JosephSun2003
Copy link
Contributor

@JosephSun2003 JosephSun2003 commented Aug 16, 2024

Dear Coverlet Team,

I’m an intern at Geotab tasked with fixing a hack used in my company's continious integration and development testing.

To briefly explain, Geotab is a telematics company focused on providing fleet management solutions for both private and public sector organisations. The company utilises Coverlet to assist with its continuous integration and development, primarily calculating and tracking unit test coverage as per Coverlet's design.

Associated issue with this PR: #1694

The Problem

The problem encountered with the incorporation of Coverlet is the needlessly redundant processing when jobs are parallelized. Specifically, the execution of the unloading of instrumentation and aggregation of Coverlet’s test coverage result.

Since instrumentation unloading and Coverlet’s result aggregation are set to always occur one after the other, parallelized jobs will run multiple instances of report generation simultaneously, these results would then be used to further report generation to aggregate the already aggregated results.

As such, the simultaneous report generation is an unnecessary process as one instance of report generation can be run instead, rather than the multiple in parallel that require the further aggregation anyways.

GeoTab’s Hack

The hack implemented by my supervisor, then, is to invoke the unloading of instrumentation using the .Net Reflection library. This hack is similar to the one used in Coverlet's VSTest Platform integration as noted here.

Problems with the Hack

The main problem with this hack is the long term maintenance of Geotab’s Coverlet integration. Unlike the VSTest integration, any changes to Coverlet involving the unloading of instrumentation may result in numerous undetectable issues for Geotab.

As such, Geotab, and many users who utilise parallelization, would benefit from Coverlet being able to work more seamlessly with systems, projects and others using parrellism in code testing.

Desired Change Results

The goal of these changes are as follows:

  • Enable developers to invoke a method to unload instrumentation of assemblies
  • Maintain existing execution operations for testing in projects that are still executed serially
  • Add required unit tests to ensure functionality

Fell free to ask me any questions if something is unclear.

JosephSun2003 and others added 15 commits August 12, 2024 17:11
* Revert "Revert changes to CoverageWrapper.cs and ICoverageWrapper.cs"

This reverts commit 25feb24.

* Revert "Adjust arguement name to trigger the skip of coverage calculation"

This reverts commit c54c5cf.

* Revert "Add unit tests to new methods"

This reverts commit c3905a1.

* Revert "Revert refactorings caught by Geotab Analyzers"

This reverts commit cbe14cc.

* Revert "add unload modules unique specifically for use in coverlet.console"

This reverts commit 98f1f75.

* Revert "Remove possibly unneeded variables"

This reverts commit 6d2dd57.

* Revert "Unrollback change removals to integrate new changes with VSTest Integration"

This reverts commit 9d4de10.

* Revert "Refactor explicit and implicit variable usage to comply with dotnet code style rules"

This reverts commit e67ba69.

* Revert "Add minor documentation corrections and remove unneeded changes"

This reverts commit da1257e.

* Revert "Update documentation to clarify the modifications made and add some basic code clean up"

This reverts commit 0dfef6f.

* Revert "Fix problems encountered with newly added method and variables from unit testing with existing tests"

This reverts commit dcc3c29.

* Revert "Add new method to manually call the unloading of modules"

This reverts commit 88a5782.

---------

Co-authored-by: Joseph Sun <[email protected]>
This reverts commit d9621e2.
@JosephSun2003
Copy link
Contributor Author

Note: some of these changes were done with my coporate account, apologies if this creates any confusion.

@JosephSun2003 JosephSun2003 marked this pull request as ready for review August 16, 2024 20:19
@JosephSun2003 JosephSun2003 changed the title Enable the independent unload of instrumented modules without calcualting coverage Enable the independent unload of instrumented modules without generating final report Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant