diff --git a/test/Performance/README.md b/test/Performance/README.md index 151d2eb2..42458544 100644 --- a/test/Performance/README.md +++ b/test/Performance/README.md @@ -6,8 +6,7 @@ Run `cmd` as administrator. powershell Set-ExecutionPolicy Unrestricted - .\setup_env_windows.ps1 -If `PHP_VERSION` is wrong, the script will default it to the latest PHP 7.1 version + .\setup_env_windows.ps1 ### Ubuntu 16 sudo env “PATH=$PATH” bash setup_env_unix.sh Ubuntu16 @@ -21,9 +20,9 @@ If `PHP_VERSION` is wrong, the script will default it to the latest PHP 7.1 vers ### 1. Modify lib/connect.php with the test database credetials ### 2. Execute run-perf_tests.py. -The script must be executed with `sudo` because to enable pooling it needs to modify odbcinst.ini system file. As an improvement, the location of the odbcinst.ini file can be changed so that, sudo is not requiered. +The script must be executed with `sudo python3` because to enable pooling it needs to modify odbcinst.ini system file. As an improvement, the location of the odbcinst.ini file can be changed so that, sudo is not requiered. - run-perf_tests.py -platform -iterations -iterations-large -result-server -result-db -result-uid -result-pwd + py.exe run-perf_tests.py -platform -iterations -iterations-large -result-server -result-db -result-uid -result-pwd `-platform` - The platform that the tests are ran on. Must be one of the following: Windows10, WidnowsServer2016 WindowsServer2012 Ubuntu16 RedHat7 Sierra `-iterations` - The number of iterations for regular tests. diff --git a/test/Performance/run-perf_tests.py b/test/Performance/run-perf_tests.py index d7260d43..85ccc579 100644 --- a/test/Performance/run-perf_tests.py +++ b/test/Performance/run-perf_tests.py @@ -55,7 +55,7 @@ def validate_platform( platform_name ): """ platforms = [ "Windows10" - , "WidnowsServer2016" + , "WindowsServer2016" , "WindowsServer2012" , "Ubuntu16" , "RedHat7" @@ -526,7 +526,7 @@ def get_msodbcsql_version( test_db ): Returns: MSODBCSQL version """ - command = "php -r \"echo sqlsrv_client_info( sqlsrv_connect( '{0}', array( 'UID'=>'{1}', 'PWD'=>'{2}')))['DriverVer'];\"" + command = "php -r \"echo sqlsrv_client_info( sqlsrv_connect( '{0}', array( 'UID'=>'{1}', 'PWD'=>'{2}')))['DriverVer'];\"" p = subprocess.Popen( command.format( test_db.server_name, test_db.username, test_db.password ), stdout=subprocess.PIPE, shell = True ) out, err = p.communicate() return out.decode('ascii') diff --git a/test/Performance/setup_env_windows.ps1 b/test/Performance/setup_env_windows.ps1 index 4868a0b4..dc1aff65 100644 --- a/test/Performance/setup_env_windows.ps1 +++ b/test/Performance/setup_env_windows.ps1 @@ -35,6 +35,7 @@ Write-Host "Installing chocolatey..." iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) Write-Host "Installing Git..." choco install -y git +Set-Alias git 'C:\Program Files\Git\cmd\git.exe' Write-Host "Installing Python3..." choco install -y python3 RefreshEnv @@ -106,4 +107,6 @@ $env:Path += ";C:\php\" RefreshEnv wget https://getcomposer.org/installer -O composer-setup.php php composer-setup.php -php composer.phar install \ No newline at end of file +php composer.phar install +Remove-Item temp -Recurse -Force -ErrorAction Ignore +Write-Host "Setup completed!" \ No newline at end of file