Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ dependencies {
testFixturesApi gradleTestKit()
testImplementation 'org.wiremock:wiremock-standalone:3.6.0'
testImplementation "org.mockito:mockito-core:${props.getProperty('mockito')}"
integTestImplementation('org.spockframework:spock-core:2.4-M6-groovy-4.0') {
integTestImplementation('org.spockframework:spock-core:2.4-groovy-5.0') {
exclude module: "groovy"
}
Comment on lines +133 to 135
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, read the buildSrc/build.gradle file to see the context around lines 133-145
cat -n buildSrc/build.gradle | sed -n '100,145p'

Repository: opensearch-project/OpenSearch

Length of output: 2591


🌐 Web query:

Spock Framework 2.4 final release version compatibility and breaking changes from 2.4-M6

💡 Result:

Short answer: as of the official Spock website, there is no published 2.4 "final" release page yet — only 2.4 milestone/SNAPSHOT documentation and release notes. The 2.4 line (what will become final) adds several compatibilities/features and introduces a few breaking changes compared to 2.4‑M6; the important items are below (sources cited).

Compatibility / notable platform support (2.4 line)

  • Adds support for Groovy 5.0 (planned in the 2.4 work). [1]
  • Continued JDK minimum is Java 8 (Spock 2.x requirement). [2]

New features (added in the 2.4 series after earlier milestones)

  • Support for combining data providers with Cartesian product. [1]
  • New filter block after where to filter iterations. [1]
  • IBlockListener extension point to observe block execution. [1]
  • Implicit-assertion condition blocks via @verify / @VerifyAll in helper methods. [1]
  • Pluggable mock makers (ServiceLoader) and a Mockito-based mock maker (allowing final/static mocking via Mockito integration). [1][3]
  • SpyStatic API for static method spying. [3]

Breaking / behavioral changes (differences to 2.4‑M6)

  • The 2.4‑M6 release specifically lists one breaking change impacting @snapshot: snapshot lookup changed — snapshots are now loaded from a directory named after the bottom (concrete) spec class rather than the class that originally declared the feature. This affects users who used snapshots declared in parent/base specs. Bump opensearch-core from current to 1.2.4 in /buildSrc/src/testKit/opensearch.build #2112. [1]
  • Earlier 2.4 milestone breaking changes that remain relevant for 2.4:
    • Response-calculation closures for interactions (>> { ... }) are no longer executed while synchronizing on the mock controller (affects multithreaded interaction code). This can change behavior in concurrent tests. [1]
    • Pluggable mock-makers require choosing/adding compatible mock-maker implementations (e.g., Mockito mock maker requires a compatible Mockito on classpath). [3]
  • General 2.x-era breaking changes still apply (documented in the migration guide), e.g. unroll/default unroll behavior, renamed tokens, removed spock-report, JUnit4 runner->JUnit Platform migration, etc.—consult the migration guide when upgrading from older 1.x/2.0-era versions. [2]

If you want, I can:

  • Watch the Spock site and notify you when an official 2.4 final release page (2.4.0 release notes) appears, or
  • Produce a short migration checklist tailored to your project (build tool, Groovy version, mocking usage, snapshot usage).

Sources:

  • Spock 2.4 (SNAPSHOT) release notes (highlights + 2.4‑M6 entry). [1]
  • Spock migration guide / breaking changes (general 2.x migration notes). [2]
  • Spock 2.4‑M2 release notes (mock-maker / Mockito integration, SpyStatic). [3]

🌐 Web query:

Spock 2.4-groovy-5.0 Maven Central availability and release notes

💡 Result:

Short answer

  • Yes — the 2.4-groovy-5.0 variants are published to Maven Central (org.spockframework:spock-core and related modules). [1]
  • Release notes: Spock 2.4 adds Groovy 5.0 support plus features like Cartesian product data providers, a post-where filter block, IBlockListener, @Verify/@VerifyAll helper-method assertions, and pluggable mock makers; see the 2.4 release notes and milestone notes (including 2.4-M7). [2]

Useful specifics

  • Maven coordinates (example):
    • org.spockframework:spock-core:2.4-groovy-5.0. (Also available: spock-bom and spock-junit4 2.4-groovy-5.0). See Central listing. [1]
  • Central timestamps (directory listing shows 2.4-groovy-5.0 published in the 2.4 release line — maven metadata updated 2025-12-11). [1]
  • Release notes / highlights (support for Groovy 5.0, feature highlights and bugfixes; milestone changelog entries such as 2.4-M7). [2]

Links

  • Maven Central listing for org.spockframework/spock-core. [1]
  • Spock 2.4 release notes and milestone changelog. [2]

If you want, I can paste the exact dependency snippets (Maven/Gradle) or fetch a direct POM/JAR URL for the 2.4-groovy-5.0 artifact.


Update the documentation URL reference in the comment on line 137.

The version upgrade is correct—spock-core 2.4-groovy-5.0 is available in Maven Central and explicitly supports Groovy 5.0. However, the inline documentation URL on line 137 still references the milestone version and should be updated from 2.4-M6 to 2.4:

Line 137 comment that needs updating
- // Integration with JUnit 4 features for Spock 2+ (which internally uses JUnit Platform -
+ // Integration with JUnit 4 features for Spock 2+ (which internally uses JUnit Platform -
- // part of JUnit 5) - https://spockframework.org/spock/docs/2.4-M6/modules.html
+ // part of JUnit 5) - https://spockframework.org/spock/docs/2.4/modules.html

Note: The Spock 2.4 final release includes breaking changes for @Snapshot snapshot directory naming and response-calculation closures in multithreaded interactions, but these are unlikely to impact this test configuration.

🤖 Prompt for AI Agents
In @buildSrc/build.gradle around lines 133-135, Update the inline comment
referencing Spock docs to point to the final 2.4 docs: locate the comment near
the integTestImplementation block (the comment that mentions "Integration with
JUnit 4 features for Spock 2+ ...") and change the URL segment from
"spock/docs/2.4-M6/modules.html" to "spock/docs/2.4/modules.html" so it matches
the upgraded dependency version.

// Integration with JUnit 4 features for Spock 2+ (which internally uses JUnit Platform -
// part of JUnit 5) - https://spockframework.org/spock/docs/2.4-M6/modules.html
integTestImplementation('org.spockframework:spock-junit4:2.4-M6-groovy-4.0') {
integTestImplementation('org.spockframework:spock-junit4:2.4-groovy-5.0') {
exclude module: "groovy"
}
Comment on lines 136 to 140
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Update the outdated documentation reference.

The comment references the old version 2.4-M6 in the documentation URL. Since the dependency has been upgraded to version 2.4, the documentation link should be updated accordingly.

🔎 Proposed fix
-  // Integration with JUnit 4 features for Spock 2+ (which internally uses JUnit Platform -
-  // part of JUnit 5) - https://spockframework.org/spock/docs/2.4-M6/modules.html
+  // Integration with JUnit 4 features for Spock 2+ (which internally uses JUnit Platform -
+  // part of JUnit 5) - https://spockframework.org/spock/docs/2.4/modules.html
   integTestImplementation('org.spockframework:spock-junit4:2.4-groovy-5.0') {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Integration with JUnit 4 features for Spock 2+ (which internally uses JUnit Platform -
// part of JUnit 5) - https://spockframework.org/spock/docs/2.4-M6/modules.html
integTestImplementation('org.spockframework:spock-junit4:2.4-M6-groovy-4.0') {
integTestImplementation('org.spockframework:spock-junit4:2.4-groovy-5.0') {
exclude module: "groovy"
}
// Integration with JUnit 4 features for Spock 2+ (which internally uses JUnit Platform -
// part of JUnit 5) - https://spockframework.org/spock/docs/2.4/modules.html
integTestImplementation('org.spockframework:spock-junit4:2.4-groovy-5.0') {
exclude module: "groovy"
}
🤖 Prompt for AI Agents
In @buildSrc/build.gradle around lines 136-140, Update the inline comment URL to
reference the correct Spock documentation version: change the documentation link
in the comment above the
integTestImplementation('org.spockframework:spock-junit4:2.4-groovy-5.0')
dependency so it points to the stable 2.4 docs (replace "2.4-M6" with "2.4") to
reflect the upgraded dependency version.

integTestImplementation(platform("org.junit:junit-bom:${props.getProperty('junit5')}"))
Expand Down
Loading