Skip to content

Merge pull request #218 from lemenkov/oracle-9i-fv2-describe-nullok-97 #278

Merge pull request #218 from lemenkov/oracle-9i-fv2-describe-nullok-97

Merge pull request #218 from lemenkov/oracle-9i-fv2-describe-nullok-97 #278

Workflow file for this run

# SPDX-FileCopyrightText: © 2026 Peter Lemenkov
# SPDX-License-Identifier: CC0-1.0
name: Tests
on:
push:
branches: [master]
# Docs-only changes don't affect the driver, so skip the (expensive, live-
# Oracle) test runs when nothing outside these paths changed. A commit that
# also touches code still runs — the filter only skips when every changed
# file matches. (CI budget, #7)
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSES/**'
pull_request:
branches: [master]
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSES/**'
# Cancel a superseded run when a new commit is pushed to the same ref, so rapid
# pushes don't stack up and exhaust the Actions concurrency/usage budget.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Unit tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
# Install the package so runtime deps (pycryptodome, tzdata) are present
# for every offline module. The DB-backed integration tests skip
# automatically without PYORACLE_TEST_USER.
- run: pip install .
- run: >-
python -m unittest -v
tests.test_crypto
tests.test_tns_decode
tests.test_tns_encode
tests.test_tns_types
tests.test_api_conveniences
tests.test_connection
# Integration tests against a real Oracle server, run across three testbeds
# (#28, #52): 11g (:1521/XE), 21c (:1521/XEPDB1, field version 16) and 23ai
# Free (:1521/FREEPDB1, field version 17). fail-fast is off so a flake on one
# DB doesn't cancel the others; a generous --shm-size keeps the memory-fragile
# 21c/23ai containers from OOM-stalling under the suite.
integration:
name: Integration tests (${{ matrix.db.name }})
runs-on: ubuntu-latest
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
db:
- name: "Oracle XE 11g"
image: "gvenzl/oracle-xe:11-slim"
service: "XE"
field_version: "0"
- name: "Oracle XE 21c"
image: "gvenzl/oracle-xe:21-slim"
service: "XEPDB1"
field_version: "16"
- name: "Oracle 23ai Free"
image: "gvenzl/oracle-free:23-slim"
service: "FREEPDB1"
field_version: "17"
services:
oracle:
image: ${{ matrix.db.image }}
env:
ORACLE_PASSWORD: oracle
APP_USER: pyo
APP_USER_PASSWORD: pyo123
ports:
- 1521:1521
# The gvenzl image ships healthcheck.sh; wait for first-boot setup
# (slower on 21c) before the test step. --shm-size gives the 21c
# instance enough shared memory to run the full suite without OOM.
options: >-
--health-cmd healthcheck.sh
--health-interval 10s
--health-timeout 5s
--health-retries 40
--health-start-period 90s
--shm-size=2g
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- run: pip install .
- name: Run integration suite against ${{ matrix.db.name }}
env:
PYORACLE_TEST_USER: pyo
PYORACLE_TEST_PASSWORD: pyo123
PYORACLE_TEST_HOST: localhost
PYORACLE_TEST_PORT: "1521"
PYORACLE_TEST_SERVICE: ${{ matrix.db.service }}
PYORACLE_TEST_FIELD_VERSION: ${{ matrix.db.field_version }}
# Pace logins under XE's logon-storm throttle (ORA-01013), and retry a
# whole test that still trips it.
PYORACLE_TEST_CONNECT_DELAY: "0.25"
PYORACLE_TEST_THROTTLE_RETRIES: "4"
PYORACLE_TEST_THROTTLE_DELAY: "1.0"
run: python -m unittest -v tests.test_integration