-1

Hey guys I am having a little trouble with the gradle wrapper. Is there any good way to compile all my code, compile all my tests, and run a single test. This is for a scripting command in a Jenkins pipeline.

I have used

  • ./gradlew build, which runs all the tests
  • ./gradlew build -x test, which compiles all main code and not allow me to run any tests

Thanks for any help

1 Answers1

0

see the gradle documentation https://docs.gradle.org/current/userguide/java_testing.html#test_filtering

# Executes all tests in SomeTestClass
gradle test --tests SomeTestClass

# Executes a single specified test in SomeTestClass
gradle test --tests SomeTestClass.someSpecificMethod

gradle test --tests SomeTestClass.*someMethod*

# specific class
gradle test --tests org.gradle.SomeTestClass

# specific class and method
gradle test --tests org.gradle.SomeTestClass.someSpecificMethod
PrasadU
  • 2,154
  • 1
  • 9
  • 10