Skip to content

Commit

Permalink
Test without prepared statements against postgresql
Browse files Browse the repository at this point in the history
Signed-off-by: Rodrigo Tobar <[email protected]>
  • Loading branch information
rtobar committed Feb 8, 2024
1 parent b3b0502 commit f71bf1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build-and-test-ngas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ jobs:
test_number: 5
- python: 3.9
db: mysql
sql_mode: no_prepared_statement
use_prepared_statements: false
test_number: 6
- python: 3.9
db: postgresql
use_prepared_statements: false
test_number: 7
runs-on: ubuntu-20.04

steps:
Expand All @@ -60,7 +64,7 @@ jobs:
run: .travis/run_tests.sh
env:
DB: ${{ matrix.db }}
SQL_MODE: ${{ matrix.sql_mode }}
USE_PREPARED_STATEMENTS: ${{ matrix.use_prepared_statements }}

- name: Install coveralls
run: pip install 'coverage<5' coveralls
Expand Down
8 changes: 3 additions & 5 deletions .travis/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,11 @@ coverage report
# These are the user/dbname/passwd that we created on run_build
# sqlite3 is the default so it needs no special attention
NGAS_TESTDB=
use_prepared_statements_attr='UsePreparedStatements="'${USE_PREPARED_STATEMENTS:-true}'"'
if [[ "$DB" == "mysql" ]]; then
NGAS_TESTDB='<Db Id="blah" Snapshot="0" Interface="MySQLdb" host="127.0.0.1" database="ngas" user="ngas" password="ngas"/>'
if [[ "$SQL_MODE" == "no_prepared_statement" ]]; then
NGAS_TESTDB='<Db Id="blah" Snapshot="0" Interface="MySQLdb" UsePreparedStatement="false" host="127.0.0.1" database="ngas" user="ngas" password="ngas"/>'
fi
NGAS_TESTDB='<Db Id="blah" Snapshot="0" Interface="MySQLdb" host="127.0.0.1" database="ngas" user="ngas" password="ngas" '$use_prepared_statements_attr'/>'
elif [[ "$DB" == "postgresql" ]]; then
NGAS_TESTDB='<Db Id="blah" Snapshot="0" Interface="psycopg2" host="127.0.0.1" dbname="ngas" user="ngas" password="ngas"/>'
NGAS_TESTDB='<Db Id="blah" Snapshot="0" Interface="psycopg2" host="127.0.0.1" dbname="ngas" user="ngas" password="ngas" '$use_prepared_statements_attr'/>'
fi
export NGAS_TESTDB

Expand Down

0 comments on commit f71bf1a

Please sign in to comment.