From fb335c0b0db9112ada221f74d4528c62f386f228 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Mon, 16 Mar 2020 13:25:09 -0700 Subject: [PATCH] Modified some BVT tests to be configurable (#1106) --- appveyor.yml | 4 ++-- test/bvt/sqlsrv/break.inc | 15 +++++++++------ test/bvt/sqlsrv/connect.inc | 2 ++ test/bvt/sqlsrv/msdn_sqlsrv_connect_MARS.phpt | 5 +++-- .../msdn_sqlsrv_get_field_stream_binary.php | 4 ++-- test/bvt/sqlsrv/msdn_sqlsrv_query_scrollable.phpt | 5 +---- 6 files changed, 19 insertions(+), 16 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index a473ab3f4..cf87f520f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -83,8 +83,8 @@ install: } - echo Downloading MSODBCSQL 17 # AppVeyor build works are x64 VMs and 32-bit ODBC driver cannot be installed on it - - ps: (new-object net.webclient).DownloadFile('https://download.microsoft.com/download/E/6/B/E6BFDC7A-5BCD-4C51-9912-635646DA801E/en-US/msodbcsql_17.4.2.1_x64.msi', 'c:\projects\msodbcsql_17.4.2.1_x64.msi') - - cmd /c start /wait msiexec /i "c:\projects\msodbcsql_17.4.2.1_x64.msi" /q IACCEPTMSODBCSQLLICENSETERMS=YES ADDLOCAL=ALL + - ps: (new-object net.webclient).DownloadFile('https://download.microsoft.com/download/E/6/B/E6BFDC7A-5BCD-4C51-9912-635646DA801E/en-US/17.5.2.1/x64/msodbcsql.msi', 'c:\projects\msodbcsql.msi') + - cmd /c start /wait msiexec /i "c:\projects\msodbcsql.msi" /q IACCEPTMSODBCSQLLICENSETERMS=YES ADDLOCAL=ALL - echo Checking the version of MSODBCSQL - reg query "HKLM\SOFTWARE\ODBC\odbcinst.ini\ODBC Driver 17 for SQL Server" - dir %WINDIR%\System32\msodbcsql*.dll diff --git a/test/bvt/sqlsrv/break.inc b/test/bvt/sqlsrv/break.inc index 6a2e190e0..5e6429f77 100644 --- a/test/bvt/sqlsrv/break.inc +++ b/test/bvt/sqlsrv/break.inc @@ -1,15 +1,18 @@ "$databaseName", "username"=>"$username", "password"=>"$password" ); $conn = sqlsrv_connect( $serverName, $connectionInfo ); diff --git a/test/bvt/sqlsrv/connect.inc b/test/bvt/sqlsrv/connect.inc index 07f9289af..6ac30a9c3 100644 --- a/test/bvt/sqlsrv/connect.inc +++ b/test/bvt/sqlsrv/connect.inc @@ -4,6 +4,8 @@ $databaseName = 'TARGET_DATABASE'; $uid = 'TARGET_USERNAME'; $pwd = 'TARGET_PASSWORD'; +$server2 = 'ANOTHER_SERVER'; + // RevisionNumber in SalesOrderHeader is subject to a trigger incrementing it whenever // changes are made to SalesOrderDetail. Since RevisionNumber is a tinyint, it can // overflow quickly if the BVT tests often run. So we change it directly here first diff --git a/test/bvt/sqlsrv/msdn_sqlsrv_connect_MARS.phpt b/test/bvt/sqlsrv/msdn_sqlsrv_connect_MARS.phpt index 9b3577320..6e6adfb24 100644 --- a/test/bvt/sqlsrv/msdn_sqlsrv_connect_MARS.phpt +++ b/test/bvt/sqlsrv/msdn_sqlsrv_connect_MARS.phpt @@ -10,8 +10,9 @@ $conn = sqlsrv_connect( $server, $connectionInfo); /* Connect to the local server using Windows Authentication and specify the AdventureWorks database as the database in use. */ -$serverName = "sql-2k14-sp1-1.galaxy.ad"; -$connectionInfo = array( "Database"=>"AdventureWorks2014", "UID"=>"sa", "PWD"=>"Moonshine4me", 'MultipleActiveResultSets'=> false); +$serverName = $server2; +$connectionInfo = array( "Database"=>$databaseName, "UID"=>$uid, "PWD"=>$pwd, 'MultipleActiveResultSets'=> false); + $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn === false ) { diff --git a/test/bvt/sqlsrv/msdn_sqlsrv_get_field_stream_binary.php b/test/bvt/sqlsrv/msdn_sqlsrv_get_field_stream_binary.php index 751229f1e..ea810678f 100644 --- a/test/bvt/sqlsrv/msdn_sqlsrv_get_field_stream_binary.php +++ b/test/bvt/sqlsrv/msdn_sqlsrv_get_field_stream_binary.php @@ -1,8 +1,8 @@ "AdventureWorks2014", "UID"=>"sa", "PWD"=>"Moonshine4me"); +$serverName = $server2; +$connectionInfo = array( "Database"=>$databaseName, "UID"=>$uid, "PWD"=>$pwd); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn === false ) { diff --git a/test/bvt/sqlsrv/msdn_sqlsrv_query_scrollable.phpt b/test/bvt/sqlsrv/msdn_sqlsrv_query_scrollable.phpt index e9444ea97..a42c9d2f2 100644 --- a/test/bvt/sqlsrv/msdn_sqlsrv_query_scrollable.phpt +++ b/test/bvt/sqlsrv/msdn_sqlsrv_query_scrollable.phpt @@ -4,11 +4,8 @@ server side cursor specified when querying --FILE-- "tempdb", "UID"=>"sa", "PWD"=>"Moonshine4me")); - require('connect.inc'); -$connectionInfo = array( "Database"=>"$databaseName", "UID"=>"$uid", "PWD"=>"$pwd"); +$connectionInfo = array( "Database"=>$databaseName, "UID"=>$uid, "PWD"=>$pwd); $conn = sqlsrv_connect( $server, $connectionInfo); if ( $conn === false ) { die( print_r( sqlsrv_errors(), true ));