-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add bootstrap fixture for bootstrap tests #8781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f83464f
to
48887a4
Compare
bca3962
to
e768840
Compare
a461ee0
to
3aee5e6
Compare
6ba7e0c
to
62108a7
Compare
d4082e5
to
09d4b8b
Compare
90200c3
to
c9617c9
Compare
3f80d28
to
02ffe32
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great set of refactorings! I have a few comments which are mostly minor. I wanted to just clarify where we stand on the issue of passing ContainerConfiguration
to the hooks or rather stick with the Container
. Should be reconciled with #8890
if not isinstance(self.container, RunningContainer): | ||
raise ValueError(f"Container {self.container} not started") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be done by overriding the shutdown
method otherwise the server will be in a wonky state (see the shutdown
method implementation)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pulled the check outside the do_shutdown
method so we dont mess with the
threading.event` variables: f341355 - is that what you were getting at?
I think the environment section is set up separately to the main invocation, which in turn sources the tinybird parameters
This should prevent the duplicate fixtures problem
Co-authored-by: Thomas Rausch <[email protected]>
This is annoying as we don't have a nice type system *cough* rust *cough*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests/bootstrap/conftest.py
Outdated
def _wait_for(container: RunningContainer, timeout: float | None = None): | ||
container.wait_until_ready(timeout) | ||
|
||
poll_condition(lambda: constants.READY_MARKER_OUTPUT in container.get_logs().splitlines()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add the timeout here as well just to be sure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot, thanks will do 👍
Add a fixture (and example tests) for black-box testing the LS container. Particularly: starting the container with different configurations and ensuring that it behaves as expected.
This fixture will be useful for: