-
Notifications
You must be signed in to change notification settings - Fork 102
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
Add custom rules to make DisplayName from testname #210
Comments
Sounds like a reasonable enhancement, although you probably mean the tests' DisplayName (the FullyQualifiedName serves as a unique identifier to each test, together with the Source (i.e., the executable containing the test). I have renamed the feature accordingly... Note that I do not have a lot of time to spend on GTA at the moment, so this is not going to happen in the near future if not contributed by the community (of course, I would be willing to help). |
@csoltenborn, after some tests I did, actually it is the FullyQualifiedName that have to be modified so that Test Explorer will correctly group tests in the "Test Hierarchy" and in group by "Namespace" or "Class" modes. But it is the FullyQualifiedName in VsTestCase, not the one in TestCase. I compiled a version of TAfGT with modified ToVsTestCase and ToTestCase (to reverse the modifications) and have been able to correctly display tests in groups. Test Explorer uses the two last dots of the FullyQualifiedName to split the categories. If I send you some pull requests on bug fixes, or for this extension, do you have time to review them or should I try to send them to MS's TAfGT? And do you know if MS plans to merge back work done on this repo? |
It's a good question whether MS will pull changes into the TAfGT repository - I'm currently trying to figure this out... Anyways: thanks already for looking into that stuff! Howver, I'm not sure that I have understood what you want to achieve: The test hierarchy view seems to working fine (see creenshot below), it shows test executable, fixture, and test name hierarchies. CPP files and namespaces appear to be missing, though (but the latter is probably difficult to achieve due to anon namespaces)... Would you mind to post a screenshot which shows "your" hierarchy? Having said that, I would be more than happy to review and pull in your pull request! Let's just first agree on what's supposed to happen... |
I see... Are you especially after parameterized or type parameterized tests? If this is the case, we should maybe also consider #102 (which to my understanding is the VS notion of parameterized tests)... |
While looking after #102, I found Guidelines for FullyQualifiedNames... |
Nice job! I have also seen your comment on #102, and I had the same line of thought: With data driven tests, one can only execute a certain test after the tests have been executed at least once (before, the data values are not known to the test framework). I think that one can provide the data values through property bags such that they are displayed in the test explorer (no idea how, though), but the problem above remains, and figuring out the test(s) to be run from that information might be more difficult than (and is at least different to (and thus has to be implemented)) using "normal" tests. Thus, it currently feels like your approach is even preferrable to data-driven tests, because it provides the same benefits, but no drawbacks afaics. However, that probably only holds from VS2017 on, since the hierarchy view has not been available before that version. I will in the course of today file a question at the VsTest repository and ask whether there are advantages/drawbacks we haven't thought of - maybe we can get some advise on wich way to go... Link to question will follow. Out of interest: can you post a screenshot of your notion of test names without hierarchy view enabled? Just would like to see how they look like... As a side note, if you already have some code you would like to share, feel free to create a pull request - you will then get CI for free... |
I have create the issue linked above - feel free to add your questions in case I have forgotten anything! |
Ok, I found the problem with the tests. I had to set environment variable GTA_TESTS_VS2017 because GetVsTestConsolePath was not returning the path to the correct version of VS. Now all tests are passing. |
googletest impose severe constraints in the test naming and parametrization naming. Typically, people use a more or less elaborated naming convention to map the tests hierarchy into the flat testname namespace.
I propose to add a list of regular expressions in the settings file for translating from googletest names to FullyQualifiedNames (with dots). In this way, the test explorer could properly group tests by namespace, class, etc.
(I have been using a similar approach by creating a custom xslt to import the googletest xml output into jenkins, with nice results)
The text was updated successfully, but these errors were encountered: