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

Fixed bugs in ManagedMethod parsing, and updated hierarchies. #3704

Merged
merged 5 commits into from
Jul 19, 2022

Conversation

Haplois
Copy link
Contributor

@Haplois Haplois commented May 31, 2022

Our FQN API is finalized, this PR makes it compliant with Visual Studio.

  • Hierarchy order reversed to make it easily expandable. Currently, we only support 4 levels.
  • Hierarchy API revised to return all 4 levels which are: Test group, class name, namespace, and container.
  • Test group by default is managed method name without adapters.
  • Fixes Exception: Sequence contains more than one element #2926

Hierarchies are for display purposes; we need to change how we generate those:

  • Switch to using closed types instead of open. TestMethod<string> instead of TestMethod`1.
  • Append method parameters to Test group if any, do not append () if not.
  • Namespace can be string.Empty in case of no namespace. Make sure that works as expected, and we're able to resolve when provided.

Breaking changes

  • Hierarchy generation changed, RFC to be updated to reflect this. (Add RFC spec for Hierarchy property vstest-docs#261)
  • Although this breaks compatibility with older versions of Hierarchy since those versions were officially released and never used by anyone - support will start with the first version we release. It will be bound to TP version, and adapter version. Check is done inside Test Explorer.

@Haplois Haplois force-pushed the dev/haplois/adapter-utilities-fixes branch 3 times, most recently from 333a48b to e4650ed Compare May 31, 2022 20:44
@Haplois Haplois force-pushed the dev/haplois/adapter-utilities-fixes branch from e4650ed to 94960c3 Compare May 31, 2022 20:52
@nohwnd
Copy link
Member

nohwnd commented Jun 1, 2022

Can you add more info to the PR description please?

@Haplois Haplois force-pushed the dev/haplois/adapter-utilities-fixes branch from 94960c3 to af50d49 Compare June 1, 2022 19:05
@Haplois Haplois force-pushed the dev/haplois/adapter-utilities-fixes branch 2 times, most recently from b6f3ecb to 4daa7eb Compare June 15, 2022 19:22
@Haplois Haplois force-pushed the dev/haplois/adapter-utilities-fixes branch from 4daa7eb to 3827a8e Compare June 15, 2022 20:51
Copy link
Member

@nohwnd nohwnd left a comment

Choose a reason for hiding this comment

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

My main concern is about breaking backwards compatibility. What is the consequences of that?

const Microsoft.TestPlatform.AdapterUtilities.HierarchyConstants.Levels.NamespaceIndex = 0 -> int
const Microsoft.TestPlatform.AdapterUtilities.HierarchyConstants.Levels.TotalLevelCount = 2 -> int
const Microsoft.TestPlatform.AdapterUtilities.HierarchyConstants.Levels.ContainerIndex = 0 -> int
const Microsoft.TestPlatform.AdapterUtilities.HierarchyConstants.Levels.NamespaceIndex = 1 -> int
Copy link
Member

Choose a reason for hiding this comment

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

So how does this work when adapter utilities on testhost side and on IDE side are different? How do we keep compatibility with MSTest that is currently using this, like 2.2.9?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll handle those on the test window side. No one except us uses this, so in older versions we just fallback to old approach for display purposes.

Copy link
Member

Choose a reason for hiding this comment

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

Based on what will you handle it? The array size or the actual version of the mstest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we will only enable this on next release. (That part is not baked in TE yet.) Also if an adapter returns something not supported we will fallback to current behavior.

@Haplois Haplois force-pushed the dev/haplois/adapter-utilities-fixes branch 2 times, most recently from d568fa6 to 2089b4c Compare July 19, 2022 14:35
Copy link
Member

@Evangelink Evangelink left a comment

Choose a reason for hiding this comment

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

One last comment.

PS: It'd be better to have a separate PR for the assemblyinfo changes as they do not relate to this change.

@Haplois Haplois force-pushed the dev/haplois/adapter-utilities-fixes branch from 2089b4c to 749aac1 Compare July 19, 2022 14:58
@Haplois Haplois requested a review from nohwnd July 19, 2022 15:12
Copy link
Member

@nohwnd nohwnd left a comment

Choose a reason for hiding this comment

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

Approving, because I am promised we can iterate on the design. And hopefully make the values separate properties that will be output only when they have non-default values. And same for the FQN properties, because keeping them custom (in property bag) adds a lot of overhead.

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.

Exception: Sequence contains more than one element
3 participants