com-lihaoyi / mill

Mill is a fast JVM build tool that supports Java and Scala. 2-3x faster than Gradle and 5-10x faster than Maven for common workflows, Mill aims to make your project’s build process performant, maintainable, and flexible
https://mill-build.org/
MIT License
2.04k stars 331 forks source link

Add new built in command in Test suite that lists full names of all test classes or test cases. #3169

Closed jk-1 closed 4 months ago

jk-1 commented 4 months ago

Please add new built in command in Test suite that lists full names of all test classes or test cases.

E.g.

mill myLib.test.testList

com.myCompany.aa.FooTest         
com.myCompany.aa.BarTest
com.myCompany.bb.BlaaTest                  
com.myCompany.cc.BlaaBlaaTest      
com.myCompany.cc.BazTest               
com.myCompany.cc.HelloWorldTest

or with all test case names

mill myLib.test.testList -n

com.myCompany.aa.FooTest.myCase1         
com.myCompany.aa.BarTest."myCase 1"
com.myCompany.aa.BarTest."myCase 2"
com.myCompany.bb.BlaaTest.testCase01
com.myCompany.cc.BlaaBlaaTest."testCase 01"
com.myCompany.cc.BlaaBlaaTest."testCase 02"
com.myCompany.cc.BlaaBlaaTest."testCase 03"
com.myCompany.cc.BazTest.testBadValues
com.myCompany.cc.HelloWorldTest.testGoodValues
com.myCompany.cc.HelloWorldTest."test good and bad values"

so that it is easy to use this output for scripting like:

mill show myLib.test.testOnly -- com.myCompany.cc.HelloWorldTest."test good and bad values"

lefou commented 4 months ago

I like the idea, but I think the TestFramework abstraction we use can only provide us a list of test classes, not all test cases.