Skip to content

Commit a1a30d9

Browse files
committed
add oracle to CI #33
1 parent a356a2f commit a1a30d9

File tree

4 files changed

+81
-23
lines changed

4 files changed

+81
-23
lines changed

.github/workflows/test.yml

+64-9
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,9 @@ jobs:
145145
django-version: 'Django~=3.2.0'
146146

147147
steps:
148-
- uses: actions/checkout@v2
149-
- uses: actions/setup-node@v2
148+
- uses: actions/checkout@v3
150149
- name: Set up Python ${{ matrix.python-version }}
151-
uses: actions/setup-python@v2
150+
uses: actions/setup-python@v4
152151
with:
153152
python-version: ${{ matrix.python-version }}
154153

@@ -212,10 +211,9 @@ jobs:
212211
- 3306:3306
213212

214213
steps:
215-
- uses: actions/checkout@v2
216-
- uses: actions/setup-node@v2
214+
- uses: actions/checkout@v3
217215
- name: Set up Python ${{ matrix.python-version }}
218-
uses: actions/setup-python@v2
216+
uses: actions/setup-python@v4
219217
with:
220218
python-version: ${{ matrix.python-version }}
221219

@@ -280,10 +278,9 @@ jobs:
280278
- 3306:3306
281279

282280
steps:
283-
- uses: actions/checkout@v2
284-
- uses: actions/setup-node@v2
281+
- uses: actions/checkout@v3
285282
- name: Set up Python ${{ matrix.python-version }}
286-
uses: actions/setup-python@v2
283+
uses: actions/setup-python@v4
287284
with:
288285
python-version: ${{ matrix.python-version }}
289286

@@ -302,3 +299,61 @@ jobs:
302299
- name: Run Full Unit Tests
303300
run: |
304301
poetry run pytest --cov-fail-under=95
302+
303+
oracle:
304+
runs-on: ubuntu-latest
305+
env:
306+
DATABASE: oracle
307+
strategy:
308+
matrix:
309+
python-version: [ '3.7', '3.11']
310+
django-version:
311+
- 'Django~=3.2.0' # LTS April 2024
312+
- 'Django~=4.2.0' # LTS April 2026
313+
exclude:
314+
- python-version: '3.7'
315+
django-version: 'Django~=4.2.0'
316+
- python-version: '3.11'
317+
django-version: 'Django~=3.2.0'
318+
319+
services:
320+
oracle:
321+
322+
image: gvenzl/oracle-free:latest
323+
324+
env:
325+
ORACLE_PASSWORD: password
326+
ORACLE_DATABASE: test
327+
328+
# Forward Oracle port
329+
ports:
330+
- 1521:1521
331+
332+
# Provide healthcheck script options for startup
333+
options: >-
334+
--health-cmd healthcheck.sh
335+
--health-interval 10s
336+
--health-timeout 5s
337+
--health-retries 10
338+
339+
steps:
340+
- uses: actions/checkout@v3
341+
- name: Set up Python ${{ matrix.python-version }}
342+
uses: actions/setup-python@v4
343+
with:
344+
python-version: ${{ matrix.python-version }}
345+
346+
- name: Install Poetry
347+
uses: snok/install-poetry@v1
348+
with:
349+
virtualenvs-create: true
350+
virtualenvs-in-project: true
351+
- name: Install Dependencies
352+
run: |
353+
poetry config virtualenvs.in-project true
354+
poetry run pip install --upgrade pip
355+
poetry install -E all --with oracle
356+
poetry run pip install -U "${{ matrix.django-version }}"
357+
- name: Run Full Unit Tests
358+
run: |
359+
poetry run pytest --cov-fail-under=95

README.rst

+10-4
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,18 @@ Like with Django, Postgres is the preferred database for support. The full
221221
test suite and static analysis is run against all combinations of currently
222222
supported versions of Django, Python, and Postgres as well as psycopg3 and
223223
psycopg2. The other RDBMS supported by Django are also tested including SQLite,
224-
MySQL, MariaDB and Oracle. For these RDBMS, tests are run against the minimum
225-
and maximum supported version combinations to maximize coverage breadth. For
226-
example, as of the release of Django 4.2.0 the following combinations of
227-
Python, Django and MySQL are tested:
224+
MySQL, MariaDB and Oracle. For these RDBMS (with the exception of Oracle),
225+
tests are run against the minimum and maximum supported version combinations to
226+
maximize coverage breadth. For example, as of the release of Django 4.2.0 the
227+
following combinations of Python, Django and MySQL are tested:
228228

229229
.. code::
230230
231231
Python 3.7, Django 3.2, MySQL 5.7, mysqlclient 1.4.0
232232
Python 3.11, Django 4.2, MySQL 8.0, mysqlclient 2.1.1
233+
234+
.. note::
235+
236+
For Oracle, only the latest version of the free database is tested against
237+
the minimum and maximum supported versions of Python, Django and the
238+
cx-Oracle driver.

django_enum/tests/settings.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@
5656
'default': {
5757
'ENGINE': 'django.db.backends.oracle',
5858
'NAME': os.environ.get('ORACLE_DATABASE', 'test'),
59-
'USER': os.environ.get('ORACLE_USER', 'root'),
60-
'PASSWORD': os.environ.get('ORACLE_PASSWORD', ''),
61-
'HOST': os.environ.get('ORACLE_HOST', ''),
62-
'PORT': os.environ.get('ORACLE_PORT', ''),
59+
'USER': os.environ.get('ORACLE_USER', 'system'),
60+
'PASSWORD': os.environ.get('ORACLE_PASSWORD', 'password'),
61+
'HOST': os.environ.get('ORACLE_HOST', 'localhost'),
62+
'PORT': os.environ.get('ORACLE_PORT', 1521),
6363
}
6464
}
6565

pyproject.toml

+3-6
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ importlib-metadata = [
6969
{ version = ">=5.0", markers = "python_version > '3.7'" },
7070
]
7171

72-
[tool.poetry.group.psycopg2]
73-
optional = true
74-
75-
[tool.poetry.group.psycopg3]
76-
optional = true
77-
7872
[tool.poetry.group.psycopg2.dependencies]
7973
psycopg2 = "^2.5.4"
8074

@@ -84,6 +78,9 @@ psycopg = "^3.1.8"
8478
[tool.poetry.group.mysql.dependencies]
8579
mysqlclient = ">=1.4.0"
8680

81+
[tool.poetry.group.oracle.dependencies]
82+
cx-Oracle = '>=6.0.0'
83+
8784
[build-system]
8885
requires = ["poetry-core>=1.0.0"]
8986
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)