diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9b9c0f7..09a4b8e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -58,10 +58,10 @@ jobs: -e TEST_SQLSERVER_PWD="$TEST_SQLSERVER_PWD" \ -e "ACCEPT_EULA=Y" -e "MSSQL_PID=Developer" \ -v ${GITHUB_WORKSPACE}/setup/sqlserver:/setup.d \ - mcr.microsoft.com/mssql/server:2017-latest + mcr.microsoft.com/mssql/server:2019-latest chmod u+x setup/wait-container-ready.sh && ./setup/wait-container-ready.sh test-sqlserver "SQL Server is now ready for client connections" # SQLServer does not have an on startup script, run it now - docker exec test-sqlserver bash -c "chmod u+x setup.d/sqlserver-setup.sh && ./setup.d/sqlserver-setup.sh" + docker exec --user root test-sqlserver bash -c "chmod u+x setup.d/sqlserver-setup.sh && ./setup.d/sqlserver-setup.sh" - name: Launch Oracle if: ${{ matrix.scope == 'Oracle' }} @@ -158,10 +158,10 @@ jobs: -e TEST_SQLSERVER_PWD="$TEST_SQLSERVER_PWD" \ -e "ACCEPT_EULA=Y" -e "MSSQL_PID=Developer" \ -v ${GITHUB_WORKSPACE}/setup/sqlserver:/setup.d \ - mcr.microsoft.com/mssql/server:2017-latest + mcr.microsoft.com/mssql/server:2019-latest chmod u+x ../setup/wait-container-ready.sh && ../setup/wait-container-ready.sh test-sqlserver "SQL Server is now ready for client connections" # SQLServer does not have an on startup script, run it now - docker exec test-sqlserver bash -c "chmod u+x setup.d/sqlserver-setup.sh && ./setup.d/sqlserver-setup.sh" + docker exec --user root test-sqlserver bash -c "chmod u+x setup.d/sqlserver-setup.sh && ./setup.d/sqlserver-setup.sh" - name: Run test run: dotnet test --logger "trx;LogFileName=../../reports/tdrules-report.trx" TdRulesTest/TdRulesTest.csproj diff --git a/setup/container-setup.sh b/setup/container-setup.sh index 5106ed8..d18d84e 100644 --- a/setup/container-setup.sh +++ b/setup/container-setup.sh @@ -33,7 +33,7 @@ docker run -d -p 1433:1433 --name test-sqlserver --restart unless-stopped \ -e TEST_SQLSERVER_PWD="$TEST_SQLSERVER_PWD" \ -e "ACCEPT_EULA=Y" -e "MSSQL_PID=Developer" \ -v /${PWD}/sqlserver:/setup.d \ - mcr.microsoft.com/mssql/server:2017-latest + mcr.microsoft.com/mssql/server:2019-latest ./wait-container-ready.sh test-sqlserver "SQL Server is now ready for client connections" # SQLServer does not have an on startup script, run it now docker exec test-sqlserver bash -c "./setup.d/sqlserver-setup.sh" diff --git a/setup/database.properties b/setup/database.properties index ef56c11..6d3181a 100644 --- a/setup/database.properties +++ b/setup/database.properties @@ -23,7 +23,7 @@ tdrules.java.tdstorerdb2.sqlserver.user=tdstorerdb2 tdrules.java.tdloadrdb.sqlserver.url=jdbc:sqlserver://localhost:1433;databaseName=tdloadrdb;encrypt=true;trustServerCertificate=true tdrules.java.tdloadrdb.sqlserver.user=tdloadrdb -tdrules.java.tdstorerdb2.sqlserver.meta.dbms=Database: Microsoft SQL Server - Version: 14. +tdrules.java.tdstorerdb2.sqlserver.meta.dbms=Database: Microsoft SQL Server - Version: 15. tdrules.java.tdstorerdb2.sqlserver.meta.driver=Driver: Microsoft JDBC Driver 12. # Oracle is not tested in the client-rdb (tdclirdb) @@ -60,7 +60,7 @@ tdrules.netcore.tdclirdb.sqlserver.user=tdclirdb tdrules.netcore.tdstorerdb2.sqlserver.url=Server=(local);Database=tdstorerdb2 tdrules.netcore.tdstorerdb2.sqlserver.user=tdstorerdb2 -tdrules.netcore.tdstorerdb2.sqlserver.meta.dbms=Database: Microsoft SQL Server - Version: 14. +tdrules.netcore.tdstorerdb2.sqlserver.meta.dbms=Database: Microsoft SQL Server - Version: 15. tdrules.netcore.tdstorerdb2.sqlserver.meta.driver=Driver: System.Data.SqlClient.SqlConnection - Version: N/A # sqlite diff --git a/setup/sqlserver/sqlserver-setup.sh b/setup/sqlserver/sqlserver-setup.sh index 17a884c..136317c 100644 --- a/setup/sqlserver/sqlserver-setup.sh +++ b/setup/sqlserver/sqlserver-setup.sh @@ -1,14 +1,14 @@ # Execution of sqlserver commands after startup # A little bit flaky in GitHub, check first connection and wait if fails echo "-- Try first connection" -if ! /opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U sa -P $TEST_SQLSERVER_PWD -l 30 -Q "select name from sys.databases"; then +if ! /opt/mssql-tools18/bin/sqlcmd -C -S localhost,1433 -U sa -P $TEST_SQLSERVER_PWD -l 30 -Q "select name from sys.databases"; then echo "Failure to connect from sa, wait some time" sleep 4 echo "End sleep, going to setup" #this seems to solve login failure, but sometimes: Error: Process completed with exit code 137. fi echo "-- Begin setup" -/opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U sa -P $TEST_SQLSERVER_PWD -l 30 <<-EOSQL +/opt/mssql-tools18/bin/sqlcmd -C -S localhost,1433 -U sa -P $TEST_SQLSERVER_PWD -l 30 <<-EOSQL CREATE LOGIN tdclirdb WITH PASSWORD = '$TEST_SQLSERVER_PWD', CHECK_POLICY=OFF, CHECK_EXPIRATION=OFF, DEFAULT_LANGUAGE=spanish; GO CREATE DATABASE tdclirdb