diff --git a/.github/workflows/oracle_thick_mode.yml b/.github/workflows/oracle_thick_mode.yml new file mode 100644 index 0000000..59e6bb0 --- /dev/null +++ b/.github/workflows/oracle_thick_mode.yml @@ -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/ diff --git a/test/tests/custom_db_tests/oracle_thick_mode.robot b/test/tests/custom_db_tests/oracle_thick_mode.robot index 85dc3c7..ee42798 100644 --- a/test/tests/custom_db_tests/oracle_thick_mode.robot +++ b/test/tests/custom_db_tests/oracle_thick_mode.robot @@ -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 @@ -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 @@ -31,7 +40,7 @@ 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 *** @@ -39,12 +48,12 @@ 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