Skip to content

Commit f89b369

Browse files
committed
add replica set tests
1 parent 024eef4 commit f89b369

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Python Tests on a replica test
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**.py'
7+
- '!setup.py'
8+
- '.github/workflows/test-python-replica.yml'
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
defaults:
16+
run:
17+
shell: bash -eux {0}
18+
19+
jobs:
20+
build:
21+
name: Django Test Suite
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout django-mongodb-backend
25+
uses: actions/checkout@v4
26+
with:
27+
persist-credentials: false
28+
- name: install django-mongodb-backend
29+
run: |
30+
pip3 install --upgrade pip
31+
pip3 install -e .
32+
- name: Checkout Django
33+
uses: actions/checkout@v4
34+
with:
35+
repository: 'mongodb-forks/django'
36+
ref: 'mongodb-5.2.x'
37+
path: 'django_repo'
38+
persist-credentials: false
39+
- name: Install system packages for Django's Python test dependencies
40+
run: |
41+
sudo apt-get update
42+
sudo apt-get install libmemcached-dev
43+
- name: Install Django and its Python test dependencies
44+
run: |
45+
cd django_repo/tests/
46+
pip3 install -e ..
47+
pip3 install -r requirements/py3.txt
48+
- name: Copy the test settings file
49+
run: cp .github/workflows/mongodb_settings.py django_repo/tests/
50+
- name: Copy the test runner file
51+
run: cp .github/workflows/runtests.py django_repo/tests/runtests_.py
52+
- name: Start MongoDB
53+
uses: supercharge/[email protected]
54+
with:
55+
mongodb-version: 6.0
56+
mongodb-replica-set: test-rs
57+
- name: Run tests
58+
run: python3 django_repo/tests/runtests_.py

0 commit comments

Comments
 (0)