GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Gradle 9.2.0 by timtebeek · Pull Request #836 · openrewrite/rewrite-testing-frameworks

Conversation

@timtebeek

@timtebeek timtebeek commented Oct 29, 2025

Copy link
Copy Markdown
Member

Use this link to re-run the recipe: https://app.moderne.io/builder/Sh3Bg6DMd?organizationId=QUxML09wZW4gU291cmNlL09wZW5SZXdyaXRl

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@timtebeek @TeamModerne
Gradle 9.2.0
594d644
Use this link to re-run the recipe: https://app.moderne.io/builder/Sh3Bg6DMd?organizationId=QUxML09wZW4gU291cmNlL09wZW5SZXdyaXRl

Co-authored-by: Moderne <[email protected]>
@moderne-meeseeks moderne-meeseeks Bot added this to OpenRewrite Oct 29, 2025
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Oct 29, 2025
timtebeek
timtebeek commented Oct 29, 2025
View reviewed changes
Comment thread build.gradle.kts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@timtebeek
Apply suggestions from code review
1d6c7b2
@timtebeek timtebeek self-assigned this Oct 29, 2025
@greg-at-moderne

greg-at-moderne commented Oct 30, 2025

Copy link
Copy Markdown
Contributor

1261 tests completed, 2 failed, 9 skipped

One is:

CleanupMockitoImportsTest > doNotRemoveMockitoImportsForKotlin() FAILED
    java.lang.IllegalStateException: LST contains missing or invalid type information
    MethodInvocation->Block->MethodDeclaration->Block->ClassDeclaration->CompilationUnit
    /*~~(MethodInvocation type is missing or malformed)~~>*/org.mockito.Mockito.mock(Foo::class.java)

The other one is:

GradleUseJunitJupiterTest > tasksWithTypeTest() FAILED
    org.opentest4j.AssertionFailedError: [Unexpected result in "build.gradle":
[...]
    expected: 
      "plugins {
          id 'java'
      }
      tasks.withType(Test) {
          useJUnitPlatform()
      }"
     but was: 
      "plugins {
          id 'java'
      }
      tasks.withType(Test) {
      }
      tasks.withType(Test).configureEach {
          useJUnitPlatform()
      }"
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Laurens-W

Laurens-W commented Oct 30, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Second test failure is also due to type information on the Gradle API missing, tasks is of type java.lang.Object whilst the recipe expects org.gradle.api.tasks.TaskContainer

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@timtebeek

timtebeek commented Oct 30, 2025

Copy link
Copy Markdown
Member Author

Ah that might be the Gradle 9 use of Groovy 4 not quite working well for us then I suppose; let me see if we can work around the issue.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

timtebeek added 2 commits October 30, 2025 13:56
@timtebeek
Standardize the order of dependencies
857c1a3
@timtebeek
Show that even pinning back the gradle version fails
d46e0ea
@timtebeek

timtebeek commented Oct 30, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Hmm; I've adjusted the failing test, but that already fails on the main branch as well:

    @Test
    void tasksWithTypeTest() {
        rewriteRun(
          //language=groovy
          buildGradle(
            """
              plugins {
                  id 'java'
              }
              tasks.withType(Test) {
              }
              """,
            """
              plugins {
                  id 'java'
              }
              tasks.withType(Test) {
                  useJUnitPlatform()
              }
              """,
            spec -> spec.beforeRecipe(cu -> {
                String string = TreeVisitingPrinter.printTree(cu);
                System.out.println(string);
                JavaType tasksType = ((J.MethodInvocation) cu.getStatements().getLast()).getSelect().getType();
                assertTrue(TypeUtils.isAssignableTo("org.gradle.api.tasks.TaskContainer", tasksType), tasksType.toString());
            })
          )
        );
    }

If I pin back the plugins on the main branch then the above passes;

plugins {
    id("org.openrewrite.build.recipe-library") version "2.5.6"
    id("org.openrewrite.build.moderne-source-available-license") version "2.5.6"
}
Laurens-W reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@timtebeek timtebeek mentioned this pull request Oct 30, 2025
Type attribution issue on Gradle tasks after 9.2.0 openrewrite/rewrite#6225
Closed
timtebeek added 2 commits October 31, 2025 09:38
@timtebeek
Fallback to checking simpleName if type does not match
b06bd3d
@timtebeek
Tolerate missing method type information
edbc584
timtebeek
timtebeek commented Oct 31, 2025
View reviewed changes
Comment thread src/test/java/org/openrewrite/java/testing/junit5/GradleUseJunitJupiterTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@timtebeek
Apply suggestions from code review
18988d5
@timtebeek
timtebeek merged commit 37e86b7 into main Oct 31, 2025
@timtebeek
timtebeek deleted the feature/gradle-9-2-0 branch October 31, 2025 09:20
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Oct 31, 2025
mergify Bot added a commit to robfrank/linklift that referenced this pull request Nov 10, 2025
@mergify
chore(deps): bump org.openrewrite.recipe:rewrite-testing-frameworks f…
74e2062
…rom 3.20.0 to 3.21.2 [skip ci]

Bumps [org.openrewrite.recipe:rewrite-testing-frameworks](https://github.com/openrewrite/rewrite-testing-frameworks) from 3.20.0 to 3.21.2.
Release notes

*Sourced from [org.openrewrite.recipe:rewrite-testing-frameworks's releases](https://github.com/openrewrite/rewrite-testing-frameworks/releases).*

> v3.21.2
> -------
>
> What's Changed
> --------------
>
> * Depend on rewrite-third-party for the type table entries by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-testing-frameworks#841](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/pull/841)
>
> **Full Changelog**: <openrewrite/rewrite-testing-frameworks@v3.21.1...v3.21.2>
>
> v3.21.1
> -------
>
> What's Changed
> --------------
>
> * Add JUnit 6 type table entries by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-testing-frameworks#839](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/pull/839)
>
> **Full Changelog**: <openrewrite/rewrite-testing-frameworks@v3.21.0...v3.21.1>
>
> 3.21.0
> ------
>
> What's Changed
> --------------
>
> * OpenRewrite recipe best practices by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-testing-frameworks#834](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/pull/834)
> * Gradle 9.2.0 by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-testing-frameworks#836](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/pull/836)
> * Add recipe to simplify AssertJ SequencedCollection assertions by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-testing-frameworks#837](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/pull/837)
>
> **Full Changelog**: <openrewrite/rewrite-testing-frameworks@v3.20.0...v3.21.0>


Commits

* [`4a3bf4e`](openrewrite/rewrite-testing-frameworks@4a3bf4e) Depend on rewrite-third-party for the type table entries ([#841](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/issues/841))
* [`111daea`](openrewrite/rewrite-testing-frameworks@111daea) Add JUnit 6 type table entries ([#839](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/issues/839))
* [`91418e6`](openrewrite/rewrite-testing-frameworks@91418e6) OpenRewrite recipe best practices
* [`345ac0a`](openrewrite/rewrite-testing-frameworks@345ac0a) Add recipe to simplify AssertJ SequencedCollection assertions ([#837](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/issues/837))
* [`37e86b7`](openrewrite/rewrite-testing-frameworks@37e86b7) Gradle 9.2.0 ([#836](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/issues/836))
* [`766f6be`](openrewrite/rewrite-testing-frameworks@766f6be) OpenRewrite recipe best practices ([#834](https://redirect.github.com/openrewrite/rewrite-testing-frameworks/issues/834))
* [`e85e34d`](openrewrite/rewrite-testing-frameworks@e85e34d) Clean up leftover calls to TestCase.super()
* [`2bed89d`](openrewrite/rewrite-testing-frameworks@2bed89d) Fix XmlUnit test to no longer break on new minor or patch releases
* See full diff in [compare view](openrewrite/rewrite-testing-frameworks@v3.20.0...v3.21.2)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=org.openrewrite.recipe:rewrite-testing-frameworks&package-manager=maven&previous-version=3.20.0&new-version=3.21.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@timtebeek timtebeek

Labels

None yet

Projects

OpenRewrite
Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@timtebeek @greg-at-moderne @Laurens-W
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.