Skip to content
Merged
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
4 changes: 3 additions & 1 deletion .docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ services:
profiles: ["oracle"]
image: gvenzl/oracle-free:23-slim
environment:
ORACLE_PASSWORD: ${ORACLE_PASSWORD:-oraclepw}
# SYS password. Not ORACLE_PASSWORD on the host side: the tests use that
# name for the APP_USER password they connect with.
ORACLE_PASSWORD: ${ORACLE_SYS_PASSWORD:-oraclepw}
APP_USER: ${ORACLE_APP_USER:-apptest}
APP_USER_PASSWORD: ${ORACLE_APP_PASSWORD:-apptestpw}
ports:
Expand Down
14 changes: 10 additions & 4 deletions .docker/oracle/init/01-schema.sql
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
-- Functional-test fixture for Oracle (gvenzl/oracle-free).
-- Executed inside the FREEPDB1 pluggable database as the APP_USER.
-- Covers every Oracle source type referenced by
-- db2sql/infrastructure/emit/postgres/emitter.py:DEFAULT_TYPE_MAP, plus an
-- IDENTITY column (12c+), a foreign key and a non-unique index.
--
-- Notes:
-- * The script targets the per-PDB connection set up by gvenzl/oracle-free,
-- so the current user is APP_USER (APPTEST). Tables are created in that
-- schema; the reader filters on owner = 'APPTEST'.
-- * gvenzl runs *.sql init files with `sqlplus / as sysdba`, so we start out
-- as SYS in the CDB root. Hence the two ALTER SESSION below: without them
-- the tables end up in SYS and APPTEST stays empty.
-- * PDB and schema names are hardcoded — keep them in sync with
-- ORACLE_APP_USER in .docker/docker-compose.yml.
-- * LONG can only be used once per table, so it lives in its own table.

WHENEVER SQLERROR EXIT SQL.ERROR;

ALTER SESSION SET CONTAINER = FREEPDB1;
ALTER SESSION SET CURRENT_SCHEMA = APPTEST;

ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS';
ALTER SESSION SET NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH24:MI:SS.FF';
ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT='YYYY-MM-DD HH24:MI:SS.FF TZH:TZM';
Expand Down
26 changes: 22 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:

- name: Upload stack logs artifact
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: docker-stack-logs-functional
path: artifacts/
Expand All @@ -170,10 +170,13 @@ jobs:
ORACLE_HOST: localhost
ORACLE_PORT: "1521"
ORACLE_SERVICE: FREEPDB1
ORACLE_PASSWORD: oraclepw
# Read by docker compose to bootstrap the container
ORACLE_SYS_PASSWORD: oraclepw
ORACLE_APP_USER: apptest
ORACLE_APP_PASSWORD: apptestpw
# Read by the pytest fixtures — they connect as the app user, not SYS
ORACLE_USER: apptest
ORACLE_PASSWORD: apptestpw
steps:
- uses: actions/checkout@v4

Expand All @@ -189,7 +192,22 @@ jobs:
run: pip install -e ".[all]" pytest

- name: Start Oracle container and wait until healthy
run: docker compose -f .docker/docker-compose.yml --profile oracle up -d --wait
run: docker compose -f .docker/docker-compose.yml --profile oracle up -d --wait oracle

# The container is healthy even when the init SQL failed, and the tests
# then fail on a missing schema. Cheaper to catch it here.
- name: Verify Oracle fixture schema
run: |
docker compose -f .docker/docker-compose.yml --profile oracle exec -T oracle \
sqlplus -s -L "${ORACLE_USER}/${ORACLE_PASSWORD}@//localhost:1521/${ORACLE_SERVICE}" <<'SQL' | tee fixture-check.txt
set heading off pagesize 0 feedback off
SELECT 'FIXTURE_TABLES=' || COUNT(*) FROM user_tables;
exit;
SQL
grep -qE 'FIXTURE_TABLES=[1-9]' fixture-check.txt || {
echo "::error::Oracle init script did not create the ${ORACLE_USER} fixture — see the container logs";
exit 1;
}

- name: Run Oracle functional tests
run: pytest -m oracle tests/functional -v
Expand All @@ -203,7 +221,7 @@ jobs:

- name: Upload Oracle logs artifact
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: docker-stack-logs-oracle
path: artifacts/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
run: python installer/build.py --archive

- name: Upload build artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: db2sql-${{ matrix.label }}
path: ${{ matrix.archive-glob }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:

- name: Upload Python distributions
if: steps.release.outputs.released == 'true' && inputs.dry-run == false
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: python-dist
path: dist/*
Expand Down
Loading