If we follow some kind of convention, it is fairly easy to separate tests in Gradle. We can have our tests in different directories and distinct packages or, for example, with different file suffixes. In this case, we choose the latter. All our specification classes are named with the Spec suffix (that is, TicTacToeSpec). We can make a rule that all integration tests have the Integ suffix.
With that in mind, let us modify our build.gradle file.
First, we'll tell Gradle that only classes ending with Spec should be used by the test task:
test { include '**/*Spec.class' }
Next, we can create a new task, testInteg:
task testInteg(type: Test) { include '**/*Integ.class' }
With those two additions to build.gradle, we continue ...