-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Register property attributes during deserialization (#1644)
When registering properties as part of deserialization, we were registering with the wrong attributes. This means, for example, that the registered MSTestDiscoverer.TestCategory property in devenv.exe would end up without the TestPropertyAttributes.Trait attribute. The effects of this bug are unobservable for tests discovered via container/reflection based discovery (CBD) (since testcase.SetPropertyValues() is called with the deserialized testPropery objects directly as opposed to the property that was registered). However, this leads to problems for tests reported via live unit testing (LUT) and source based discovery (SBD). Both LUT and SBD need to apply MSTestDiscoverer.TestCategory property on tests and they call TestProperty.Find() to find existing an property with that id. If CBD has already happened LUT and SBD will find the property registered by the below code with missing TestPropertyAttributes.Trait attribute. Consequently new tests reported via LUT and SBD end up under the No Traits group in the test window if user has grouped their tests by traits. Changes in traits for existing tests updated via LUT are also not reflected in this view. Worse still, the problem only repros if CBD has happened before SBD or LUT (which can be somewhat racy because both LUT and CBD can be triggered parallelly after solution load). This fix ensures that we when we register properties we also apply the correct attributes so that any other consumers who call TestProperty.Find() within the same process (or rather AppDomain) will find the correct property.
- Loading branch information
1 parent
eefdea2
commit c3359e1
Showing
4 changed files
with
10 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters