Skip to content

Add Groovy tests. - #1

Open
smillst wants to merge 7 commits into
smillst:mainfrom
typetools:addGroovyTests
Open

smillst wants to merge 7 commits into
smillst:mainfrom
typetools:addGroovyTests

Conversation

@smillst

@smillst smillst commented Feb 4, 2026

Copy link
Copy Markdown
Owner

No description provided.

@coderabbitai

coderabbitai Bot commented Feb 4, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@smillst has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 24 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Bumps project version to 1.0.2-SNAPSHOT. Renames AbstractPluginFunctionalTest to KotlinPluginFunctionalTest and adds a new GroovyPluginFunctionalTest base class. Adds CFGroovyPluginFunctionalTest functional test and updates fixture behavior to write test sources to src/test/java. Modifies CheckerFrameworkPlugin.kt by moving checker validation and annotation-processor-path augmentation into a doFirst block, reworking skip-condition handling, relocating the missing-checkers error to run-time, and adjusting the isTestName check (adds a println and a broadened regex).

Possibly related PRs

  • smillst/checker-framework-gradle-plugin#3: Modifies CheckerFrameworkPlugin.kt; overlaps with rework of validation and processor-argument handling in the doFirst phase.
  • smillst/checker-framework-gradle-plugin#13: Adjusts skip/guard logic for configuring the Checker Framework; closely related to the plugin skip-condition changes.
  • smillst/checker-framework-gradle-plugin#14: Changes to CheckerFrameworkPlugin.kt and Gradle/Kotlin-DSL handling that intersect with the plugin execution/refactor work.

Suggested reviewers

  • kelloggm
  • mernst
🚥 Pre-merge checks | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/functionalTest/kotlin/org/checkerframework/plugin/gradle/Fixtures.kt (1)

28-39: ⚠️ Potential issue | 🔴 Critical

Package declaration does not match directory structure.

The Test.java file declares package test; (line 32) but is now placed in src/test/java/ instead of src/test/java/test/. This mismatch will cause Java compilation to fail because the source file location must match the package declaration.

🐛 Proposed fix to restore correct directory structure
 fun File.writeTestClass() {
-  File(this.resolve("src/test/java").apply { mkdirs() }, "Test.java").apply {
+  File(this.resolve("src/test/java/test").apply { mkdirs() }, "Test.java").apply {
     createNewFile()
🤖 Fix all issues with AI agents
In
`@src/functionalTest/kotlin/org/checkerframework/plugin/gradle/CFGroovyPluginFunctionalTest.kt`:
- Around line 74-76: The test incorrectly uses doesNotContain (literal match)
for result.output; replace it with a regex-aware assertion so the pattern "Note:
TaintingChecker is type-checking .*Test.java" is treated as a regex. Update the
assertion on result.output (in CFGroovyPluginFunctionalTest.kt) to use a
regex-aware AssertJ method such as doesNotMatch or not(containsMatch(...))
instead of doesNotContain, keeping the same regex string and leaving the
successful compile assertion (TaskOutcome.SUCCESS) and the containsMatch check
unchanged.

In
`@src/functionalTest/kotlin/org/checkerframework/plugin/gradle/CFPluginFunctionalTest.kt`:
- Line 486: The negative assertion on result.output is using literal matching
(doesNotContain) with a regex-like string; update the assertion in
CFPluginFunctionalTest (the test method using result.output) to use
doesNotContainMatch(...) instead of doesNotContain(...) so the "Note:
TaintingChecker is type-checking .*Test.java" pattern is treated as a regex and
the test correctly checks for no matching lines.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/kotlin/org/checkerframework/plugin/gradle/CheckerFrameworkPlugin.kt (1)

106-143: ⚠️ Potential issue | 🟠 Major

Move task input mutations from doFirst to configuration phase to preserve build cache validity.

The doFirst block mutates options.annotationProcessorPath, options.compilerArgs, and options.isFork, which are task inputs. Gradle snapshots these inputs before actions execute, so mutations in doFirst won't invalidate the task's up-to-date status or build cache entry when the checker manifest or checkers list changes.

Move these configurations to project.afterEvaluate (which runs during evaluation phase, before execution) using onlyIf to handle skip conditions, ensuring input mutations are captured in the task's input snapshot.

Additionally, remove the println("#$taskName#") debug output in the isTestName function (line 262).

🤖 Fix all issues with AI agents
In
`@src/main/kotlin/org/checkerframework/plugin/gradle/CheckerFrameworkPlugin.kt`:
- Around line 262-263: Remove the stray stdout println in isTestName: delete the
line printing "#$taskName#" so the function no longer writes to stdout; if
diagnostic output is required, replace it with Gradle's logger.debug (e.g., use
project.logger.debug or the appropriate Logger) rather than println, and keep
the return statement taskName.matches(Regex(".*(T|(^|[A-Z_])t)est.*"))
unchanged.

Comment thread src/main/kotlin/org/checkerframework/plugin/gradle/CheckerFrameworkPlugin.kt Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant