-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Integration test & unit tests jobs separation #6649
Changes from all commits
aee2f1d
5b45684
df5d3f5
84f5531
9ed6e05
3fdac3c
8210dff
ed47bfd
3320eba
93659df
762668e
12a67c2
a1ae742
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ on: | |
- '.github/workflows/python-package.yml' | ||
|
||
jobs: | ||
build: | ||
Unit: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
|
@@ -85,3 +85,83 @@ jobs: | |
run: python -m pip install tox | ||
- name: Lint with pre-commit | ||
run: tox --verbose -e lint | ||
|
||
|
||
Integration: | ||
|
||
needs: | ||
- Unit | ||
# XXX: DO NOT MERGE THIS LINE | ||
if: ${{ always() }} | ||
|
||
# XXX: We should set this to some reasonable maximum prior to merge. The | ||
# default 6 hour timeout is far too long. | ||
timeout-minutes: 240 | ||
|
||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.7', '3.8', '3.9', 'pypy3'] | ||
# XXX: Does each matrix variation get their own copy of the service | ||
# containers? Test cross-talk may be an issue... | ||
toxenv: ['redis', ] #'rabbitmq'] | ||
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. This should probably actually be called |
||
|
||
# additional service containers to run | ||
services: | ||
#rabbitmq: | ||
# # docker hub image | ||
# image: rabbitmq | ||
# # configure the instance | ||
# env: | ||
# # XXX: If we set these, we need to set TEST_{BROKER,BACKEND} URIs | ||
# RABBITMQ_DEFAULT_USER: craiga | ||
# RABBITMQ_DEFAULT_PASS: security_is_important | ||
# ports: | ||
# - 5432:5432 | ||
|
||
redis: | ||
# Docker Hub image | ||
image: redis | ||
ports: | ||
- 6379:6379 | ||
# configure the instance | ||
env: | ||
# The hostname used to communicate with the Redis service container | ||
REDIS_HOST: localhost | ||
# The default Redis port | ||
REDIS_PORT: 6379 | ||
|
||
steps: | ||
- name: Install apt packages | ||
run: | | ||
sudo apt-get install -f libcurl4-openssl-dev libssl-dev gnutls-dev httping expect libmemcached-dev | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Get pip cache dir | ||
id: pip-cache | ||
run: | | ||
echo "::set-output name=dir::$(pip cache dir)" | ||
# XXX: What does this do? Does using tox change its usefulness? | ||
#- name: Cache | ||
# uses: actions/cache@v2 | ||
# with: | ||
# path: ${{ steps.pip-cache.outputs.dir }} | ||
# key: | ||
# ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }} | ||
# restore-keys: | | ||
# ${{ matrix.python-version }}-v1- | ||
|
||
- name: Install tox | ||
run: python -m pip install tox | ||
- name: > | ||
Run tox for | ||
"${{ matrix.python-version }}-integration-${{ matrix.toxenv }}" | ||
timeout-minutes: 20 | ||
run: > | ||
tox --verbose --verbose -e | ||
"${{ matrix.python-version }}-integration-${{ matrix.toxenv }}" -- -vv |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
pytest-cov | ||
pytest-travis-fold | ||
codecov | ||
-r extras/redis.txt | ||
-r extras/sqlalchemy.txt | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,7 +117,7 @@ def test_active(self, inspect): | |
'exchange': '', | ||
'routing_key': 'celery', | ||
'priority': 0, | ||
'redelivered': False | ||
'redelivered': ANY, | ||
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. I'm not sure why these tests stopped passing. AFAICT the I'd like for someone a bit more familiar with redelivery logic to think about this if possible. I just don't know what we should be expecting here and why it's not 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.
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. I'll see if I can find some time later this week |
||
}, | ||
'worker_pid': ANY | ||
} | ||
|
@@ -147,7 +147,7 @@ def test_scheduled(self, inspect): | |
'exchange': '', | ||
'routing_key': 'celery', | ||
'priority': 0, | ||
'redelivered': False | ||
'redelivered': ANY, | ||
}, | ||
'worker_pid': None | ||
} | ||
|
@@ -181,7 +181,7 @@ def test_query_task(self, inspect): | |
'exchange': '', | ||
'routing_key': 'celery', | ||
'priority': 0, | ||
'redelivered': False | ||
'redelivered': ANY, | ||
}, | ||
# worker is running in the same process as separate thread | ||
'worker_pid': ANY | ||
|
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.
We need to set the integration tests to only run after the unit tests to save resources.
See syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idneeds