Improve naming scheme of parameterized tests
See original GitHub issueWith the new parameter()
directive, the test names can become really large and not easy to handle, so we need to find an alternative naming scheme.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Improve naming scheme of parameterized tests #1794 - GitHub
With the new parameter() directive, the test names can become really large and not easy to handle, so we need to find an...
Read more >Making Better Unit Tests, Part 2: naming unit tests - Manning
From Unit Testing, Principles, Practices, and Patterns by Vladimir Khorikov. In this article, we'll talk about naming unit tests.
Read more >A More Practical Guide to JUnit 5 Parameterized Tests
In this tutorial we will learn how to write JUnit 5 parameterized tests. The tutorial is structured so that it also answers most...
Read more >Changing names of parameterized tests - Stack Overflow
This feature has made it into JUnit 4.11. To use change the name of parameterized tests, you say: @Parameters(name="namestring").
Read more >Parameterized Tests - Medium
Tip: Use a good naming convention so that we can easily understand the test from reports itself. Now if you want to add...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If the test gets parametrised due to fixtures, then its name will have to change. In the example above, we could have a name such as
TestA%f.f.p=1
. If it had another parametrised fixture namedg
with parameterq
could beTestA%f.f.p=1%g.q=1
and so on. Implementation-wise it might not be so straightforward, but let’s see 😃Regarding the hash, I agree that it should be the standard name addressing mechanism, but I would rather compute the hash based on the raw information, i.e., class name + fixture index + parameter index or anything else that’s not based on the name.
This was eventually addressed by #2166. See #2248 for improving the user experience.