run single integration test with gradle

后端 未结 3 1778
情歌与酒
情歌与酒 2020-12-14 08:39

I\'m trying to run a single integration tests using gradle\'s -Dtest.single flag. I have added another source set, src/integrationTest and put the

相关标签:
3条回答
  • 2020-12-14 09:14

    Just incase anyone is coming here looking for answers. This has been removed in gradle 5.0. Look for test.single in https://docs.gradle.org/current/userguide/upgrading_version_4.html

    If you still wish to use a command line option in this style you should be able to use the --tests commandline param

    $ ./gradlew integrationTest --tests=MyTest
    
    0 讨论(0)
  • 2020-12-14 09:26

    Since Gradle 1.10 you can write:

     //select specific test method
    gradle test --tests org.gradle.SomeTest.someFeature
    
    //select specific test class
    gradle test --tests org.gradle.SomeTest
    
    //select all tests from package
    gradle test --tests org.gradle.internal*
    
    //select all ui test methods from integration tests by naming convention
    gradle test --tests *IntegTest*ui*
    
    //selecting tests from different test tasks
    gradle test --tests *UiTest integTest --tests *WebTest*ui
    

    Read more here http://www.gradle.org/docs/1.10/release-notes#executing-specific-tests-from-the-command-line

    0 讨论(0)
  • 2020-12-14 09:31

    The correct syntax is:

    gradle testTaskName -DtestTaskName.single=...

    In this case:

    gradle integrationTest -DintegrationTest.single=...

    0 讨论(0)
提交回复
热议问题