Skip to content

Conversation

@kelvinou01
Copy link
Contributor

@kelvinou01 kelvinou01 commented Nov 14, 2025

Before this PR

No way to excavate new Gradle versions for testing easily

After this PR

Introduce a new file gradle/gradle-test-versions.yml:

major-versions:
  8: 8.14.3
  9: 9.2.0-rc1
extra-versions:
- 8.8
- 8.14.2

Add a section to the README detailing how gradleVersions is set. Refer to the README for details on how the config file is used.

==COMMIT_MSG==
Create the gradle/gradle-test-versions.yml file
==COMMIT_MSG==

Possible downsides?

@changelog-app
Copy link

changelog-app bot commented Nov 14, 2025

Generate changelog in changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

Create the gradle/gradle-test-versions.yml file

Check the box to generate changelog(s)

  • Generate changelog entry

@changelog-app
Copy link

changelog-app bot commented Nov 14, 2025

Successfully generated changelog entry!

Need to regenerate?

Simply interact with the changelog bot comment again to regenerate these entries.


📋Changelog Preview

✨ Features

  • Create the gradle/gradle-test-versions.yml file (#287)

Comment on lines 35 to 37
gradleTestUtils {
gradleVersions = ["${version}"]
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this test, it makes no sense. There aren't any tests for the build under test to run.

Your changes also don't do anything:

  • For every version in version, it doesn't run the build under test with the parameterised gradle version, it runs the build under test with the default version of gradle. Then any tests that are run within the build under test, if they use the @GradlePluginTesting annotation, then those tests will run with different gradle versions. But there are no tests to run.

I would be surprised if this test actually did anything i.e. if the task was just NO-SOURCES.

I would probably delete the test, or set it up properly, and in any case, I don't think the change you're making here is necessary

Copy link
Contributor Author

@kelvinou01 kelvinou01 Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, the test does check the plugin logic run during configuration time for CC violations.

But no tasks are run, so the logic in test.doFirst isn't tested. I'll fix this in a FLUP PR?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good

version << GradleTestVersions.gradleVersionsForTests
}

def 'use the test driver Gradle version when a version is not set: #version'() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a much better example of what the ConfigurationCacheTest could be doing

version << GradleTestVersions.gradleVersionsForTests
}

def 'use the test driver Gradle version when a version is not set: #version'() {
Copy link

@felixdesouza felixdesouza Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you also need a test that the file does what it says i.e. can you run the build under test on a single gradle version, but set it up that the config file runs two versions. That a test you've written runs against two versions.

There's nothing here in this PR that does that. You've got deserialisation logic testing and that's it, there's nothing that indicates that you've wired things up correctly.

Copy link
Contributor Author

@kelvinou01 kelvinou01 Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I've aded this test in PluginTestingPluginIntegrationSpec:

    def 'use Gradle versions from both config file and extension'() {
        given: 'gradle/gradle-test-versions.yml exists, and sets both major and extra versions'
        ...

        and: 'gradleVersions is set in build script'
        ...

        when: 'running GradlePluginTests'
        ...

        then: 'test runs with versions from both config file and extension'
        result.success
        result.standardOutput.contains("Running with Gradle version: 8.14.2")
        result.standardOutput.contains("Running with Gradle version: 8.8")
        result.standardOutput.contains("Running with Gradle version: 7.6")
    }

@felixdesouza
Copy link

👍

@bulldozer-bot bulldozer-bot bot merged commit e12dd61 into develop Nov 19, 2025
5 checks passed
@bulldozer-bot bulldozer-bot bot deleted the okelvin/yaml-config branch November 19, 2025 14:39
@autorelease3
Copy link

autorelease3 bot commented Nov 19, 2025

Released 0.38.0

@kelvinou01
Copy link
Contributor Author

FLUPS:

  • Actually run a test in ConfigurationCacheTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants