Skip to content

fix(gradle): publish sirix-core test classes via testArtifacts configuration#967

Merged
JohannesLichtenberger merged 1 commit intomainfrom
fix/gradle-test-artifacts-cross-module
May 1, 2026
Merged

fix(gradle): publish sirix-core test classes via testArtifacts configuration#967
JohannesLichtenberger merged 1 commit intomainfrom
fix/gradle-test-artifacts-cross-module

Conversation

@JohannesLichtenberger
Copy link
Copy Markdown
Member

Summary

Restores Docker Hub deploy on `main` (CI run 25207884507 failed with `Could not get unknown property 'sourceSets' for project ':sirix-core'`).

The historical idiom `project(':sirix-core').sourceSets.test.output` reaches across module boundaries through the dependencies block — Gradle 9.x stopped supporting that because `project(...)` returns a `DefaultProjectDependency`, not the actual `Project`.

Fix

Replace the cross-module test-class share with a named consumable configuration:

  • `sirix-core/build.gradle` declares a `testArtifacts` configuration and a `testJar` task that publishes a tests-classified jar.
  • `sirix-kotlin-api` and `sirix-rest-api` now consume it via `project(path: ':sirix-core', configuration: 'testArtifacts')`.

The testJar deliberately excludes `src/test/resources` because that tree contains the ~3.6 GB `json/cityofchicago.json` benchmark dataset which would blow past the zip 4 GB limit and is not needed by downstream consumers (they need `Holder` / `JsonTestHelper` / `IteratorTester` classes, not the bench input).

Test plan

  • `./gradlew :sirix-kotlin-api:compileTestKotlin` succeeds locally.
  • `./gradlew :sirix-rest-api:compileTestKotlin` succeeds locally.
  • Docker Hub deploy job re-runs green on this PR.

…uration

Cross-module test sharing previously used the old idiom

  testImplementation project(':sirix-core').sourceSets.test.output

which broke under the Gradle 9.x toolchain in the CI Docker build with

  Could not get unknown property 'sourceSets' for project ':sirix-core'
  of type DefaultProjectDependency

Gradle 9+ no longer exposes the consumer Project from project(...) inside a
dependencies block. Replace the idiom with a named consumable configuration
'testArtifacts' on sirix-core that publishes a tests-classified jar, and
have sirix-kotlin-api and sirix-rest-api consume it via

  testImplementation project(path: ':sirix-core', configuration: 'testArtifacts')

The testJar deliberately includes only sourceSets.test.output.classesDirs —
not the full output — because src/test/resources contains the multi-GB
cityofchicago.json benchmark dataset that would blow the zip 4 GB limit
and is not needed by downstream test consumers (they need Holder /
JsonTestHelper / IteratorTester etc., not the bench input).
@JohannesLichtenberger JohannesLichtenberger merged commit f513164 into main May 1, 2026
9 checks passed
@JohannesLichtenberger JohannesLichtenberger deleted the fix/gradle-test-artifacts-cross-module branch May 1, 2026 09:33
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