-
Notifications
You must be signed in to change notification settings - Fork 281
fix(tests): Re-enable MQTT and Postgres tests #3163
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,5 @@ component = "test" | |
|
||
[component.test] | ||
source = "%{source=outbound-postgres}" | ||
allowed_outbound_hosts = ["postgres://{{ pg_host }}:%{port=5432}"] | ||
environment = { DB_URL = "postgres://postgres:postgres@localhost:%{port=5432}/spin_dev" } | ||
allowed_outbound_hosts = ["postgres://{{ pg_host }}:5432"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are the changes away from placeholder ports needed? I believe we did this so that test instances could be brought up on ports determined at runtime, and it would be good to keep it. If it's not working, it would be good to understand why. (But if that's involved in the flakiness, we can probably punt on it for now.) cc @rylev for thoughts and insight There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. leaving the placeholder ports in place causes a runtime failure. Specifically, the test fails with:
This happens sometimes unless a fixed port is provided, the dynamic port allocation logic isn’t working reliably in this test/ci context. We could dig deeper into why, but for now, hardcoding the port makes the test pass deterministically. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It makes the test pass in CI, but it will break tests running locally :-) We should figure out why things are not working in CI. |
||
environment = { DB_URL = "postgres://postgres:postgres@localhost:5432/spin_dev" } |
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.
Hmm, I thought we were dockerising the Postgres instance, but maybe that's been part of the problem. Again, I'd like to get Ryan's input on making it part of the CI image instead (I'm not for or against it, I just want to hear from someone who knows this bit of the system better than I do!).
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.
yeah i think it was not dockerising it right in ci environments, i think it's the same problem with mqtt too, hence the hardcoded service
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.
It would be nice to be able to use docker because that's the portable option. We want to be able to run tests anywhere (as long as docker is available). That was the original intent around using docker so that we didn't have to assume anything was available on the host machine (besides docker and python).
If we move CI to use host based services, we lose the ability to verify that things are working correctly.