Skip to content
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

AUT-105: GitHub workflow for testing #329

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

oskirby
Copy link
Contributor

@oskirby oskirby commented Sep 9, 2024

This creates a github workflow to run the unit and integration tests for pull requests and on merge to the main branch.

Along the way we also encountered a flaky test that needed fixing. In particular connections to http://localhost:8000 don't result in deterministic error messages because localhost can resolve to either 127.0.0.1 or [::]. To get a consistent result we needed to force the tests to use a fixed localhost address.

@oskirby oskirby marked this pull request as ready for review September 9, 2024 21:51
@oskirby oskirby requested review from a team as code owners September 9, 2024 21:51
Comment on lines +333 to +335
// For the purpose of testing - ensure we're using IPv4.
conf.BaseURL = "http://127.0.0.1:8000/"

Copy link
Contributor

@jmhodges jmhodges Sep 9, 2024

Choose a reason for hiding this comment

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

I know we're just doing minimal changes in this PR, so this is not for this change, but I've written the code that does random port allocation so often that I now can't not mention it. Code like this would allow us to run the tests even if we have port 8000 consumed:

https://go.dev/play/p/GerJqydR1a_F

@oskirby oskirby force-pushed the aut-105-github-workflows branch 2 times, most recently from fb14f44 to 98af22c Compare September 10, 2024 01:13
@oskirby
Copy link
Contributor Author

oskirby commented Sep 10, 2024

Sorry for the rebasing chaos - I am learning how to sign commits on Github :)

@oskirby oskirby merged commit 6306dcb into mozilla-services:main Sep 10, 2024
5 checks passed
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