-
Notifications
You must be signed in to change notification settings - Fork 794
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
Tests with a period (.) in their name are displayed incorrectly #9609
Comments
As a workaround, you may try using one of the other period look-alike characters. I've had similar issues with other test clients when using a colon in the name. While the CLI allows any character in a member name, test clients apparently take the fully qualified name and operate on that, as opposed to split the namespace, class and member parts. This seems to be to be a bug with the test client not F#. |
This bug is very annoying when you have tests with float you describe e.g.: |
This is ultimately the VS test runner UI separating things out by namespace and sub-namespace. @peterwald any thoughts here? The scenario (which you can also see in the tests in this codebase) is double backtick-quoted identifiers for module and test method names: [<TestFixture>]
module ``Some tests for 1.0 and 2.0`` =
[<Test>]
let ``1.0 + 2.0 is 3.0``() = ... |
@cartermp Yes, the VS Test Explorer currently parses the FQN using heuristics to try to determine the hierarchy, which in this case produces a bad result. The best workaround currently is to avoid using a period in the test name. We do have plans to remove our reliance on the FQN parsing and provide more hooks for the test adapters to supply the Namespace and Class hierarchy items directly (which would eliminate this issue). |
Thanks for the info! Is there a bug in AzDo this could be attached to? |
@cartermp This could be attached to 560932 and/or 571675. |
Tests with a period (
.
) in their name are displayed incorrectly.Steps to reproduce
This solution ZIP contains the following test code.
Actual behavior
These tests are displayed in the test explorer like this.
It is as though the namespace, module, and test names were concatenated together and then parsed back out like this.
Expected behavior
I expected the parsing to be like this...
...so that the tree in the solution explorer would look like this.
Known workarounds
Don't include
.
in a test name?I encountered this problem while investing this issue in which a certain test passes for some target frameworks when the code under test is built with some .NET Core SDKs but fails with other choices. At one point, I considered putting in the test name how its result depends on the versions of the .NET Core SDK. In the end, I decide not to include that information in the test name.
Related information
The text was updated successfully, but these errors were encountered: