Skip to content

Refactor a bit mock set up so we do it one place one way. - #4823

Open
epugh wants to merge 1 commit into
apache:mainfrom
epugh:simplify_mock_handling_crossdc
Open

Refactor a bit mock set up so we do it one place one way.#4823
epugh wants to merge 1 commit into
apache:mainfrom
epugh:simplify_mock_handling_crossdc

Conversation

@epugh

@epugh epugh commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Description

Found that I missed properly mocking everything when I did the Kafka 3 to 4 migration.

Solution

Instead of each class doing it's own mocking, have a shared helper.

Tests

Reran the tests.

Checklist

@dsmiley

dsmiley commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

ai generated

this module already has integration tests over the same code path — SimpleSolrIntegrationTest, ZkConfigIntegrationTest, SolrAndKafkaReindexTest — running against a real MiniSolrCloudCluster. They passed throughout. The mock-based tests are the ones that wedged CI, and they're the ones that had to be hand-edited to keep compiling.

(end)

Makes me question if this module needs mocks in the first place. I hate mocks. But I didn't look with my own eyes closely.

@epugh

epugh commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

ai generated

this module already has integration tests over the same code path — SimpleSolrIntegrationTest, ZkConfigIntegrationTest, SolrAndKafkaReindexTest — running against a real MiniSolrCloudCluster. They passed throughout. The mock-based tests are the ones that wedged CI, and they're the ones that had to be hand-edited to keep compiling.

(end)

Makes me question if this module needs mocks in the first place. I hate mocks. But I didn't look with my own eyes closely.

I share your sentiment on the Mocks.

Many of the tests in this module don't use mocks... I specifically asked about eliminating the all together, and the only reaosn I went with mocks was that when I aske claude about "hey, how do I tickle this specific data scenario with real embedded solr etc" it said it would jump up the test time!

I didn't actually try to do that and verify that the test duration would increase.. I'd be open to givign that a stab and just seeing....?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants