Skip to content

Added changes for dbt-oracle 1.8 #339

Added changes for dbt-oracle 1.8

Added changes for dbt-oracle 1.8 #339

name: dbt-tests-adapter
on: push
jobs:
oracle_xe_21_3:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12']
services:
oracle_db_xe:
image: container-registry.oracle.com/database/express:21.3.0-xe
env:
ORACLE_PWD: ${{ secrets.DBT_ORACLE_PASSWORD }}
options: --name oracle_db_xe
ports:
- 1521:1521
steps:
- name: Check out dbt-oracle repository code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Oracle Instantclient
run: |
chmod +x ${{ github.workspace }}/.github/scripts/install_oracle_instantclient.sh
${{ github.workspace }}/.github/scripts/install_oracle_instantclient.sh
- name: Copy Create User script
run: |
chmod +x ${{ github.workspace }}/.github/scripts/create_new_user.sh
docker cp ${{ github.workspace }}/.github/scripts/create_new_user.sh oracle_db_xe:/home/oracle/create_new_user.sh
- name: Create dbt test users
run: |
docker exec oracle_db_xe /home/oracle/create_new_user.sh dbt_test ${{ secrets.DBT_ORACLE_PASSWORD }}
docker exec oracle_db_xe /home/oracle/create_new_user.sh dbt_test_user_1 ${{ secrets.DBT_ORACLE_PASSWORD }}
docker exec oracle_db_xe /home/oracle/create_new_user.sh dbt_test_user_2 ${{ secrets.DBT_ORACLE_PASSWORD }}
docker exec oracle_db_xe /home/oracle/create_new_user.sh dbt_test_user_3 ${{ secrets.DBT_ORACLE_PASSWORD }}
- name: Install dbt-oracle with core dependencies
run: |
python -m pip install --upgrade pip
pip install pytest 'dbt-tests-adapter~=1.7,<1.8'
pip install -r requirements.txt
pip install -e .
- name: Check create-pem-from-p12 script is installed in bin
run: |
create-pem-from-p12 --help
- name: Run adapter tests - ORA_PYTHON_DRIVER_TYPE => THICK
run: |
pytest -v
env:
ORA_PYTHON_DRIVER_TYPE: THICK
DBT_ORACLE_USER: DBT_TEST
DBT_ORACLE_HOST: localhost
DBT_ORACLE_PORT: 1521
DBT_ORACLE_SCHEMA: DBT_TEST
DBT_ORACLE_PASSWORD: ${{ secrets.DBT_ORACLE_PASSWORD }}
DBT_ORACLE_DATABASE: XEPDB1
DBT_ORACLE_SERVICE: XEPDB1
DBT_ORACLE_PROTOCOL: tcp
LD_LIBRARY_PATH: /opt/oracle/instantclient_21_6
TNS_ADMIN: /opt/tns_admin
DBT_TEST_USER_1: DBT_TEST_USER_1
DBT_TEST_USER_2: DBT_TEST_USER_2
DBT_TEST_USER_3: DBT_TEST_USER_3
- name: Run adapter tests - ORA_PYTHON_DRIVER_TYPE => THIN
run: |
pytest -v
env:
ORA_PYTHON_DRIVER_TYPE: THIN
DBT_ORACLE_USER: DBT_TEST
DBT_ORACLE_HOST: localhost
DBT_ORACLE_PORT: 1521
DBT_ORACLE_SCHEMA: DBT_TEST
DBT_ORACLE_PASSWORD: ${{ secrets.DBT_ORACLE_PASSWORD }}
DBT_ORACLE_DATABASE: XEPDB1
DBT_ORACLE_SERVICE: XEPDB1
DBT_ORACLE_PROTOCOL: tcp
DISABLE_OOB: on
TNS_ADMIN: /opt/tns_admin
DBT_TEST_USER_1: DBT_TEST_USER_1
DBT_TEST_USER_2: DBT_TEST_USER_2
DBT_TEST_USER_3: DBT_TEST_USER_3