From 6b6500f50c18876d16f6b97758e089ef4eabd829 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Fri, 20 Apr 2018 15:55:43 -0700 Subject: [PATCH 01/12] Use latest build scripts for testing with php 7.2 --- appveyor.yml | 135 +++++++++++++++++++++------------------------------ 1 file changed, 55 insertions(+), 80 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index e1b0763f8..78a7ea0d8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,46 +15,39 @@ environment: TEST_PHP_SQL_UID: sa SQLSRV_DBNAME: msphpsql_sqlsrv PDOSQLSRV_DBNAME: msphpsql_pdosqlsrv - PHP_DEPSVER: 7.0 - PHP_SDK: c:\projects\php + PYTHON: c:\Python36 + # For details about Appveyor build worker images (VM template): https://www.appveyor.com/docs/build-environment/#build-worker-images matrix: - - BUILD_PLATFORM: x64 - TEST_PHP_SQL_SERVER: (local)\SQL2012SP1 - SQL_INSTANCE: SQL2012SP1 - PHP_VC: 14 - PHP_MAJOR_VER: 7.1 - PHP_MINOR_VER: latest - PHP_SDK_DIR: c:\projects\php\x64 - PHP_INSTALL_DIR: c:\projects\php\x64\bin - platform: x64 - - BUILD_PLATFORM: x86 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + BUILD_PLATFORM: x64 TEST_PHP_SQL_SERVER: (local)\SQL2016 SQL_INSTANCE: SQL2016 + PHP_VC: 15 + PHP_MAJOR_VER: 7.2 + PHP_MINOR_VER: latest + PHP_EXE_PATH: x64\Release_TS + THREAD: ts + platform: x64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + BUILD_PLATFORM: x86 + TEST_PHP_SQL_SERVER: (local)\SQL2012SP1 + SQL_INSTANCE: SQL2012SP1 PHP_VC: 14 PHP_MAJOR_VER: 7.1 PHP_MINOR_VER: latest - PHP_SDK_DIR: c:\projects\php\x86 - PHP_INSTALL_DIR: c:\projects\php\x86\bin - PHP_ZTS: --disable-zts + PHP_EXE_PATH: Release + THREAD: nts platform: x86 -# PHP_MAJOR_VER is PHP major version to build (7.0, 7.1) +# PHP_MAJOR_VER is PHP major version to build (7.2, 7.1) # PHP_MINOR_VER is PHP point release number (or latest for latest release) -# PHP_INSTALL_DIR is where the built PHP binaries go -# PHP_SDK_DIR is where PHP source is extracted to (e.g. PHP_SDK_DIR\php-7.0.14-src) -# PHP_SDK is where PHP sdk binary tools are extracted to # PHP_VC is the Visual C++ version -# PHP_ZTS is defined to disable thread safe build - -# Build worker image (VM template) -image: Visual Studio 2015 +# PHP_EXE_PATH is the relative path from php src folder to php executable +# THREAD is either non-thread-safe (nts) or thread-safe (ts) matrix: fast_finish: true -#services: - #- mssql2012sp1 - # clone directory (or %APPVEYOR_BUILD_FOLDER%) clone_folder: c:\projects\sqlphp @@ -65,8 +58,8 @@ install: - echo start SQL Server # Based on http://www.appveyor.com/docs/services-databases - ps: >- - [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null ; - [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | Out-Null ; + [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null; + [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | Out-Null; $instanceName = $env:SQL_INSTANCE; $uri = "ManagedComputer[@Name='$env:COMPUTERNAME']/ServerInstance[@Name='$instanceName']/ServerProtocol[@Name='Tcp']"; @@ -79,10 +72,6 @@ install: Set-Service SQLBrowser -StartupType Manual; Start-Service SQLBrowser; - echo Downloading prerequisites - - ps: | - $client = New-Object Net.WebClient; - $client.Headers.Add("user-agent", "appveyor-ci-build1"); - $client.DownloadFile("http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip", "c:\projects\php-sdk-binary-tools-20110915.zip"); - ps: | $client = New-Object Net.WebClient; $client.Headers.Add("user-agent", "appveyor-ci-build2"); @@ -92,10 +81,6 @@ install: } Else { $env:PHP_VERSION=$env:PHP_MAJOR_VER + '.' + $env:PHP_MINOR_VER; } - - ps: | - $client = New-Object Net.WebClient; - $client.Headers.Add("user-agent", "appveyor-ci-build3"); - $client.DownloadFile("http://windows.php.net/downloads/releases/php-" + ${env:PHP_VERSION} + "-src.zip", ${env:APPVEYOR_BUILD_FOLDER} + "\..\php.zip"); - echo Downloading MSODBCSQL 17.1 # 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/msodbcsql_17.1.0.1_x64.msi', 'c:\projects\msodbcsql_17.1.0.1_x64.msi') @@ -104,80 +89,70 @@ install: - reg query "HKLM\SOFTWARE\ODBC\odbcinst.ini\ODBC Driver 17 for SQL Server" - dir %WINDIR%\System32\msodbcsql*.dll - cd c:\projects - - 7z x -y .\php-sdk-binary-tools-20110915.zip -o%PHP_SDK% - - 7z x -y .\php.zip -o%PHP_SDK_DIR% - echo update SQL connection string - ps: (Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc) | ForEach-Object { $_ -replace "TARGET_SERVER", ${env:TEST_PHP_SQL_SERVER} -replace "TARGET_DATABASE", ${env:PDOSQLSRV_DBNAME} -replace "TARGET_USERNAME", ${env:TEST_PHP_SQL_UID} -replace "TARGET_PASSWORD", ${env:TEST_PHP_SQL_PWD} } | Set-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc - - ps: Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc + # - ps: Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc + - ps: Select-String ${env:SQL_INSTANCE} ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc + - ps: Select-String ${env:PDOSQLSRV_DBNAME} ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc - ps: (Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc) | ForEach-Object { $_ -replace "TARGET_SERVER", ${env:TEST_PHP_SQL_SERVER} -replace "TARGET_DATABASE", ${env:SQLSRV_DBNAME} -replace "TARGET_USERNAME", ${env:TEST_PHP_SQL_UID} -replace "TARGET_PASSWORD", ${env:TEST_PHP_SQL_PWD} } | Set-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc - - ps: Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc + # - ps: Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc + - ps: Select-String ${env:SQL_INSTANCE} ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc + - ps: Select-String ${env:SQLSRV_DBNAME} ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc - echo install opencppcoverage - choco install opencppcoverage - - set path=C:\Program Files\OpenCppCoverage;%path% + - set path=C:\Program Files\OpenCppCoverage;%PYTHON%;%PYTHON%\Scripts;%path% build_script: - - '"C:\\Program Files (x86)\\Microsoft Visual Studio %PHP_VC%.0\\VC\\vcvarsall.bat" %BUILD_PLATFORM%' - - Echo copy msphp code to ext folder - - mkdir %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv - - mkdir %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv\shared - - mkdir %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv - - mkdir %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv\shared - - copy /Y %APPVEYOR_BUILD_FOLDER%\source\sqlsrv %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv - - copy /Y %APPVEYOR_BUILD_FOLDER%\source\shared %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv\shared - - copy /Y %APPVEYOR_BUILD_FOLDER%\source\shared %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv\shared - - copy /Y %APPVEYOR_BUILD_FOLDER%\source\pdo_sqlsrv %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv - - cd %PHP_SDK_DIR%\php-%PHP_VERSION%-src - - cd - - dir - - '%PHP_SDK%\bin\phpsdk_setvars.bat' - - buildconf.bat - # only build CLI and MSSQL extensions - - configure.bat --disable-all %PHP_ZTS% --enable-cli --enable-sqlsrv=shared --with-pdo-sqlsrv=shared --enable-pdo=shared --with-prefix=%PHP_INSTALL_DIR% - - copy php.ini-development php.ini - - echo extension_dir=%PHP_INSTALL_DIR%\ext >> php.ini - - echo extension=php_sqlsrv.dll >> php.ini - - echo extension=php_pdo_sqlsrv.dll >> php.ini - - nmake - - nmake install - - Echo copy php.ini and run-tests.php from php source to install directory. - - copy php.ini %PHP_INSTALL_DIR% - - copy run-tests.php %PHP_INSTALL_DIR% - - dir %PHP_INSTALL_DIR% + - copy %APPVEYOR_BUILD_FOLDER%\buildscripts\*.py c:\projects + - cd c:\projects + - python -V + - python builddrivers.py --PHPVER=%PHP_VERSION% --ARCH=%BUILD_PLATFORM% --THREAD=%THREAD% --SOURCE=%APPVEYOR_BUILD_FOLDER%\source --TESTING + - cd c:\projects\php-sdk\phpdev\vc%PHP_VC%\%BUILD_PLATFORM%\php-%PHP_VERSION%-src\ + - set PHP_SRC_DIR=%CD%\ext + - cd %PHP_EXE_PATH% + - set PHP_EXE_PATH=%CD% + - echo %PHP_EXE_PATH% + # - set path=%PHP_EXE_PATH%;%path% + - ps: | + $env:PHP_VER = $env:PHP_MAJOR_VER -replace '\.', '' + $env:SQLSRV = "php_sqlsrv_" + $env:PHP_VER + "_" + $env:THREAD + ".dll" + $env:PDO_SQLSRV = "php_pdo_sqlsrv_" + $env:PHP_VER + "_" + $env:THREAD + ".dll" + - php --ini + - php -m test_script: - - cd %PHP_INSTALL_DIR% - - php --ini - - php -i - - python -V - Echo setup test database for SQLSRV tests - %SQLSRV_DBNAME% - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\setup_dbs.py -dbname %SQLSRV_DBNAME% - Echo setup test database for PDO_SQLSRV tests - %PDOSQLSRV_DBNAME% - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\setup_dbs.py -dbname %PDOSQLSRV_DBNAME% - ps: >- - If ($env:SQL_INSTANCE -Match "SQL2016") { + If ($env:BUILD_PLATFORM -Match "x86") { Write-Host "Running phpt tests via OpenCppCoverage..." - $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; - OpenCppCoverage.exe --sources $ext_dir\sqlsrv --sources $ext_dir\pdo_sqlsrv --modules ext\php_sqlsrv.dll --modules ext\php_pdo_sqlsrv.dll --export_type=cobertura:.\coverage.xml --quiet --cover_children --continue_after_cpp_exception --optimized_build -- .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -encoding UTF8; - type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log; + OpenCppCoverage.exe --sources ${env:PHP_SRC_DIR}\sqlsrv --sources ${env:PHP_SRC_DIR}\pdo_sqlsrv --modules .\${env:SQLSRV} --modules .\${env:PDO_SQLSRV} --export_type=cobertura:.\coverage.xml --quiet --cover_children --continue_after_cpp_exception --optimized_build -- .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -encoding UTF8; + Write-Host "Showing the last 25 lines of the log file..." + Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -Tail 25; ls *.xml } Else { Write-Host "Running phpt tests the regular way..." .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log -encoding UTF8; - type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log; + Write-Host "Showing the last 25 lines of the log file..." + Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log -Tail 25; .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\*.phpt | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log -encoding UTF8; - type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log; + Write-Host "Showing the last 25 lines of the log file..." + Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log -Tail 25; } - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %SQLSRV_DBNAME% - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %PDOSQLSRV_DBNAME% - - cd %PHP_INSTALL_DIR% + - cd %PHP_EXE_PATH% - ps: $fileExists = Test-Path "coverage.xml" - ps: >- If ($fileExists -eq $true) { Write-Host "Running coverage analysis..."; - $env:PATH = ${env:PHP_INSTALL_DIR} + $env:PATH; + $env:PATH = ${env:PHP_EXE_PATH} + $env:PATH; Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh bash codecov.sh -f "coverage.xml" } + # - if exist codecov.sh (bash codecov.sh -f "coverage.xml") after_test: - cd %APPVEYOR_BUILD_FOLDER%\test\functional\ From d54f7037ecedf08204756236fde6bcf3440de3b3 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Fri, 20 Apr 2018 16:54:30 -0700 Subject: [PATCH 02/12] Debugging some more --- appveyor.yml | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 78a7ea0d8..6e2cc6a03 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,16 +18,6 @@ environment: PYTHON: c:\Python36 # For details about Appveyor build worker images (VM template): https://www.appveyor.com/docs/build-environment/#build-worker-images matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - BUILD_PLATFORM: x64 - TEST_PHP_SQL_SERVER: (local)\SQL2016 - SQL_INSTANCE: SQL2016 - PHP_VC: 15 - PHP_MAJOR_VER: 7.2 - PHP_MINOR_VER: latest - PHP_EXE_PATH: x64\Release_TS - THREAD: ts - platform: x64 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 BUILD_PLATFORM: x86 TEST_PHP_SQL_SERVER: (local)\SQL2012SP1 @@ -38,6 +28,16 @@ environment: PHP_EXE_PATH: Release THREAD: nts platform: x86 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + BUILD_PLATFORM: x64 + TEST_PHP_SQL_SERVER: (local)\SQL2016 + SQL_INSTANCE: SQL2016 + PHP_VC: 15 + PHP_MAJOR_VER: 7.2 + PHP_MINOR_VER: latest + PHP_EXE_PATH: x64\Release_TS + THREAD: ts + platform: x64 # PHP_MAJOR_VER is PHP major version to build (7.2, 7.1) # PHP_MINOR_VER is PHP point release number (or latest for latest release) @@ -109,14 +109,16 @@ build_script: - python builddrivers.py --PHPVER=%PHP_VERSION% --ARCH=%BUILD_PLATFORM% --THREAD=%THREAD% --SOURCE=%APPVEYOR_BUILD_FOLDER%\source --TESTING - cd c:\projects\php-sdk\phpdev\vc%PHP_VC%\%BUILD_PLATFORM%\php-%PHP_VERSION%-src\ - set PHP_SRC_DIR=%CD%\ext + - echo %PHP_SRC_DIR% - cd %PHP_EXE_PATH% - set PHP_EXE_PATH=%CD% - echo %PHP_EXE_PATH% - # - set path=%PHP_EXE_PATH%;%path% - ps: | $env:PHP_VER = $env:PHP_MAJOR_VER -replace '\.', '' - $env:SQLSRV = "php_sqlsrv_" + $env:PHP_VER + "_" + $env:THREAD + ".dll" - $env:PDO_SQLSRV = "php_pdo_sqlsrv_" + $env:PHP_VER + "_" + $env:THREAD + ".dll" + $env:SQLSRV = $env:PHP_EXE_PATH + "\php_sqlsrv_" + $env:PHP_VER + "_" + $env:THREAD + ".dll" + echo $env:SQLSRV + $env:PDO_SQLSRV = $env:PHP_EXE_PATH + "\php_pdo_sqlsrv_" + $env:PHP_VER + "_" + $env:THREAD + ".dll" + echo $env:PDO_SQLSRV - php --ini - php -m @@ -128,7 +130,9 @@ test_script: - ps: >- If ($env:BUILD_PLATFORM -Match "x86") { Write-Host "Running phpt tests via OpenCppCoverage..." - OpenCppCoverage.exe --sources ${env:PHP_SRC_DIR}\sqlsrv --sources ${env:PHP_SRC_DIR}\pdo_sqlsrv --modules .\${env:SQLSRV} --modules .\${env:PDO_SQLSRV} --export_type=cobertura:.\coverage.xml --quiet --cover_children --continue_after_cpp_exception --optimized_build -- .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -encoding UTF8; + dir $env:PHP_SRC_DIR\sqlsrv + dir $env:PHP_SRC_DIR\pdo_sqlsrv + OpenCppCoverage.exe --sources $env:PHP_SRC_DIR\sqlsrv --sources $env:PHP_SRC_DIR\pdo_sqlsrv --modules $env:SQLSRV --modules $env:PDO_SQLSRV --export_type=cobertura:.\coverage.xml --quiet --cover_children --continue_after_cpp_exception --optimized_build -- .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -encoding UTF8; Write-Host "Showing the last 25 lines of the log file..." Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -Tail 25; ls *.xml @@ -148,6 +152,8 @@ test_script: - ps: >- If ($fileExists -eq $true) { Write-Host "Running coverage analysis..."; + Get-Content .\coverage.xml -Head 50; + Get-Content .\coverage.xml -Tail 50; $env:PATH = ${env:PHP_EXE_PATH} + $env:PATH; Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh bash codecov.sh -f "coverage.xml" From a548fcb29b0d0b2fedcc5200d7b54e7ab11876c6 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Mon, 23 Apr 2018 09:05:21 -0700 Subject: [PATCH 03/12] Tried not to rename the extensions --- appveyor.yml | 19 ++-- appveyor_original.yml | 201 +++++++++++++++++++++++++++++++++++ buildscripts/builddrivers.py | 9 +- buildscripts/buildtools.py | 11 +- 4 files changed, 223 insertions(+), 17 deletions(-) create mode 100644 appveyor_original.yml diff --git a/appveyor.yml b/appveyor.yml index 6e2cc6a03..8410e1e94 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -106,19 +106,19 @@ build_script: - copy %APPVEYOR_BUILD_FOLDER%\buildscripts\*.py c:\projects - cd c:\projects - python -V - - python builddrivers.py --PHPVER=%PHP_VERSION% --ARCH=%BUILD_PLATFORM% --THREAD=%THREAD% --SOURCE=%APPVEYOR_BUILD_FOLDER%\source --TESTING + - python builddrivers.py --PHPVER=%PHP_VERSION% --ARCH=%BUILD_PLATFORM% --THREAD=%THREAD% --SOURCE=%APPVEYOR_BUILD_FOLDER%\source --TESTING --NO_RENAME - cd c:\projects\php-sdk\phpdev\vc%PHP_VC%\%BUILD_PLATFORM%\php-%PHP_VERSION%-src\ - set PHP_SRC_DIR=%CD%\ext - echo %PHP_SRC_DIR% - cd %PHP_EXE_PATH% - set PHP_EXE_PATH=%CD% - echo %PHP_EXE_PATH% - - ps: | - $env:PHP_VER = $env:PHP_MAJOR_VER -replace '\.', '' - $env:SQLSRV = $env:PHP_EXE_PATH + "\php_sqlsrv_" + $env:PHP_VER + "_" + $env:THREAD + ".dll" - echo $env:SQLSRV - $env:PDO_SQLSRV = $env:PHP_EXE_PATH + "\php_pdo_sqlsrv_" + $env:PHP_VER + "_" + $env:THREAD + ".dll" - echo $env:PDO_SQLSRV + # - ps: | + # $env:PHP_VER = $env:PHP_MAJOR_VER -replace '\.', '' + # $env:SQLSRV = $env:PHP_EXE_PATH + "\php_sqlsrv_" + $env:PHP_VER + "_" + $env:THREAD + ".dll" + # echo $env:SQLSRV + # $env:PDO_SQLSRV = $env:PHP_EXE_PATH + "\php_pdo_sqlsrv_" + $env:PHP_VER + "_" + $env:THREAD + ".dll" + # echo $env:PDO_SQLSRV - php --ini - php -m @@ -130,9 +130,7 @@ test_script: - ps: >- If ($env:BUILD_PLATFORM -Match "x86") { Write-Host "Running phpt tests via OpenCppCoverage..." - dir $env:PHP_SRC_DIR\sqlsrv - dir $env:PHP_SRC_DIR\pdo_sqlsrv - OpenCppCoverage.exe --sources $env:PHP_SRC_DIR\sqlsrv --sources $env:PHP_SRC_DIR\pdo_sqlsrv --modules $env:SQLSRV --modules $env:PDO_SQLSRV --export_type=cobertura:.\coverage.xml --quiet --cover_children --continue_after_cpp_exception --optimized_build -- .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -encoding UTF8; + OpenCppCoverage.exe --sources $env:PHP_SRC_DIR\sqlsrv --sources $env:PHP_SRC_DIR\pdo_sqlsrv --modules .\php_sqlsrv.dll --modules .\php_pdo_sqlsrv.dll --export_type=cobertura:.\coverage.xml --quiet --cover_children --continue_after_cpp_exception --optimized_build -- .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -encoding UTF8; Write-Host "Showing the last 25 lines of the log file..." Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -Tail 25; ls *.xml @@ -153,6 +151,7 @@ test_script: If ($fileExists -eq $true) { Write-Host "Running coverage analysis..."; Get-Content .\coverage.xml -Head 50; + Write-Host "Showing the last 50 lines of coverage..."; Get-Content .\coverage.xml -Tail 50; $env:PATH = ${env:PHP_EXE_PATH} + $env:PATH; Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh diff --git a/appveyor_original.yml b/appveyor_original.yml new file mode 100644 index 000000000..59a28d150 --- /dev/null +++ b/appveyor_original.yml @@ -0,0 +1,201 @@ +version: '{branch}.{build}' + +branches: + # whitelist + #only: + + # blacklist + except: + - PHP-7.0-Linux + - PHP5 + +environment: + # MSSQL credentials from https://www.appveyor.com/docs/services-databases/ + TEST_PHP_SQL_PWD: Password12! + TEST_PHP_SQL_UID: sa + SQLSRV_DBNAME: msphpsql_sqlsrv + PDOSQLSRV_DBNAME: msphpsql_pdosqlsrv + PHP_DEPSVER: 7.0 + PHP_SDK: c:\projects\php + matrix: + - BUILD_PLATFORM: x64 + TEST_PHP_SQL_SERVER: (local)\SQL2012SP1 + SQL_INSTANCE: SQL2012SP1 + PHP_VC: 14 + PHP_MAJOR_VER: 7.1 + PHP_MINOR_VER: latest + PHP_SDK_DIR: c:\projects\php\x64 + PHP_INSTALL_DIR: c:\projects\php\x64\bin + platform: x64 + - BUILD_PLATFORM: x86 + TEST_PHP_SQL_SERVER: (local)\SQL2016 + SQL_INSTANCE: SQL2016 + PHP_VC: 14 + PHP_MAJOR_VER: 7.1 + PHP_MINOR_VER: latest + PHP_SDK_DIR: c:\projects\php\x86 + PHP_INSTALL_DIR: c:\projects\php\x86\bin + PHP_ZTS: --disable-zts + platform: x86 + +# PHP_MAJOR_VER is PHP major version to build (7.0, 7.1) +# PHP_MINOR_VER is PHP point release number (or latest for latest release) +# PHP_INSTALL_DIR is where the built PHP binaries go +# PHP_SDK_DIR is where PHP source is extracted to (e.g. PHP_SDK_DIR\php-7.0.14-src) +# PHP_SDK is where PHP sdk binary tools are extracted to +# PHP_VC is the Visual C++ version +# PHP_ZTS is defined to disable thread safe build + +# Build worker image (VM template) +image: Visual Studio 2015 + +matrix: + fast_finish: true + +#services: + #- mssql2012sp1 + +# clone directory (or %APPVEYOR_BUILD_FOLDER%) +clone_folder: c:\projects\sqlphp + +build: + parallel: true # enable MSBuild parallel builds + +install: + - echo start SQL Server + # Based on http://www.appveyor.com/docs/services-databases + - ps: >- + [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null ; + [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | Out-Null ; + + $instanceName = $env:SQL_INSTANCE; + $uri = "ManagedComputer[@Name='$env:COMPUTERNAME']/ServerInstance[@Name='$instanceName']/ServerProtocol[@Name='Tcp']"; + $wmi = New-Object ('Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer'); + $tcp = $wmi.GetSmoObject($uri); + $tcp.IsEnabled = $true; + $tcp.Alter(); + Start-Service "MSSQL`$$instanceName"; + + Set-Service SQLBrowser -StartupType Manual; + Start-Service SQLBrowser; + - echo Downloading prerequisites + - ps: | + $client = New-Object Net.WebClient; + $client.Headers.Add("user-agent", "appveyor-ci-build1"); + $client.DownloadFile("http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip", "c:\projects\php-sdk-binary-tools-20110915.zip"); + - ps: | + $client = New-Object Net.WebClient; + $client.Headers.Add("user-agent", "appveyor-ci-build2"); + $client.DownloadFile("http://windows.php.net/downloads/releases/sha1sum.txt", "c:\projects\sha1sum.txt"); + If ($env:PHP_MINOR_VER -Match "latest") { + $env:PHP_VERSION=type c:\projects\sha1sum.txt | where { $_ -match "php-($env:PHP_MAJOR_VER\.\d+)-src" } | foreach { $matches[1] } ; + } Else { + $env:PHP_VERSION=$env:PHP_MAJOR_VER + '.' + $env:PHP_MINOR_VER; + } + - ps: | + $client = New-Object Net.WebClient; + $client.Headers.Add("user-agent", "appveyor-ci-build3"); + $client.DownloadFile("http://windows.php.net/downloads/releases/php-" + ${env:PHP_VERSION} + "-src.zip", ${env:APPVEYOR_BUILD_FOLDER} + "\..\php.zip"); + - echo Downloading MSODBCSQL 13.1 + # 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/D/5/E/D5EEF288-A277-45C8-855B-8E2CB7E25B96/x64/msodbcsql.msi', 'c:\projects\msodbcsql.msi') + - cmd /c start /wait msiexec /i "c:\projects\msodbcsql.msi" /q + - echo Checking the version of MSODBCSQL + - reg query "HKLM\SOFTWARE\ODBC\odbcinst.ini\ODBC Driver 13 for SQL Server" + - dir C:\Windows\System32\msodbcsql13.dll + - cd c:\projects + - 7z x -y .\php-sdk-binary-tools-20110915.zip -o%PHP_SDK% + - 7z x -y .\php.zip -o%PHP_SDK_DIR% + - echo update SQL connection string + - ps: (Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc) | ForEach-Object { $_ -replace "TARGET_SERVER", ${env:TEST_PHP_SQL_SERVER} -replace "TARGET_DATABASE", ${env:PDOSQLSRV_DBNAME} -replace "TARGET_USERNAME", ${env:TEST_PHP_SQL_UID} -replace "TARGET_PASSWORD", ${env:TEST_PHP_SQL_PWD} } | Set-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc + - ps: Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc + - ps: (Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc) | ForEach-Object { $_ -replace "TARGET_SERVER", ${env:TEST_PHP_SQL_SERVER} -replace "TARGET_DATABASE", ${env:SQLSRV_DBNAME} -replace "TARGET_USERNAME", ${env:TEST_PHP_SQL_UID} -replace "TARGET_PASSWORD", ${env:TEST_PHP_SQL_PWD} } | Set-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc + - ps: Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc + - echo install opencppcoverage + - choco install opencppcoverage + - set path=C:\Program Files\OpenCppCoverage;%path% + +build_script: + - '"C:\\Program Files (x86)\\Microsoft Visual Studio %PHP_VC%.0\\VC\\vcvarsall.bat" %BUILD_PLATFORM%' + - Echo copy msphp code to ext folder + - mkdir %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv + - mkdir %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv\shared + - mkdir %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv + - mkdir %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv\shared + - copy /Y %APPVEYOR_BUILD_FOLDER%\source\sqlsrv %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv + - copy /Y %APPVEYOR_BUILD_FOLDER%\source\shared %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv\shared + - copy /Y %APPVEYOR_BUILD_FOLDER%\source\shared %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv\shared + - copy /Y %APPVEYOR_BUILD_FOLDER%\source\pdo_sqlsrv %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv + - cd %PHP_SDK_DIR%\php-%PHP_VERSION%-src + - cd + - dir + - '%PHP_SDK%\bin\phpsdk_setvars.bat' + - buildconf.bat + # only build CLI and MSSQL extensions + - configure.bat --disable-all %PHP_ZTS% --enable-cli --enable-sqlsrv=shared --with-pdo-sqlsrv=shared --enable-pdo=shared --with-prefix=%PHP_INSTALL_DIR% + - copy php.ini-development php.ini + - echo extension_dir=%PHP_INSTALL_DIR%\ext >> php.ini + - echo extension=php_sqlsrv.dll >> php.ini + - echo extension=php_pdo_sqlsrv.dll >> php.ini + - nmake + - nmake install + - Echo copy php.ini and run-tests.php from php source to install directory. + - copy php.ini %PHP_INSTALL_DIR% + - copy run-tests.php %PHP_INSTALL_DIR% + - dir %PHP_INSTALL_DIR% + +test_script: + - cd %PHP_INSTALL_DIR% + - php --ini + - php -i + - python -V + - Echo setup test database for SQLSRV tests - %SQLSRV_DBNAME% + - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\setup_dbs.py -dbname %SQLSRV_DBNAME% + - Echo setup test database for PDO_SQLSRV tests - %PDOSQLSRV_DBNAME% + - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\setup_dbs.py -dbname %PDOSQLSRV_DBNAME% + - ps: >- + If ($env:SQL_INSTANCE -Match "SQL2016") { + Write-Host "Running phpt tests via OpenCppCoverage..." + $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; + OpenCppCoverage.exe --sources $ext_dir\sqlsrv --sources $ext_dir\pdo_sqlsrv --modules ext\php_sqlsrv.dll --modules ext\php_pdo_sqlsrv.dll --export_type=cobertura:.\coverage.xml --quiet --cover_children --continue_after_cpp_exception --optimized_build -- .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -encoding UTF8; + type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log; + ls *.xml + } Else { + Write-Host "Running phpt tests the regular way..." + .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log -encoding UTF8; + type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log; + .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\*.phpt | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log -encoding UTF8; + type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log; + } + - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %SQLSRV_DBNAME% + - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %PDOSQLSRV_DBNAME% + - cd %PHP_INSTALL_DIR% + - ps: $fileExists = Test-Path "coverage.xml" + - ps: >- + If ($fileExists -eq $true) { + Write-Host "Running coverage analysis..."; + $env:PATH = ${env:PHP_INSTALL_DIR} + $env:PATH; + Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh + bash codecov.sh -f "coverage.xml" + } + +after_test: + - cd %APPVEYOR_BUILD_FOLDER%\test\functional\ + - ps: ls *.log + - python output.py + - ps: $difffiles = Get-ChildItem sqlsrv\*.diff + - ps: $outfiles = Get-ChildItem sqlsrv\*.out + - ps: foreach($file in $difffiles){ls $file; more $file} + - ps: foreach($file in $outfiles){ls $file; more $file} + - ps: $diff2files = Get-ChildItem pdo_sqlsrv\*.diff + - ps: $out2files = Get-ChildItem pdo_sqlsrv\*.out + - ps: foreach($file in $diff2files){ls $file; more $file} + - ps: foreach($file in $out2files){ls $file; more $file} + - cd %APPVEYOR_BUILD_FOLDER%\test\functional\ + - ps: $xmlfiles = Get-ChildItem *.xml + - ps: foreach($file in $xmlfiles){(new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $file))} + - ps: >- + If ($difffiles -ne $null -Or $diff2files -ne $null) { + $host.SetShouldExit(1); + Write-Host "Forcing build failure due to phpt unit test failure(s)"; + } diff --git a/buildscripts/builddrivers.py b/buildscripts/builddrivers.py index 75fcb5b1a..4378ad1f1 100644 --- a/buildscripts/builddrivers.py +++ b/buildscripts/builddrivers.py @@ -40,8 +40,8 @@ class BuildDriver(object): testing # whether the user has turned on testing mode """ - def __init__(self, phpver, driver, arch, thread, debug, repo, branch, source, path, testing): - self.util = BuildUtil(phpver, driver, arch, thread, debug) + def __init__(self, phpver, driver, arch, thread, debug, repo, branch, source, path, testing, no_rename): + self.util = BuildUtil(phpver, driver, arch, thread, no_rename, debug) self.repo = repo self.branch = branch self.source_path = source @@ -243,6 +243,7 @@ def validate_input(question, values): parser.add_argument('--SOURCE', default=None, help="a local path to source file (default: None)") parser.add_argument('--TESTING', action='store_true', help="turns on testing mode (default: False)") parser.add_argument('--DESTPATH', default=None, help="an alternative destination for the drivers (default: None)") + parser.add_argument('--NO_RENAME', action='store_true', help="drivers will not be renamed(default: False)") args = parser.parse_args() @@ -256,6 +257,7 @@ def validate_input(question, values): source = args.SOURCE path = args.DESTPATH testing = args.TESTING + no_rename = args.NO_RENAME if phpver is None: # starts interactive mode, testing mode is False @@ -301,5 +303,6 @@ def validate_input(question, values): branch, source, path, - testing) + testing, + no_rename) builder.build() diff --git a/buildscripts/buildtools.py b/buildscripts/buildtools.py index d617087c9..306aafaa7 100644 --- a/buildscripts/buildtools.py +++ b/buildscripts/buildtools.py @@ -31,14 +31,16 @@ class BuildUtil(object): driver # all, sqlsrv, or pdo_sqlsrv arch # x64 or x86 thread # nts or ts + no_rename # do NOT rename the drivers if True debug_enabled # whether debug is enabled """ - def __init__(self, phpver, driver, arch, thread, debug_enabled = False): + def __init__(self, phpver, driver, arch, thread, no_rename, debug_enabled = False): self.phpver = phpver self.driver = driver.lower() self.arch = arch.lower() self.thread = thread.lower() + self.no_rename = no_rename self.debug_enabled = debug_enabled def major_version(self): @@ -409,8 +411,9 @@ def build_drivers(self, make_clean = False, dest = None, log_file = None): # already been modified prior to building the extensions shutil.rmtree(os.path.join(phpSDK, 'Source'), ignore_errors=True) - # Next, rename the newly compiled PHP extensions - self.rename_binaries(sdk_dir) + # Next, rename the newly compiled PHP extensions, if required + if not self.no_rename: + self.rename_binaries(sdk_dir) # Final step, copy the binaries to the right place ext_dir = self.copy_binaries(sdk_dir, copy_to_ext) @@ -440,7 +443,7 @@ def rename_binaries(self, sdk_dir): def copy_binary(self, from_dir, dest_dir, driver, suffix): """Copy sqlsrv or pdo_sqlsrv binary (based on *suffix*) to *dest_dir*.""" - if suffix == '.dll': + if not self.no_rename and suffix == '.dll': binary = self.driver_new_name(driver, suffix) else: binary = self.driver_name(driver, suffix) From dc952561174b1dc48a901616de520a3efc73d9f7 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Mon, 23 Apr 2018 09:57:07 -0700 Subject: [PATCH 04/12] why empty coverage --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 8410e1e94..3c3610e47 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -130,6 +130,8 @@ test_script: - ps: >- If ($env:BUILD_PLATFORM -Match "x86") { Write-Host "Running phpt tests via OpenCppCoverage..." + dir $env:PHP_SRC_DIR\*sqlsrv + dir .\*sqlsrv*.dll OpenCppCoverage.exe --sources $env:PHP_SRC_DIR\sqlsrv --sources $env:PHP_SRC_DIR\pdo_sqlsrv --modules .\php_sqlsrv.dll --modules .\php_pdo_sqlsrv.dll --export_type=cobertura:.\coverage.xml --quiet --cover_children --continue_after_cpp_exception --optimized_build -- .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -encoding UTF8; Write-Host "Showing the last 25 lines of the log file..." Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -Tail 25; From ac5064aee1425471ccb8e736cf9953e3c21772d6 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Mon, 23 Apr 2018 10:19:02 -0700 Subject: [PATCH 05/12] keep trying --- appveyor.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 3c3610e47..06b92a941 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -121,6 +121,7 @@ build_script: # echo $env:PDO_SQLSRV - php --ini - php -m + - ps: Get-Content ${env:PHP_EXE_PATH}\php.ini -Tail 10 test_script: - Echo setup test database for SQLSRV tests - %SQLSRV_DBNAME% @@ -130,9 +131,10 @@ test_script: - ps: >- If ($env:BUILD_PLATFORM -Match "x86") { Write-Host "Running phpt tests via OpenCppCoverage..." - dir $env:PHP_SRC_DIR\*sqlsrv + dir $env:PHP_SRC_DIR\sqlsrv + dir $env:PHP_SRC_DIR\pdo_sqlsrv dir .\*sqlsrv*.dll - OpenCppCoverage.exe --sources $env:PHP_SRC_DIR\sqlsrv --sources $env:PHP_SRC_DIR\pdo_sqlsrv --modules .\php_sqlsrv.dll --modules .\php_pdo_sqlsrv.dll --export_type=cobertura:.\coverage.xml --quiet --cover_children --continue_after_cpp_exception --optimized_build -- .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -encoding UTF8; + OpenCppCoverage.exe --sources ${env:PHP_SRC_DIR}\sqlsrv --sources ${env:PHP_SRC_DIR}\pdo_sqlsrv --modules .\php_sqlsrv.dll --modules .\php_pdo_sqlsrv.dll --export_type=cobertura:.\coverage.xml --quiet --cover_children --continue_after_cpp_exception --optimized_build -- .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -encoding UTF8; Write-Host "Showing the last 25 lines of the log file..." Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -Tail 25; ls *.xml From 806c6634d53bf7ed3a07e81f3234dc1bf4535cf7 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Mon, 23 Apr 2018 14:06:34 -0700 Subject: [PATCH 06/12] used full path for modules --- appveyor.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 06b92a941..608c05ef5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -131,10 +131,7 @@ test_script: - ps: >- If ($env:BUILD_PLATFORM -Match "x86") { Write-Host "Running phpt tests via OpenCppCoverage..." - dir $env:PHP_SRC_DIR\sqlsrv - dir $env:PHP_SRC_DIR\pdo_sqlsrv - dir .\*sqlsrv*.dll - OpenCppCoverage.exe --sources ${env:PHP_SRC_DIR}\sqlsrv --sources ${env:PHP_SRC_DIR}\pdo_sqlsrv --modules .\php_sqlsrv.dll --modules .\php_pdo_sqlsrv.dll --export_type=cobertura:.\coverage.xml --quiet --cover_children --continue_after_cpp_exception --optimized_build -- .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -encoding UTF8; + OpenCppCoverage.exe --sources ${env:PHP_SRC_DIR}\*sqlsrv --modules ${env:PHP_EXE_PATH}\php*sqlsrv.dll --export_type=cobertura:.\coverage.xml --quiet --cover_children --continue_after_cpp_exception --optimized_build -- .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -encoding UTF8; Write-Host "Showing the last 25 lines of the log file..." Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -Tail 25; ls *.xml From 0169ec7f36e13bf22f67d10e00b9f723951c6a20 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Mon, 23 Apr 2018 14:54:26 -0700 Subject: [PATCH 07/12] Tried other things --- appveyor.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 608c05ef5..dd12cb716 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -151,12 +151,12 @@ test_script: - ps: >- If ($fileExists -eq $true) { Write-Host "Running coverage analysis..."; - Get-Content .\coverage.xml -Head 50; - Write-Host "Showing the last 50 lines of coverage..."; - Get-Content .\coverage.xml -Tail 50; + Get-Content .\coverage.xml -Head 25; + Write-Host "Showing the packages..."; + Select-String package .\coverage.xml; $env:PATH = ${env:PHP_EXE_PATH} + $env:PATH; Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh - bash codecov.sh -f "coverage.xml" + bash codecov.sh -x fix -f "coverage.xml" } # - if exist codecov.sh (bash codecov.sh -f "coverage.xml") From 3dbacb8e79af5ed3bc8c47cb6642d7d37761e7cf Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Mon, 23 Apr 2018 19:07:44 -0700 Subject: [PATCH 08/12] Try a shorter path --- appveyor.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index dd12cb716..682da4816 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -131,7 +131,7 @@ test_script: - ps: >- If ($env:BUILD_PLATFORM -Match "x86") { Write-Host "Running phpt tests via OpenCppCoverage..." - OpenCppCoverage.exe --sources ${env:PHP_SRC_DIR}\*sqlsrv --modules ${env:PHP_EXE_PATH}\php*sqlsrv.dll --export_type=cobertura:.\coverage.xml --quiet --cover_children --continue_after_cpp_exception --optimized_build -- .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -encoding UTF8; + OpenCppCoverage.exe --sources ${env:PHP_SRC_DIR}\*sqlsrv --modules ${env:PHP_EXE_PATH}\php*sqlsrv.dll --export_type=cobertura:c:\projects\coverage.xml --quiet --cover_children --continue_after_cpp_exception --optimized_build -- .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -encoding UTF8; Write-Host "Showing the last 25 lines of the log file..." Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -Tail 25; ls *.xml @@ -147,16 +147,17 @@ test_script: - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %SQLSRV_DBNAME% - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %PDOSQLSRV_DBNAME% - cd %PHP_EXE_PATH% - - ps: $fileExists = Test-Path "coverage.xml" + - ps: $fileExists = Test-Path "c:\projects\coverage.xml" - ps: >- If ($fileExists -eq $true) { + cd c:\projects Write-Host "Running coverage analysis..."; Get-Content .\coverage.xml -Head 25; Write-Host "Showing the packages..."; Select-String package .\coverage.xml; - $env:PATH = ${env:PHP_EXE_PATH} + $env:PATH; Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh bash codecov.sh -x fix -f "coverage.xml" + cd ${env:PHP_EXE_PATH} } # - if exist codecov.sh (bash codecov.sh -f "coverage.xml") From 714ea0fa9d8e87ea03edf7eff85a27761bd8a594 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Mon, 23 Apr 2018 20:08:38 -0700 Subject: [PATCH 09/12] Cleaning up to double check --- appveyor.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 682da4816..4ef224457 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -91,11 +91,9 @@ install: - cd c:\projects - echo update SQL connection string - ps: (Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc) | ForEach-Object { $_ -replace "TARGET_SERVER", ${env:TEST_PHP_SQL_SERVER} -replace "TARGET_DATABASE", ${env:PDOSQLSRV_DBNAME} -replace "TARGET_USERNAME", ${env:TEST_PHP_SQL_UID} -replace "TARGET_PASSWORD", ${env:TEST_PHP_SQL_PWD} } | Set-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc - # - ps: Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc - ps: Select-String ${env:SQL_INSTANCE} ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc - ps: Select-String ${env:PDOSQLSRV_DBNAME} ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc - ps: (Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc) | ForEach-Object { $_ -replace "TARGET_SERVER", ${env:TEST_PHP_SQL_SERVER} -replace "TARGET_DATABASE", ${env:SQLSRV_DBNAME} -replace "TARGET_USERNAME", ${env:TEST_PHP_SQL_UID} -replace "TARGET_PASSWORD", ${env:TEST_PHP_SQL_PWD} } | Set-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc - # - ps: Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc - ps: Select-String ${env:SQL_INSTANCE} ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc - ps: Select-String ${env:SQLSRV_DBNAME} ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc - echo install opencppcoverage @@ -109,19 +107,12 @@ build_script: - python builddrivers.py --PHPVER=%PHP_VERSION% --ARCH=%BUILD_PLATFORM% --THREAD=%THREAD% --SOURCE=%APPVEYOR_BUILD_FOLDER%\source --TESTING --NO_RENAME - cd c:\projects\php-sdk\phpdev\vc%PHP_VC%\%BUILD_PLATFORM%\php-%PHP_VERSION%-src\ - set PHP_SRC_DIR=%CD%\ext - - echo %PHP_SRC_DIR% - cd %PHP_EXE_PATH% - set PHP_EXE_PATH=%CD% - - echo %PHP_EXE_PATH% - # - ps: | - # $env:PHP_VER = $env:PHP_MAJOR_VER -replace '\.', '' - # $env:SQLSRV = $env:PHP_EXE_PATH + "\php_sqlsrv_" + $env:PHP_VER + "_" + $env:THREAD + ".dll" - # echo $env:SQLSRV - # $env:PDO_SQLSRV = $env:PHP_EXE_PATH + "\php_pdo_sqlsrv_" + $env:PHP_VER + "_" + $env:THREAD + ".dll" - # echo $env:PDO_SQLSRV + - echo Showing the last few lines of php.ini + - ps: Get-Content ${env:PHP_EXE_PATH}\php.ini -Tail 5 - php --ini - php -m - - ps: Get-Content ${env:PHP_EXE_PATH}\php.ini -Tail 10 test_script: - Echo setup test database for SQLSRV tests - %SQLSRV_DBNAME% @@ -152,14 +143,12 @@ test_script: If ($fileExists -eq $true) { cd c:\projects Write-Host "Running coverage analysis..."; - Get-Content .\coverage.xml -Head 25; Write-Host "Showing the packages..."; Select-String package .\coverage.xml; Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh - bash codecov.sh -x fix -f "coverage.xml" + bash codecov.sh -f "coverage.xml" cd ${env:PHP_EXE_PATH} } - # - if exist codecov.sh (bash codecov.sh -f "coverage.xml") after_test: - cd %APPVEYOR_BUILD_FOLDER%\test\functional\ From bdecae6635ef3fc1718b3dbca86557dd08e0f360 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Mon, 23 Apr 2018 20:33:49 -0700 Subject: [PATCH 10/12] Switched the builder image --- appveyor.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 4ef224457..f1649a7b8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,16 +18,6 @@ environment: PYTHON: c:\Python36 # For details about Appveyor build worker images (VM template): https://www.appveyor.com/docs/build-environment/#build-worker-images matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - BUILD_PLATFORM: x86 - TEST_PHP_SQL_SERVER: (local)\SQL2012SP1 - SQL_INSTANCE: SQL2012SP1 - PHP_VC: 14 - PHP_MAJOR_VER: 7.1 - PHP_MINOR_VER: latest - PHP_EXE_PATH: Release - THREAD: nts - platform: x86 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 BUILD_PLATFORM: x64 TEST_PHP_SQL_SERVER: (local)\SQL2016 @@ -38,6 +28,16 @@ environment: PHP_EXE_PATH: x64\Release_TS THREAD: ts platform: x64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + BUILD_PLATFORM: x86 + TEST_PHP_SQL_SERVER: (local)\SQL2012SP1 + SQL_INSTANCE: SQL2012SP1 + PHP_VC: 14 + PHP_MAJOR_VER: 7.1 + PHP_MINOR_VER: latest + PHP_EXE_PATH: Release + THREAD: nts + platform: x86 # PHP_MAJOR_VER is PHP major version to build (7.2, 7.1) # PHP_MINOR_VER is PHP point release number (or latest for latest release) From 4d9cc3c15f222db90baf484043fc3dcc82fa17fa Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Mon, 23 Apr 2018 20:41:34 -0700 Subject: [PATCH 11/12] Removed the wrong yml file --- appveyor_original.yml | 201 ------------------------------------------ 1 file changed, 201 deletions(-) delete mode 100644 appveyor_original.yml diff --git a/appveyor_original.yml b/appveyor_original.yml deleted file mode 100644 index 59a28d150..000000000 --- a/appveyor_original.yml +++ /dev/null @@ -1,201 +0,0 @@ -version: '{branch}.{build}' - -branches: - # whitelist - #only: - - # blacklist - except: - - PHP-7.0-Linux - - PHP5 - -environment: - # MSSQL credentials from https://www.appveyor.com/docs/services-databases/ - TEST_PHP_SQL_PWD: Password12! - TEST_PHP_SQL_UID: sa - SQLSRV_DBNAME: msphpsql_sqlsrv - PDOSQLSRV_DBNAME: msphpsql_pdosqlsrv - PHP_DEPSVER: 7.0 - PHP_SDK: c:\projects\php - matrix: - - BUILD_PLATFORM: x64 - TEST_PHP_SQL_SERVER: (local)\SQL2012SP1 - SQL_INSTANCE: SQL2012SP1 - PHP_VC: 14 - PHP_MAJOR_VER: 7.1 - PHP_MINOR_VER: latest - PHP_SDK_DIR: c:\projects\php\x64 - PHP_INSTALL_DIR: c:\projects\php\x64\bin - platform: x64 - - BUILD_PLATFORM: x86 - TEST_PHP_SQL_SERVER: (local)\SQL2016 - SQL_INSTANCE: SQL2016 - PHP_VC: 14 - PHP_MAJOR_VER: 7.1 - PHP_MINOR_VER: latest - PHP_SDK_DIR: c:\projects\php\x86 - PHP_INSTALL_DIR: c:\projects\php\x86\bin - PHP_ZTS: --disable-zts - platform: x86 - -# PHP_MAJOR_VER is PHP major version to build (7.0, 7.1) -# PHP_MINOR_VER is PHP point release number (or latest for latest release) -# PHP_INSTALL_DIR is where the built PHP binaries go -# PHP_SDK_DIR is where PHP source is extracted to (e.g. PHP_SDK_DIR\php-7.0.14-src) -# PHP_SDK is where PHP sdk binary tools are extracted to -# PHP_VC is the Visual C++ version -# PHP_ZTS is defined to disable thread safe build - -# Build worker image (VM template) -image: Visual Studio 2015 - -matrix: - fast_finish: true - -#services: - #- mssql2012sp1 - -# clone directory (or %APPVEYOR_BUILD_FOLDER%) -clone_folder: c:\projects\sqlphp - -build: - parallel: true # enable MSBuild parallel builds - -install: - - echo start SQL Server - # Based on http://www.appveyor.com/docs/services-databases - - ps: >- - [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null ; - [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | Out-Null ; - - $instanceName = $env:SQL_INSTANCE; - $uri = "ManagedComputer[@Name='$env:COMPUTERNAME']/ServerInstance[@Name='$instanceName']/ServerProtocol[@Name='Tcp']"; - $wmi = New-Object ('Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer'); - $tcp = $wmi.GetSmoObject($uri); - $tcp.IsEnabled = $true; - $tcp.Alter(); - Start-Service "MSSQL`$$instanceName"; - - Set-Service SQLBrowser -StartupType Manual; - Start-Service SQLBrowser; - - echo Downloading prerequisites - - ps: | - $client = New-Object Net.WebClient; - $client.Headers.Add("user-agent", "appveyor-ci-build1"); - $client.DownloadFile("http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip", "c:\projects\php-sdk-binary-tools-20110915.zip"); - - ps: | - $client = New-Object Net.WebClient; - $client.Headers.Add("user-agent", "appveyor-ci-build2"); - $client.DownloadFile("http://windows.php.net/downloads/releases/sha1sum.txt", "c:\projects\sha1sum.txt"); - If ($env:PHP_MINOR_VER -Match "latest") { - $env:PHP_VERSION=type c:\projects\sha1sum.txt | where { $_ -match "php-($env:PHP_MAJOR_VER\.\d+)-src" } | foreach { $matches[1] } ; - } Else { - $env:PHP_VERSION=$env:PHP_MAJOR_VER + '.' + $env:PHP_MINOR_VER; - } - - ps: | - $client = New-Object Net.WebClient; - $client.Headers.Add("user-agent", "appveyor-ci-build3"); - $client.DownloadFile("http://windows.php.net/downloads/releases/php-" + ${env:PHP_VERSION} + "-src.zip", ${env:APPVEYOR_BUILD_FOLDER} + "\..\php.zip"); - - echo Downloading MSODBCSQL 13.1 - # 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/D/5/E/D5EEF288-A277-45C8-855B-8E2CB7E25B96/x64/msodbcsql.msi', 'c:\projects\msodbcsql.msi') - - cmd /c start /wait msiexec /i "c:\projects\msodbcsql.msi" /q - - echo Checking the version of MSODBCSQL - - reg query "HKLM\SOFTWARE\ODBC\odbcinst.ini\ODBC Driver 13 for SQL Server" - - dir C:\Windows\System32\msodbcsql13.dll - - cd c:\projects - - 7z x -y .\php-sdk-binary-tools-20110915.zip -o%PHP_SDK% - - 7z x -y .\php.zip -o%PHP_SDK_DIR% - - echo update SQL connection string - - ps: (Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc) | ForEach-Object { $_ -replace "TARGET_SERVER", ${env:TEST_PHP_SQL_SERVER} -replace "TARGET_DATABASE", ${env:PDOSQLSRV_DBNAME} -replace "TARGET_USERNAME", ${env:TEST_PHP_SQL_UID} -replace "TARGET_PASSWORD", ${env:TEST_PHP_SQL_PWD} } | Set-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc - - ps: Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc - - ps: (Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc) | ForEach-Object { $_ -replace "TARGET_SERVER", ${env:TEST_PHP_SQL_SERVER} -replace "TARGET_DATABASE", ${env:SQLSRV_DBNAME} -replace "TARGET_USERNAME", ${env:TEST_PHP_SQL_UID} -replace "TARGET_PASSWORD", ${env:TEST_PHP_SQL_PWD} } | Set-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc - - ps: Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc - - echo install opencppcoverage - - choco install opencppcoverage - - set path=C:\Program Files\OpenCppCoverage;%path% - -build_script: - - '"C:\\Program Files (x86)\\Microsoft Visual Studio %PHP_VC%.0\\VC\\vcvarsall.bat" %BUILD_PLATFORM%' - - Echo copy msphp code to ext folder - - mkdir %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv - - mkdir %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv\shared - - mkdir %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv - - mkdir %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv\shared - - copy /Y %APPVEYOR_BUILD_FOLDER%\source\sqlsrv %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv - - copy /Y %APPVEYOR_BUILD_FOLDER%\source\shared %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv\shared - - copy /Y %APPVEYOR_BUILD_FOLDER%\source\shared %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv\shared - - copy /Y %APPVEYOR_BUILD_FOLDER%\source\pdo_sqlsrv %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv - - cd %PHP_SDK_DIR%\php-%PHP_VERSION%-src - - cd - - dir - - '%PHP_SDK%\bin\phpsdk_setvars.bat' - - buildconf.bat - # only build CLI and MSSQL extensions - - configure.bat --disable-all %PHP_ZTS% --enable-cli --enable-sqlsrv=shared --with-pdo-sqlsrv=shared --enable-pdo=shared --with-prefix=%PHP_INSTALL_DIR% - - copy php.ini-development php.ini - - echo extension_dir=%PHP_INSTALL_DIR%\ext >> php.ini - - echo extension=php_sqlsrv.dll >> php.ini - - echo extension=php_pdo_sqlsrv.dll >> php.ini - - nmake - - nmake install - - Echo copy php.ini and run-tests.php from php source to install directory. - - copy php.ini %PHP_INSTALL_DIR% - - copy run-tests.php %PHP_INSTALL_DIR% - - dir %PHP_INSTALL_DIR% - -test_script: - - cd %PHP_INSTALL_DIR% - - php --ini - - php -i - - python -V - - Echo setup test database for SQLSRV tests - %SQLSRV_DBNAME% - - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\setup_dbs.py -dbname %SQLSRV_DBNAME% - - Echo setup test database for PDO_SQLSRV tests - %PDOSQLSRV_DBNAME% - - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\setup_dbs.py -dbname %PDOSQLSRV_DBNAME% - - ps: >- - If ($env:SQL_INSTANCE -Match "SQL2016") { - Write-Host "Running phpt tests via OpenCppCoverage..." - $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; - OpenCppCoverage.exe --sources $ext_dir\sqlsrv --sources $ext_dir\pdo_sqlsrv --modules ext\php_sqlsrv.dll --modules ext\php_pdo_sqlsrv.dll --export_type=cobertura:.\coverage.xml --quiet --cover_children --continue_after_cpp_exception --optimized_build -- .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -encoding UTF8; - type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log; - ls *.xml - } Else { - Write-Host "Running phpt tests the regular way..." - .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log -encoding UTF8; - type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log; - .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\*.phpt | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log -encoding UTF8; - type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log; - } - - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %SQLSRV_DBNAME% - - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %PDOSQLSRV_DBNAME% - - cd %PHP_INSTALL_DIR% - - ps: $fileExists = Test-Path "coverage.xml" - - ps: >- - If ($fileExists -eq $true) { - Write-Host "Running coverage analysis..."; - $env:PATH = ${env:PHP_INSTALL_DIR} + $env:PATH; - Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh - bash codecov.sh -f "coverage.xml" - } - -after_test: - - cd %APPVEYOR_BUILD_FOLDER%\test\functional\ - - ps: ls *.log - - python output.py - - ps: $difffiles = Get-ChildItem sqlsrv\*.diff - - ps: $outfiles = Get-ChildItem sqlsrv\*.out - - ps: foreach($file in $difffiles){ls $file; more $file} - - ps: foreach($file in $outfiles){ls $file; more $file} - - ps: $diff2files = Get-ChildItem pdo_sqlsrv\*.diff - - ps: $out2files = Get-ChildItem pdo_sqlsrv\*.out - - ps: foreach($file in $diff2files){ls $file; more $file} - - ps: foreach($file in $out2files){ls $file; more $file} - - cd %APPVEYOR_BUILD_FOLDER%\test\functional\ - - ps: $xmlfiles = Get-ChildItem *.xml - - ps: foreach($file in $xmlfiles){(new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $file))} - - ps: >- - If ($difffiles -ne $null -Or $diff2files -ne $null) { - $host.SetShouldExit(1); - Write-Host "Forcing build failure due to phpt unit test failure(s)"; - } From 246824afdd9647bc6a5cf82fafbca7fe9a7e4745 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Tue, 24 Apr 2018 07:37:53 -0700 Subject: [PATCH 12/12] Use the latest SQL Server --- appveyor.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f1649a7b8..9d2cdeea1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,8 +20,8 @@ environment: matrix: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 BUILD_PLATFORM: x64 - TEST_PHP_SQL_SERVER: (local)\SQL2016 - SQL_INSTANCE: SQL2016 + TEST_PHP_SQL_SERVER: (local)\SQL2017 + SQL_INSTANCE: SQL2017 PHP_VC: 15 PHP_MAJOR_VER: 7.2 PHP_MINOR_VER: latest @@ -30,8 +30,8 @@ environment: platform: x64 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 BUILD_PLATFORM: x86 - TEST_PHP_SQL_SERVER: (local)\SQL2012SP1 - SQL_INSTANCE: SQL2012SP1 + TEST_PHP_SQL_SERVER: (local)\SQL2016 + SQL_INSTANCE: SQL2016 PHP_VC: 14 PHP_MAJOR_VER: 7.1 PHP_MINOR_VER: latest