Fix CodeBase for existing inproc collector settings #2331
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In-proc coverlet collector is injected by collect arg processor.
If no coverlet in-proc setting is found full xml element properties setting is injected.
If coverlet in-proc setting is found we ensure to setup mandatory field
AssemblyQualifiedName
CodeBase
IsEnabled
Past fix to avoid custom code to pass adapters path to host fixed "default" and most common case where no in-proc element is present #2288
This PR fix the case where in-proc element is present and codebase is null.
Check for codebase if null search using adapter path if null setup default coverlet codebase
CoverletConstants.CoverletDataCollectorCodebase
BTW after #2288 in-proc collector won't be injected because coverlet nuget adapter path won't be passed to testhost.
In conclusion...to work coverlet needs adapter path loaded in TestAdaptersPaths.
cc: @nohwnd @jakubch1 @vagisha-nidhi