From e04d3df44fdba00c9a16d5df7d2bb27c0decf10b Mon Sep 17 00:00:00 2001 From: Rishabh Tanwar <33982749+rishabhtanwar29@users.noreply.github.com> Date: Tue, 6 Dec 2022 19:50:01 +0530 Subject: [PATCH] Fix os and pyodbc versions for github action (#909) 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 We're running the github actions on ubuntu-latest. Previously, it was ubuntu-20.04, but in any recently created fork, it's pointing to ubuntu-22.04. This is causing dependency/build failure in the github actions running in the fork. So, let's fix the os version. Task: BABEL-OSS Authored-by: HarshLunagariya <40052763+HarshLunagariya@users.noreply.github.com> Signed-off-by: Rishabh Tanwar --- .../install-dependencies/action.yml | 2 +- .github/workflows/dotnet-tests.yml | 2 +- .github/workflows/isolation-tests.yml | 2 +- .github/workflows/jdbc-tests.yml | 2 +- .github/workflows/minor-version-upgrade-tests.yml | 4 ++-- .github/workflows/odbc-tests.yml | 2 +- .github/workflows/python-tests.yml | 5 +++-- test/python/expected/pyodbc/TestAuth.out | 12 ++++++------ 8 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/composite-actions/install-dependencies/action.yml b/.github/composite-actions/install-dependencies/action.yml index 3763db93c7..baca9bd706 100644 --- a/.github/composite-actions/install-dependencies/action.yml +++ b/.github/composite-actions/install-dependencies/action.yml @@ -8,5 +8,5 @@ runs: sudo apt-get update curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list - sudo apt-get install uuid-dev openjdk-8-jre libicu-dev libxml2-dev openssl libssl-dev python-dev libossp-uuid-dev libpq-dev cmake pkg-config g++ build-essential bison mssql-tools unixodbc-dev + sudo apt-get install uuid-dev openjdk-8-jre libicu-dev libxml2-dev openssl libssl-dev python2-dev libossp-uuid-dev libpq-dev cmake pkg-config g++ build-essential bison mssql-tools unixodbc-dev shell: bash diff --git a/.github/workflows/dotnet-tests.yml b/.github/workflows/dotnet-tests.yml index 5ff0a6668b..52d2ab8e1e 100644 --- a/.github/workflows/dotnet-tests.yml +++ b/.github/workflows/dotnet-tests.yml @@ -3,7 +3,7 @@ on: [push, pull_request] jobs: run-babelfish-dotnet-tests: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 id: checkout diff --git a/.github/workflows/isolation-tests.yml b/.github/workflows/isolation-tests.yml index f40010a110..dafbd7fef4 100644 --- a/.github/workflows/isolation-tests.yml +++ b/.github/workflows/isolation-tests.yml @@ -8,7 +8,7 @@ on: jobs: isolation-tests: name: Isolation-Tests - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 id: checkout diff --git a/.github/workflows/jdbc-tests.yml b/.github/workflows/jdbc-tests.yml index 28d74a7700..fb33868e6d 100644 --- a/.github/workflows/jdbc-tests.yml +++ b/.github/workflows/jdbc-tests.yml @@ -3,7 +3,7 @@ on: [push, pull_request] jobs: run-babelfish-jdbc-tests: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 id: checkout diff --git a/.github/workflows/minor-version-upgrade-tests.yml b/.github/workflows/minor-version-upgrade-tests.yml index 558c19f903..46db9b284a 100644 --- a/.github/workflows/minor-version-upgrade-tests.yml +++ b/.github/workflows/minor-version-upgrade-tests.yml @@ -11,7 +11,7 @@ jobs: scheduleFile: ./jdbc_upgrade_schedule name: Build and test - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 @@ -145,4 +145,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: output-diff.diff - path: test/JDBC/Info/output-diff.diff \ No newline at end of file + path: test/JDBC/Info/output-diff.diff diff --git a/.github/workflows/odbc-tests.yml b/.github/workflows/odbc-tests.yml index fcea2a5efc..37acccd937 100644 --- a/.github/workflows/odbc-tests.yml +++ b/.github/workflows/odbc-tests.yml @@ -3,7 +3,7 @@ on: [push, pull_request] jobs: run-babelfish-odbc-tests: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 id: checkout diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 858eca296f..7931810c39 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -3,7 +3,7 @@ on: [push, pull_request] jobs: run-babelfish-python-tests: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 id: checkout @@ -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))~~