Skip to content

Commit

Permalink
DO NOT MERGE: hack: Use tox for redis integration suite
Browse files Browse the repository at this point in the history
  • Loading branch information
maybe-sybr committed May 24, 2021
1 parent 2f576ce commit 33d5350
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/lint_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: lint_python
on: [pull_request, push]
jobs:
lint_python:
# XXX: DO NOT MERGE THIS LINE
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
73 changes: 44 additions & 29 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
jobs:
Unit:

# XXX: DO NOT MERGE THIS LINE
if: false

runs-on: ubuntu-20.04
strategy:
fail-fast: false
Expand Down Expand Up @@ -76,26 +79,38 @@ jobs:

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: 15

runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', 'pypy3']
# XXX: RESTORE THIS MATRIX PRIOR TO MERGE
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']

# additional service containers to run
services:
# postgres service
rabbitmq:
# docker hub image
image: rabbitmq
# configure the instance
env:
RABBITMQ_DEFAULT_USER: craiga
RABBITMQ_DEFAULT_PASS: security_is_important
ports:
- 5432:5432
#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 service
redis:
# Docker Hub image
image: redis
Expand All @@ -122,21 +137,21 @@ jobs:
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- 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 dependencies
run: |
python -m pip install -r requirements/dev.txt \
-r requirements/test.txt \
-r requirements/test-ci-default.txt \
-r requirements/test-integration.txt
- name: Run Integration test with pytest / tox /tox-docker
# 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 }}"
run: |
PYTHONPATH=. pytest -xsv t/integration
tox --verbose -e
"${{ matrix.python-version }}-integration-${{ matrix.toxenv }}"

0 comments on commit 33d5350

Please sign in to comment.