-
Notifications
You must be signed in to change notification settings - Fork 40
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
Define db and ssh test markers and run db tests in ci pipeline #279
Conversation
If we are marking these tests as |
I agree with @danielolsen. Also, perhaps the marker name integration is not well chosen or could be more explicit. What do you think of |
I suppose we could name the marks anything as long as we can select subsets of tests for our purposes. My thinking was that |
I definitely see the value in having a 'no external dependencies' flag to run with pytest. Right now the description for |
I will update the description of
|
- name: Start postgres container | ||
run: | | ||
docker-compose -f stack.yml up -d | ||
while ! nc -z localhost 5432; do sleep 1; done; |
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.
The loop waits for the container to start, otherwise tests can fail due to race condition. nc -z
checks if the port is listening.
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8] | ||
|
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.
What's going on with these changes?
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.
They kinda snuck in from the branch I was testing on, but kept it since the simpler approach seemed better. Github treats 3.x
as the latest minor release which I think is currently 3.8.5, so should be compatible with 3.8.3 which we mainly use. I think the main reason to test older versions is if we were distributing this for installation in other environments and wanted the flexibility. So I didn't see it adding much value, but don't mind keeping it if there's a use case.
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.
Sounds good
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! This will definitely make local development easier.
Purpose
Allow selecting db tests specifically, or filtering them out to run other integration tests, e.g.
pytest -m 'not db'
. Run db tests in github action.What it does
Define the
db
mark inpytest.ini
and apply it to relevant tests, in addition to theintegration
mark. Also defined thessh
mark to deselect those from github test runs, while selecting just those locally. New step was added to the ci.yml
to start the db container, enabling tests to run against it.Time to review
10 min