Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions .github/docker-compose-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,5 @@ services:
environment:
MYSQL_ROOT_PASSWORD: ""
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"

xqueue:
container_name: xqueue
image: edxops/xqueue-dev:latest
command: tail -f /dev/null
volumes:
- ..:/edx/app/xqueue/xqueue
depends_on:
- mysql80
environment:
RABBIT_HOST: "rabbit"
ports:
- "3306:3306"
27 changes: 10 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['py311', 'py312']
python-version:
- "3.11"
- "3.12"
env-name: ['django42','django52', 'quality']
db-version: ['mysql80']

Expand All @@ -24,23 +26,14 @@ jobs:
run: |
docker compose -f .github/docker-compose-ci.yml up -d

- name: Setup Python ${{ matrix.python-version }} inside container
run: |
PY_VER=$(if [ "${{ matrix.python-version }}" = "py312" ]; then echo "3.12"; else echo "3.11"; fi)

docker exec xqueue bash -c "
apt update &&
apt install -y software-properties-common curl &&
add-apt-repository ppa:deadsnakes/ppa -y &&
apt install -y python$PY_VER python$PY_VER-dev python$PY_VER-venv &&
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python$PY_VER 1 &&
python$PY_VER -m venv /tmp/venv &&
/tmp/venv/bin/pip install --upgrade pip
"
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install test dependencies and run tests
env:
TOXENV: ${{ matrix.python-version }}-${{ matrix.env-name }}
TOXENV: ${{ matrix.env-name }}
run: |
docker exec xqueue bash -c "cd /edx/app/xqueue/xqueue/; /tmp/venv/bin/pip install -r requirements/ci.txt"
docker exec xqueue bash -c "cd /edx/app/xqueue/xqueue/ && DB_HOST=${{ matrix.db-version }} tox -e ${TOXENV}"
pip install -r requirements/ci.txt"
tox -e ${TOXENV}"
4 changes: 2 additions & 2 deletions xqueue/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'USER': os.environ.get('DB_USER', ''),
'USER': os.environ.get('DB_USER', 'root'),
'PASSWORD': os.environ.get('DB_PASSWORD', ''),
# pytest/django TestCase instances auto-prefix test_ onto the NAME
'NAME': 'xqueue',
'HOST': os.environ.get('DB_HOST', 'edx.devstack.mysql80'),
'HOST': '127.0.0.1',
# Wrap all view methods in an atomic transaction automatically.
'ATOMIC_REQUESTS': True
}
Expand Down
Loading