Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

add end2end testing harness to capture-server crate #45

Merged
merged 4 commits into from
Nov 6, 2023

Conversation

xvello
Copy link
Contributor

@xvello xvello commented Nov 6, 2023

  • Factor out server initialization in a serve function, that main now calls
  • Create ServerHandle and EphemeralTopic test helpers, that setup a per-test output topic and per-test server on a random port, to ensure safe concurrency between tests. They implement automatic cleanup on Drop.
  • Add two simple tests to try out the test harness
  • Add a docker-compose with the proper startup healthcheck and an optional kafka-ui, but the tests work with the compose from posthog/posthog, to simplify dev workflows

Calling docker compose with the --wait argument makes it return only when the healthchecks are green, which should avoid flakes, but I'm starting the containers ASAP just to be sure.

TODO:

  • redis isolation will be a bit more tricky. The redis-rs library does not support key prefixing, but we could implement it in our abstraction layer

@xvello xvello requested a review from ellie November 6, 2023 10:11
@xvello xvello force-pushed the xvello/integration branch from daed568 to 7c247da Compare November 6, 2023 10:18
@xvello xvello force-pushed the xvello/integration branch from 7c247da to 867403e Compare November 6, 2023 10:28
Copy link
Contributor

@ellie ellie left a comment

Choose a reason for hiding this comment

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

Couple of comments, opinions not that strongly held

.github/workflows/rust.yml Show resolved Hide resolved
capture-server/src/server.rs Outdated Show resolved Hide resolved
@xvello xvello force-pushed the xvello/integration branch from c3bf855 to 018145c Compare November 6, 2023 11:49
@xvello xvello requested a review from ellie November 6, 2023 11:51
@xvello xvello merged commit bcc4549 into main Nov 6, 2023
4 checks passed
@xvello xvello deleted the xvello/integration branch November 6, 2023 13:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants