-
Notifications
You must be signed in to change notification settings - Fork 187
125 lines (106 loc) · 3.65 KB
/
integration_tests.yml
File metadata and controls
125 lines (106 loc) · 3.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: integration tests
on:
push:
branches: [ main ]
pull_request:
jobs:
# 1. Build the library (sdist) and store it as an artifact
build_lib:
name: Build Distribution
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build sdist
run: |
pip install '.[dev]'
# Use python build module (modern replacement for make sdist)
python -m build --sdist
# Rename to a consistent name for the test jobs
mv dist/mozilla_django_oidc-*.tar.gz dist/mozilla-django-oidc-dev.tar.gz
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: dist-package
path: dist/mozilla-django-oidc-dev.tar.gz
retention-days: 1
# 2. Run the Matrix of E2E Tests
e2e_tests:
name: E2E (Py${{ matrix.python }} / ${{ matrix.django_name }} / ${{ matrix.algo }})
needs: build_lib
runs-on: ubuntu-latest
# Run inside the specific Docker container for the Python version
container:
image: mozilla/oidc-testprovider:oidc_e2e_setup_py${{ matrix.python }}-latest
options: --user root
strategy:
fail-fast: false
matrix:
# Define the base dimensions
python: ['310', '311', '312', '313', '314']
algo: ['rs', 'hs']
django_name: ['django420', 'django50', 'django51', 'django52']
# Define the Django version mapping
include:
- django_name: 'django420'
django_spec: 'Django>=4.2,<5.0'
- django_name: 'django50'
django_spec: 'Django>=5.0,<5.1'
- django_name: 'django51'
django_spec: 'Django>=5.1,<5.2'
- django_name: 'django52'
django_spec: 'Django>=5.2,<5.3'
exclude:
# Python 3.13 only supports Django 5.1+ in this config
- python: '313'
django_name: 'django420'
- python: '313'
django_name: 'django50'
# Python 3.14 only supports Django 5.2+ in this config
- python: '314'
django_name: 'django420'
- python: '314'
django_name: 'django50'
- python: '314'
django_name: 'django51'
env:
TEST_OIDC_ALGO: ${{ matrix.algo }}
DJANGO_VERSION: ${{ matrix.django_spec }}
HOME: /root
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Build Artifact
uses: actions/download-artifact@v4
with:
name: dist-package
path: /tmp/workspace
- name: Setup /etc/hosts
run: |
echo "127.0.0.1 testrp" >> /etc/hosts
echo "127.0.0.1 testprovider" >> /etc/hosts
- name: Install Lib and Dependencies
run: |
. /testrp_env/bin/activate
# Use [test] extra to pull in splinter[selenium]
pip install /tmp/workspace/mozilla-django-oidc-dev.tar.gz[test]
pip install "$DJANGO_VERSION"
- name: Start Background Services
run: |
# Start Provider in background
(. /testprovider_env/bin/activate && cd /testprovider && ./bin/run.sh) &
# Start RP in background
(. /testrp_env/bin/activate && cd /testrp && ./bin/run.sh) &
- name: Wait for Services
run: |
wait-for-it -p 8080 -h localhost -t 60
wait-for-it -p 8081 -h localhost -t 60
- name: Run Integration Tests
working-directory: integration_tests
run: |
. /testrp_env/bin/activate
python integration_tests.py