7.3 rc1

The Gradle team is excited to announce Gradle 7.3-rc-1.

Read the Release Notes


This is a companion discussion topic for the original entry at https://github.com/gradle/gradle/releases/tag/v7.3.0-RC1

I tried the new testing{} closure in an existing project with gradle 7.3-rc-1 and it isn’t being recognised, even with the jvm-test-suite plugin explicitly.

I have both the groovy and java plugins here. Is groovy getting in the way somehow?

Thank you for trying out Test Suites!

Currently the feature is still under active development and might be missing some expected options.

One thing you need to be clear about is that when you use test here it is not a task, but rather a suite. So configuration blocks like doFirst {} nested inside it will only cause errors - this must be configured on the test task that each suite creates.

See the docs here:
For the initial release of this plugin, each test suite has a single target. This results in a 1:1:1 relationship between test suite, test suite target and a matching Test task. The name of the Test task is derived from the suite name. Future iterations of the plugin will allow defining multiple targets based other attributes, such as a particular JDK/JRE runtime.

The test task can be configured like this:

testTask.configure {
  useJUnit()
    options {
      excludeCategories "com.example.Exclude"
    }
  }

Per the example here.

I’m having trouble getting the test suites to work. If I include the testing closure at all my build fails

C:\projects\>gradlew clean

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\projects\build.gradle' line: 537

* What went wrong:
Could not compile build file 'C:\projects\build.gradle'.
> startup failed:
  build file 'C:\projects\build.gradle': 537: Unexpected input: '{' @ line 537, column 9.
     testing {
             ^

  1 error


* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org
C:\projects\>gradlew --version

------------------------------------------------------------
Gradle 7.3-rc-1
------------------------------------------------------------

Build time:   2021-10-12 07:24:18 UTC
Revision:     d71b6cdb688f94d57ff4c27c7b185afbcb338a5f

Kotlin:       1.5.31
Groovy:       3.0.9
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          11.0.11 (AdoptOpenJDK 11.0.11+9)
OS:           Windows 10 10.0 amd64

I’ve tried with and without the plugin specified and both fail with the same exception. What could I possibly be doing improperly?