Search code examples
gradlegradle-task

Gradle Include Pattern


Our project recently started separating our unit and integration tests, which used to all be contained within the same package. We created a task to kick off our integration tests:

task intTest(type: test){
  systemProperty ..., System.properties[...]
  systemProperty ..., System.properties[...]
  include '**/*Int*.java','**/*.func*.java','my.path.to.api.files.*'
}

However I"ve noticed that none of our Integration nor Functional tests are running. From what I can see our pattern looks correct. Any ideas as to why they're not being kicked off?

I am running from CLI using gradle :application:intTest


Solution

  • This works correctly. We had a dependency issue which was breaking us.

    My app.gradle file was inheriting from a common.gradle file. The common.gradle file had the same name for one of the tasks, which was breaking the tests. I changed the name and it works perfectly now.