From a6f73e9c50a6e1da4a1cb38273acd9eb1b0a7fb7 Mon Sep 17 00:00:00 2001 From: HarshLunagariya <40052763+HarshLunagariya@users.noreply.github.com> Date: Thu, 17 Nov 2022 16:45:47 +0530 Subject: [PATCH] Fix Test Failures in Github Action Due to new version of pyodbc (#854) The Github Actions for Python Framework and Upgrade Validation framework started Failing Due to new release of Pyodbc. There is a diff in expected output file due to this version Change More details about the issue can be found here - mkleehammer/pyodbc#1082 Task: BABEL-OSS Signed-off-by: Nirmit Shah nirmisha@amazon.com --- .github/workflows/python-tests.yml | 3 ++- test/python/expected/pyodbc/TestAuth.out | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 97af13cc4d..7931810c39 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -48,7 +48,7 @@ jobs: curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list cd ~/work/babelfish_extensions/babelfish_extensions/test/python sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17 python3-dev - pip3 install pyodbc pymssql pytest pytest-xdist + pip3 install pyodbc==4.0.35 pymssql pytest pytest-xdist - name: Run Python Tests if: always() && steps.configure-python-environment.outcome == 'success' @@ -64,4 +64,5 @@ jobs: fileGenerator_databaseName=master \ fileGenerator_user=jdbc_user \ fileGenerator_password=12345678 \ + LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/odbc/ \ pytest -s --tb=long -q . diff --git a/test/python/expected/pyodbc/TestAuth.out b/test/python/expected/pyodbc/TestAuth.out index 8125850a7b..3e00aef7f5 100644 --- a/test/python/expected/pyodbc/TestAuth.out +++ b/test/python/expected/pyodbc/TestAuth.out @@ -1,26 +1,26 @@ #database name, username and password should not exceed 128 characters py_auth#!#database|-|11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 ~~ERROR (Code: 3701)~~ -~~ERROR (Message: [42S02] [unixODBC][Microsoft][ODBC Driver 17 for SQL Server][SQL Server]database "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" does not exist (3701) (SQLDriverConnect))~~ +~~ERROR (Message: [42S02] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]database "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" does not exist (3701) (SQLDriverConnect))~~ py_auth#!#database|-|111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112 ~~ERROR (Code: 0)~~ -~~ERROR (Message: [08001] [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]Invalid value specified for connection string attribute 'DATABASE' (0) (SQLDriverConnect))~~ +~~ERROR (Message: [08001] [Microsoft][ODBC Driver 17 for SQL Server]Invalid value specified for connection string attribute 'DATABASE' (0) (SQLDriverConnect))~~ py_auth#!#user|-|11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 ~~ERROR (Code: 33557097)~~ -~~ERROR (Message: [42000] [unixODBC][Microsoft][ODBC Driver 17 for SQL Server][SQL Server]role "111111111111111111111111111111111111111111111111111111111111111" does not exist (33557097) (SQLDriverConnect))~~ +~~ERROR (Message: [42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]role "111111111111111111111111111111111111111111111111111111111111111" does not exist (33557097) (SQLDriverConnect))~~ py_auth#!#user|-|111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112 ~~ERROR (Code: 0)~~ -~~ERROR (Message: [08001] [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]Invalid value specified for connection string attribute 'UID' (0) (SQLDriverConnect))~~ +~~ERROR (Message: [08001] [Microsoft][ODBC Driver 17 for SQL Server]Invalid value specified for connection string attribute 'UID' (0) (SQLDriverConnect))~~ #not sure why any password is accepted during authentication through cloud desktop #This test should throw error but from cloud desktop a connection is successfully established #py_auth#!#password|-|11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 py_auth#!#password|-|111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112 ~~ERROR (Code: 0)~~ -~~ERROR (Message: [08001] [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]Invalid value specified for connection string attribute 'PWD' (0) (SQLDriverConnect))~~ +~~ERROR (Message: [08001] [Microsoft][ODBC Driver 17 for SQL Server]Invalid value specified for connection string attribute 'PWD' (0) (SQLDriverConnect))~~ py_auth#!#others|-|packetSize=0 ~~SUCCESS~~ @@ -30,5 +30,5 @@ py_auth#!#others|-|packetSize=4096 ~~SUCCESS~~ py_auth#!#database|-|test1 SELECT 1 ~~ERROR (Code: 3701)~~ -~~ERROR (Message: [42S02] [unixODBC][Microsoft][ODBC Driver 17 for SQL Server][SQL Server]database "test1 select 1" does not exist (3701) (SQLDriverConnect))~~ +~~ERROR (Message: [42S02] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]database "test1 select 1" does not exist (3701) (SQLDriverConnect))~~