Skip to content

KAFKA-20553: Eliminate the dependencies on "sourceSets.test.output" (raft)#22274

Merged
chia7712 merged 1 commit into
apache:trunkfrom
unknowntpo:KAFKA-20553-raft-test-fixtures
May 13, 2026
Merged

KAFKA-20553: Eliminate the dependencies on "sourceSets.test.output" (raft)#22274
chia7712 merged 1 commit into
apache:trunkfrom
unknowntpo:KAFKA-20553-raft-test-fixtures

Conversation

@unknowntpo
Copy link
Copy Markdown
Contributor

@unknowntpo unknowntpo commented May 13, 2026

Gradle test fixtures to the raft module and removes all dependencies on
sourceSets.test.output. We should revisit other usages in this JIRA.
This will simplify the dependency graph and unblock the upgrade to
Gradle 9.5+

This patch is working on raft module

Ref: https://issues.apache.org/jira/browse/KAFKA-20553 Similar to
#22229 (server-common) and
#22244 (storage:storage-api)

  • Apply java-test-fixtures plugin to :raft
  • Move test helper classes (MockLog, RaftClientTestContext,
    MockNetworkChannel,
    etc.) from src/test/ to src/testFixtures/
  • Introduce VoterSetTestUtil in testFixtures to hold the static
    helpers
    previously in VoterSetTest. This is necessary because
    MockNetworkChannel
    (now in testFixtures) referenced VoterSetTest.DEFAULT_LISTENER_NAME,
    but
    testFixtures cannot depend on the test source set. VoterSetTest is
    updated
    to delegate to VoterSetTestUtil, so existing call sites are
    unchanged.
  • Update :core and :metadata to use testFixtures(project(':raft'))
    instead of project(':raft').sourceSets.test.output
  • Add :raft to protectedModules to prevent future regressions

Reviewers: Chia-Ping Tsai chia7712@gmail.com

@github-actions github-actions Bot added triage PRs from the community kraft build Gradle build or GitHub Actions labels May 13, 2026
@unknowntpo unknowntpo changed the title KAFKA-20553 Eliminate the dependencies on "sourceSets.test.output" (raft) KAFKA-20553: Eliminate the dependencies on "sourceSets.test.output" (raft) May 13, 2026
@unknowntpo unknowntpo force-pushed the KAFKA-20553-raft-test-fixtures branch from b4022b5 to 64a892b Compare May 13, 2026 04:31
…raft

Ref: https://issues.apache.org/jira/browse/KAFKA-20553
Similar to apache#22229 (server-common) and
apache#22244 (storage:storage-api) but for
the raft module.

- Apply `java-test-fixtures` plugin to `:raft`
- Move test helper classes (MockLog, RaftClientTestContext, MockNetworkChannel,
  etc.) from `src/test/` to `src/testFixtures/`
- Introduce `VoterSetTestUtil` in testFixtures to hold the static helpers
  previously in `VoterSetTest`. This is necessary because `MockNetworkChannel`
  (now in testFixtures) referenced `VoterSetTest.DEFAULT_LISTENER_NAME`, but
  testFixtures cannot depend on the test source set. `VoterSetTest` is updated
  to delegate to `VoterSetTestUtil`, so existing call sites are unchanged.
- Update `:core` and `:metadata` to use `testFixtures(project(':raft'))`
  instead of `project(':raft').sourceSets.test.output`
- Add `:raft` to `protectedModules` to prevent future regressions
@unknowntpo unknowntpo force-pushed the KAFKA-20553-raft-test-fixtures branch from 64a892b to b862e4d Compare May 13, 2026 04:38
@unknowntpo unknowntpo marked this pull request as ready for review May 13, 2026 04:41
Copy link
Copy Markdown
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

LGTM

@chia7712 chia7712 merged commit 90703da into apache:trunk May 13, 2026
25 of 30 checks passed
@github-actions github-actions Bot removed the triage PRs from the community label May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Gradle build or GitHub Actions ci-approved kraft

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants