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

test(postgres): Allow run postgres tests only on ci Linux platforms #1771

Merged
merged 1 commit into from
Jun 2, 2023

Conversation

Ivansete-status
Copy link
Collaborator

@Ivansete-status Ivansete-status commented May 31, 2023

Summary

Allowing the execution of postgres unit tests on Linux GitHub runners

Note

The next file is only left in order to run local tests manually:
tests/postgres-docker-compose.yml

The ci launches its postgres instance with sudo docker run ...

Issue

#1604

@Ivansete-status Ivansete-status force-pushed the run-postgres-tests-in-ci branch 5 times, most recently from 9e93283 to 3704b5b Compare May 31, 2023 14:25
This is needed because currently the GitHub Actions only supports
starting a docker container in a Linux runners.
@Ivansete-status Ivansete-status marked this pull request as ready for review May 31, 2023 15:42
@@ -106,4 +106,9 @@ jobs:
key: ${{ runner.os }}-vendor-modules-${{ steps.submodules.outputs.hash }}

- name: Run tests
run: make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 test2 testwakunode2
run: |
if [ ${{ runner.os }} == "Linux" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey, people use https://github.com/abiosoft/colima as a workaround to the docker and mac image licensing issues, do you think we can try the same as well?
non-blocker, just curious!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Morning @rymnc ! thanks so much for the suggestion. I take a note to try it in the future when I have more time.

run: make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 test2 testwakunode2
run: |
if [ ${{ runner.os }} == "Linux" ]; then
sudo docker run --rm -d -e POSTGRES_PASSWORD=test123 -p 5432:5432 postgres:9.6-alpine
Copy link
Member

Choose a reason for hiding this comment

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

This should wait for the image pull, so slow connection should not be an issue, but in theory it could take some small amount of time to start the postgres itself, but since the postgres test is not the first to run, we should be fine. Just noting this in case we get into some "race condition" errors in the future:)

Another thing to consider is the Docker Hub rate limits - since you docker client is not authenticated, we could get rate limited on something like IP-range in case many people pull images from Docker Hub in the same time window (adding a docker login with token in secret should solve this in case it happens)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the comments @vpavlin !
Do you want me to tackle the auth issue now or can I merge and take this point into consideration if the problem arises?

Copy link
Member

Choose a reason for hiding this comment

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

Not at all, sorry,, I just meant them as general comments to keep in mind for the future. I forgot to hit "Approve" button:(

@Ivansete-status Ivansete-status merged commit fcd7f33 into master Jun 2, 2023
@Ivansete-status Ivansete-status deleted the run-postgres-tests-in-ci branch June 2, 2023 12:53
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.

4 participants