-
Notifications
You must be signed in to change notification settings - Fork 54
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
Conversation
9e93283
to
3704b5b
Compare
This is needed because currently the GitHub Actions only supports starting a docker container in a Linux runners.
3704b5b
to
6161723
Compare
@@ -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 |
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.
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!
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.
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 |
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 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)
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.
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?
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.
Not at all, sorry,, I just meant them as general comments to keep in mind for the future. I forgot to hit "Approve" button:(
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