Skip to content

refactor: Clickhouse test setup and teardown - #4108

Open
msmithstubbs wants to merge 18 commits into
Logflare:mainfrom
msmithstubbs:refactor/clickhouse-tests
Open

msmithstubbs wants to merge 18 commits into
Logflare:mainfrom
msmithstubbs:refactor/clickhouse-tests

Conversation

@msmithstubbs

@msmithstubbs msmithstubbs commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Reduces repetition and tidies up some of the Clickhouse boilerplate:

  • Move clickhouse config to TestUtils
  • Refactor DataCase so fixtures are separated from creating/cleaning up Clickhouse tables
  • Don't start Clickhouse adapter unless necessary:
    • Queries can start it lazily
    • Finch mocks don't require it at all

Follows review of #3828 (merge it first)

Closes O11Y-2518

@msmithstubbs msmithstubbs changed the title Refactor/clickhouse tests refactor: Clickhouse test setup and teardown Oct 6, 2026
@msmithstubbs
msmithstubbs force-pushed the refactor/clickhouse-tests branch from 9c451b9 to 5c4a34a Compare October 6, 2026 05:20
insert(:plan, name: "Free")
{source, backend} = setup_clickhouse_test()

{:ok, _supervisor_pid} = ClickHouseAdaptor.start_link(backend)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not needed: requests are mocked


{source, backend} = setup_clickhouse_test()

{:ok, supervisor_pid} = ClickHouseAdaptor.start_link(backend)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed these when just for querying as it is started lazily.

@msmithstubbs
msmithstubbs marked this pull request as ready for review October 6, 2026 05:47

This branch has not been deployed

No deployments
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.

2 participants