Skip to content

Commit

Permalink
Pipeline for oracle_db thick mode switch
Browse files Browse the repository at this point in the history
  • Loading branch information
amochin committed Nov 6, 2023
1 parent 9950c9c commit 21770c2
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 8 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/oracle_thick_mode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Oracle thick client mode tests

on: [push, pull_request]

env:
DB_MODULE: oracledb
DB_NAME: db
DB_USER: db_user
DB_PASS: pass
DB_HOST: 127.0.0.1
DB_PORT: 1521
LIB_DIR: /opt/oracle/instantclient_21_4

jobs:
tests:
runs-on: ubuntu-latest
services:
oracle:
image: gvenzl/oracle-free:latest
env:
ORACLE_PASSWORD: ${{ env.DB_PASS }}
ORACLE_DATABASE: ${{ env.DB_NAME }}
APP_USER: ${{ env.DB_USER }}
APP_USER_PASSWORD: ${{ env.DB_PASS }}
ports:
- 1521:1521
# Provide healthcheck script options for startup
options: --health-cmd healthcheck.sh --health-interval 10s --health-timeout 5s --health-retries 10

steps:
- name: Install Oracle instant client
run: |
cd /opt/
sudo mkdir /opt/oracle
sudo wget https://download.oracle.com/otn_software/linux/instantclient/214000/instantclient-basic-linux.x64-21.4.0.0.0dbru.zip
sudo unzip instantclient_21_4
- name: Check out repository code
uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.8.14'

- name: Setup Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install Development/Checked out version of DatabaseLibrary
run: |
pip install -e ${{ github.workspace }}
- name: Setup Python DB module
run: |
pip install ${{ env.DB_MODULE }}
- name: Launch RF Tests
working-directory: ./test
run: >-
robot
-d results
--xunit result.xml
--loglevel DEBUG:INFO
-v DB_MODULE:${{ env.DB_MODULE }}
-v DB_NAME:${{ env.DB_NAME }}
-v DB_USER:${{ env.DB_USER }}
-v DB_PASS:${{ env.DB_PASS }}
-v DB_HOST:${{ env.DB_HOST }}
-v DB_PORT:${{ env.DB_PORT }}
-v ORACLE_LIB_DIR: ${{ env.LIB_DIR }}
tests/custom_db_tests/oracle_thick_mode.robot
- name: Upload Robot Logs
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: log-files
path: ./test/results/
25 changes: 17 additions & 8 deletions test/tests/custom_db_tests/oracle_thick_mode.robot
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ Documentation Tests of switching between thin and thick mode of oracledb clie
Resource ../../resources/common.resource


*** Variables ***
${DB_MODULE} oracledb
${DB_HOST} 127.0.0.1
${DB_PORT} 1521
${DB_PASS} pass
${DB_USER} db_user
${DB_NAME} db
${ORACLE_LIB_DIR} ${EMPTY}

*** Test Cases ***
Thin Mode - Default
[Documentation] No mode specified --> thin mode is used
Expand All @@ -21,7 +30,7 @@ Thick Mode Without Client Dir Specified

Thick Mode With Client Dir Specified
[Documentation] Client dir specified --> oracledb will search it in this place
Connect And Run Simple Query driverMode=thick,lib_dir=
Connect And Run Simple Query driverMode=thick,lib_dir=${ORACLE_LIB_DIR}

Wrong Mode
[Documentation] Wrong mode --> proper error message from the library
Expand All @@ -31,20 +40,20 @@ Wrong Mode
Thick Mode With Wrong Client Dir
[Documentation] Wrong mode --> proper error message from oracledb module
Run Keyword And Expect Error expected_error
... Connect And Run Simple Query driverMode=thick,lib_dir=C:\WRONG
... Connect And Run Simple Query driverMode=thick,lib_dir=C:/WRONG


*** Keywords ***
Connect And Run Simple Query
[Documentation] Connect using usual params and client mode if provided
[Arguments] &{Extra params}
Connect To Database
... oracledb
... 127.0.0.1
... 1521
... db
... db_user
... pass
... ${DB_MODULE}
... ${DB_NAME}
... ${DB_USER}
... ${DB_PASS}
... ${DB_HOST}
... ${DB_PORT}
... &{Extra params}
Create Person Table
Query SELECT * FROM person

0 comments on commit 21770c2

Please sign in to comment.