Skip to content

Tidy up test migration and fix Gradle 9 test compatibility#1630

Open
FinlayRJW wants to merge 21 commits intodevelopfrom
finlayw/tidy-up
Open

Tidy up test migration and fix Gradle 9 test compatibility#1630
FinlayRJW wants to merge 21 commits intodevelopfrom
finlayw/tidy-up

Conversation

@FinlayRJW
Copy link
Contributor

@FinlayRJW FinlayRJW commented Mar 16, 2026

Important

Depends on #1506 and #1538 being merged first.

Before this PR

There were some rough edges left over from the test migration that needed tidying up, and ConfigurationOnDemandTest had a test that fails on Gradle 9.

The transitive_dependencies_cause_upstream_projects_to_be_configured_sufficiently_early test resolved another project's configuration directly from a task action:

tasks.register('writeClasspathOfA') {
    doLast {
        println project(':projectA').configurations.runtimeClasspath.files
    }
}

This cross-project configuration resolution is no longer allowed in Gradle 9:

Execution failed for task ':projectC:writeClasspathOfA'.
> Resolution of the configuration ':projectA:runtimeClasspath' was attempted without an exclusive lock.
  This is unsafe and not allowed.

After this PR

==COMMIT_MSG==
Fix Gradle 9 compatibility in ConfigurationOnDemandTest and tidy up the test migration
==COMMIT_MSG==

The writeClasspathOfA task is removed. Instead, the test uses the existing writeClasspath task on projectC (registered for all subprojects in @BeforeEach), which resolves projectC's own runtimeClasspath. Since projectC -> projectB -> projectA, the transitive dependency transitive-test-dep is still present and the version constraint from the lock file (1.1.0 rather than 1.0.0) is still validated.

Other tidy-ups:

Possible downsides?

svc-excavator-bot and others added 21 commits February 10, 2026 10:09
writeVersionsLocks
…dle-testing-junit-framework-a6415fc369dfdcc8
check-unused-constraints
error-prone-apply-suppress
…dle-testing-junit-framework-a6415fc369dfdcc8
…nit-framework-36debc64a3cf516f' into finlayw/tidy-up
- Remove nebula-test dependency (no longer needed after migration)
- Add Gradle 7 and 9 to test matrix
- Fix ConfigurationOnDemandTest for Gradle 9 cross-project resolution
- Fix file URI and property handling in migrated tests
@changelog-app
Copy link

changelog-app bot commented Mar 16, 2026

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

Fix Gradle 9 compatibility in ConfigurationOnDemandTest and tidy up the test migration

Check the box to generate changelog(s)

  • Generate changelog entry

@FinlayRJW FinlayRJW changed the title Tidy up test migration and fix Gradle 9 compatibility Tidy up test migration and fix Gradle 9 test compatibility Mar 16, 2026
@changelog-app
Copy link

changelog-app bot commented Mar 16, 2026

Successfully generated changelog entry!

Need to regenerate?

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


📋Changelog Preview

💡 Improvements

  • Fix Gradle 9 compatibility in ConfigurationOnDemandTest and tidy up the test migration (#1630)

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