From ae2f09b5cfd3186a0e14502876b30705a569ee6c Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Thu, 16 Nov 2017 13:12:50 -0800 Subject: [PATCH 01/44] More experiment with code cov tool --- appveyor.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f1994bc2..3214e819 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -127,11 +127,13 @@ install: - 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 - - appveyor DownloadFile http://github.com/OpenCppCoverage/OpenCppCoverage/releases/download/release-0.9.6.1/OpenCppCoverageSetup-x64-0.9.6.1.exe - - OpenCppCoverageSetup-x64-0.9.6.1.exe /VERYSILENT - - ps: ls "c:\Program Files" - - set CPPCOVER="C:\\Program Files\\OpenCppCoverage" - - set PATH=%CPPCOVER%;%PATH% + #- appveyor DownloadFile http://github.com/OpenCppCoverage/OpenCppCoverage/releases/download/release-0.9.6.1/OpenCppCoverageSetup-x64-0.9.6.1.exe + #- OpenCppCoverageSetup-x64-0.9.6.1.exe /VERYSILENT + #- ps: ls "c:\Program Files" + #- set CPPCOVER="C:\\Program Files\\OpenCppCoverage" + #- set PATH=%CPPCOVER%;%PATH% + - 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%' From 40084610a4746c022d38e0f4bb5af1233c920dcb Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Thu, 16 Nov 2017 15:42:17 -0800 Subject: [PATCH 02/44] Tried to add x64 bit back to the matrix --- appveyor.yml | 108 ++++++++++++++++++++++++++------------------------- 1 file changed, 55 insertions(+), 53 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 3214e819..d799ea6b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ version: '{branch}.{build}' - + branches: # whitelist #only: @@ -17,35 +17,35 @@ environment: PDOSQLSRV_DBNAME: msphpsql_pdosqlsrv PHP_DEPSVER: 7.0 PHP_SDK: c:\projects\php - matrix: - - BUILD_PLATFORM: x86 + matrix: + - BUILD_PLATFORM: x64 TEST_PHP_SQL_SERVER: (local)\SQL2016 SQL_INSTANCE: SQL2016 PHP_VC: 14 PHP_MAJOR_VER: 7.1 - PHP_MINOR_VER: latest + PHP_MINOR_VER: latest PHP_SDK_DIR: c:\projects\php\x86 - PHP_INSTALL_DIR: c:\projects\php\x86\bin - platform: x86 + PHP_INSTALL_DIR: c:\projects\php\x86\bin + platform: x64 - BUILD_PLATFORM: x86 TEST_PHP_SQL_SERVER: (local)\SQL2012SP1 SQL_INSTANCE: SQL2012SP1 PHP_VC: 14 PHP_MAJOR_VER: 7.0 - PHP_MINOR_VER: latest + 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 - - BUILD_PLATFORM: x86 + - BUILD_PLATFORM: x64 TEST_PHP_SQL_SERVER: (local)\SQL2014 SQL_INSTANCE: SQL2014 PHP_VC: 14 PHP_MAJOR_VER: 7.0 PHP_MINOR_VER: latest PHP_SDK_DIR: c:\projects\php\x86 - PHP_INSTALL_DIR: c:\projects\php\x86\bin - platform: x86 + PHP_INSTALL_DIR: c:\projects\php\x86\bin + platform: x64 - BUILD_PLATFORM: x86 TEST_PHP_SQL_SERVER: (local)\SQL2008R2SP2 SQL_INSTANCE: SQL2008R2SP2 @@ -56,24 +56,24 @@ environment: 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_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 @@ -102,12 +102,12 @@ install: # determine latest PHP versions - ps: >- If ($env:PHP_MINOR_VER -Match "latest") { - $env:PHP_VERSION=type sha1sum.txt | where { $_ -match "php-($env:PHP_MAJOR_VER\.\d+)-src" } | foreach { $matches[1] } ; + $env:PHP_VERSION=type 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; } - echo Downloading PHP-SDK - - appveyor DownloadFile http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip + - appveyor DownloadFile http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip - move php-sdk-binary-tools-20110915.zip .. - echo Downloading PHP source code [%PHP_VERSION%] - ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/releases/php-' + ${env:PHP_VERSION} + '-src.zip', ${env:APPVEYOR_BUILD_FOLDER} + '\..\php.zip') @@ -115,7 +115,7 @@ install: # 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 + - 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 .. @@ -127,33 +127,29 @@ install: - 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 - #- appveyor DownloadFile http://github.com/OpenCppCoverage/OpenCppCoverage/releases/download/release-0.9.6.1/OpenCppCoverageSetup-x64-0.9.6.1.exe - #- OpenCppCoverageSetup-x64-0.9.6.1.exe /VERYSILENT - #- ps: ls "c:\Program Files" - #- set CPPCOVER="C:\\Program Files\\OpenCppCoverage" - #- set PATH=%CPPCOVER%;%PATH% + - 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 - 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 + - 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 + - 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 + - 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 @@ -162,13 +158,13 @@ build_script: - 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% + - dir %PHP_INSTALL_DIR% test_script: - - cd %PHP_INSTALL_DIR% + - cd %PHP_INSTALL_DIR% - php --ini - php -i - - python -V + - 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% @@ -178,41 +174,47 @@ test_script: - copy %APPVEYOR_BUILD_FOLDER%\test\functional\setup\*.dll %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\ - copy %APPVEYOR_BUILD_FOLDER%\test\functional\setup\*.dll %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\ - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\run_ksp.py -server %TEST_PHP_SQL_SERVER% -dbname %SQLSRV_DBNAME% -uid %TEST_PHP_SQL_UID% -pwd %TEST_PHP_SQL_PWD% - - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\run_ksp.py -server %TEST_PHP_SQL_SERVER% -dbname %PDOSQLSRV_DBNAME% -uid %TEST_PHP_SQL_UID% -pwd %TEST_PHP_SQL_PWD% - - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 + - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\run_ksp.py -server %TEST_PHP_SQL_SERVER% -dbname %PDOSQLSRV_DBNAME% -uid %TEST_PHP_SQL_UID% -pwd %TEST_PHP_SQL_PWD% + - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log - - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 + - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 - type %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log - - cd %APPVEYOR_BUILD_FOLDER%\test\functional\ - - 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: $difffiles = Get-ChildItem pdo_sqlsrv\*.diff - - ps: $outfiles = Get-ChildItem pdo_sqlsrv\*.out - - ps: foreach($file in $difffiles){ls $file; more $file} - - ps: foreach($file in $outfiles){ls $file; more $file} - - cd %PHP_INSTALL_DIR% - - OpenCppCoverage.exe --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P %APPVEYOR_BUILD_FOLDER%\test\functional\ + - cd %APPVEYOR_BUILD_FOLDER%\test\functional\ + - 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: $difffiles = Get-ChildItem pdo_sqlsrv\*.diff + - ps: $outfiles = Get-ChildItem pdo_sqlsrv\*.out + - ps: foreach($file in $difffiles){ls $file; more $file} + - ps: foreach($file in $outfiles){ls $file; more $file} + - if [%SQL_INSTANCE%]==[SQL2016] ( + SET EXT_DIR=%PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext + OpenCppCoverage.exe --sources %EXT_DIR%\pdo_sqlsrv --sources %EXT_DIR%\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P %APPVEYOR_BUILD_FOLDER%\test\functional\ + pip install codecov + codecov -f ".\coverage.xml" + ) + # - cd %PHP_INSTALL_DIR% + # - OpenCppCoverage.exe --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P %APPVEYOR_BUILD_FOLDER%\test\functional\ - ls - 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% - - pip install codecov - - codecov -f ".\coverage.xml" + # - pip install codecov + # - codecov -f ".\coverage.xml" after_test: - - cd %APPVEYOR_BUILD_FOLDER%\test\functional\ - - python output.py + - cd %APPVEYOR_BUILD_FOLDER%\test\functional\ + - python output.py - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult1.xml)) - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult2.xml)) - - ps: >- + - ps: >- [xml]$results = Get-Content nativeresult1.xml ; [xml]$results2 = Get-Content nativeresult2.xml ; $failure = $results.SelectSingleNode("//failure"); $failure2 = $results2.SelectSingleNode("//failure"); - if ($failure -ne $null -Or $failure2 -ne $null) - { + if ($failure -ne $null -Or $failure2 -ne $null) + { $host.SetShouldExit(1); Write-Host "Forcing build failure due to phpt unit test failure(s)"; } - + From a7d9da8be82997d54d5a10c02d4d385e1badc4d8 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Thu, 16 Nov 2017 23:06:06 -0800 Subject: [PATCH 03/44] Fixed the path to dlls --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d799ea6b..6a5e9f12 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -188,9 +188,9 @@ test_script: - ps: $outfiles = Get-ChildItem pdo_sqlsrv\*.out - ps: foreach($file in $difffiles){ls $file; more $file} - ps: foreach($file in $outfiles){ls $file; more $file} - - if [%SQL_INSTANCE%]==[SQL2016] ( + - if [%SQL_INSTANCE%] == [SQL2016] ( SET EXT_DIR=%PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext - OpenCppCoverage.exe --sources %EXT_DIR%\pdo_sqlsrv --sources %EXT_DIR%\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P %APPVEYOR_BUILD_FOLDER%\test\functional\ + OpenCppCoverage.exe --sources %EXT_DIR%\pdo_sqlsrv --sources %EXT_DIR%\sqlsrv --modules .\ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P %APPVEYOR_BUILD_FOLDER%\test\functional\ pip install codecov codecov -f ".\coverage.xml" ) From 026e14ffe3b4e9ff0e0378e3642e05af7b44b974 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Fri, 17 Nov 2017 08:38:56 -0800 Subject: [PATCH 04/44] Use powershell --- appveyor.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 6a5e9f12..344a7a48 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -179,6 +179,18 @@ test_script: - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 - type %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log + - ps: >- + If ($env:SQL_INSTANCE -Match "SQL2016") { + "SQL2016"; + ls .\ext\*sqlsrv*.dll; + $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; + "ext dir is " + $ext_dir; + OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules .\ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\; + pip install codecov + codecov -f ".\coverage.xml" + } Else { + "Not SQL2016" + } - cd %APPVEYOR_BUILD_FOLDER%\test\functional\ - ps: $difffiles = Get-ChildItem sqlsrv\*.diff - ps: $outfiles = Get-ChildItem sqlsrv\*.out @@ -188,12 +200,6 @@ test_script: - ps: $outfiles = Get-ChildItem pdo_sqlsrv\*.out - ps: foreach($file in $difffiles){ls $file; more $file} - ps: foreach($file in $outfiles){ls $file; more $file} - - if [%SQL_INSTANCE%] == [SQL2016] ( - SET EXT_DIR=%PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext - OpenCppCoverage.exe --sources %EXT_DIR%\pdo_sqlsrv --sources %EXT_DIR%\sqlsrv --modules .\ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P %APPVEYOR_BUILD_FOLDER%\test\functional\ - pip install codecov - codecov -f ".\coverage.xml" - ) # - cd %PHP_INSTALL_DIR% # - OpenCppCoverage.exe --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P %APPVEYOR_BUILD_FOLDER%\test\functional\ - ls From d32320d1ffd812297955264c5ff0f297031ce038 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Fri, 17 Nov 2017 09:32:56 -0800 Subject: [PATCH 05/44] Do not duplicate tests --- appveyor.yml | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 344a7a48..7cffec99 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -169,16 +169,16 @@ test_script: - 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% - - copy %APPVEYOR_BUILD_FOLDER%\source\shared\msodbcsql.h %APPVEYOR_BUILD_FOLDER%\test\functional\setup\ - - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\build_ksp.py - - copy %APPVEYOR_BUILD_FOLDER%\test\functional\setup\*.dll %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\ - - copy %APPVEYOR_BUILD_FOLDER%\test\functional\setup\*.dll %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\ - - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\run_ksp.py -server %TEST_PHP_SQL_SERVER% -dbname %SQLSRV_DBNAME% -uid %TEST_PHP_SQL_UID% -pwd %TEST_PHP_SQL_PWD% - - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\run_ksp.py -server %TEST_PHP_SQL_SERVER% -dbname %PDOSQLSRV_DBNAME% -uid %TEST_PHP_SQL_UID% -pwd %TEST_PHP_SQL_PWD% - - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 - - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log - - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 - - type %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log + #- copy %APPVEYOR_BUILD_FOLDER%\source\shared\msodbcsql.h %APPVEYOR_BUILD_FOLDER%\test\functional\setup\ + #- python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\build_ksp.py + #- copy %APPVEYOR_BUILD_FOLDER%\test\functional\setup\*.dll %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\ + #- copy %APPVEYOR_BUILD_FOLDER%\test\functional\setup\*.dll %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\ + #- python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\run_ksp.py -server %TEST_PHP_SQL_SERVER% -dbname %SQLSRV_DBNAME% -uid %TEST_PHP_SQL_UID% -pwd %TEST_PHP_SQL_PWD% + #- python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\run_ksp.py -server %TEST_PHP_SQL_SERVER% -dbname %PDOSQLSRV_DBNAME% -uid %TEST_PHP_SQL_UID% -pwd %TEST_PHP_SQL_PWD% + # - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 + # - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log + # - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 + # - type %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log - ps: >- If ($env:SQL_INSTANCE -Match "SQL2016") { "SQL2016"; @@ -186,10 +186,12 @@ test_script: $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; "ext dir is " + $ext_dir; OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules .\ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\; - pip install codecov - codecov -f ".\coverage.xml" } Else { "Not SQL2016" + .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log 2>&1; + cat ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log; + .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log 2>&1; + cat ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log; } - cd %APPVEYOR_BUILD_FOLDER%\test\functional\ - ps: $difffiles = Get-ChildItem sqlsrv\*.diff @@ -200,13 +202,17 @@ test_script: - ps: $outfiles = Get-ChildItem pdo_sqlsrv\*.out - ps: foreach($file in $difffiles){ls $file; more $file} - ps: foreach($file in $outfiles){ls $file; more $file} - # - cd %PHP_INSTALL_DIR% - # - OpenCppCoverage.exe --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P %APPVEYOR_BUILD_FOLDER%\test\functional\ - ls - 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% - # - pip install codecov - # - codecov -f ".\coverage.xml" + - ps: >- + $covFile = ${env:PHP_INSTALL_DIR} + "\coverage.xml"; + $fileExists = Test-Path $covFile + If ($fileExists -eq $True) { + "Installing codecov..." + pip install codecov + codecov -f $covFile + } after_test: - cd %APPVEYOR_BUILD_FOLDER%\test\functional\ From a603568ff832eb7d3752e42606b154e826be9c2f Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Fri, 17 Nov 2017 10:07:43 -0800 Subject: [PATCH 06/44] Switched the order of platforms in the matrix --- appveyor.yml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7cffec99..67f54bf5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,14 +18,24 @@ environment: PHP_DEPSVER: 7.0 PHP_SDK: c:\projects\php matrix: + - BUILD_PLATFORM: x64 + TEST_PHP_SQL_SERVER: (local)\SQL2014 + SQL_INSTANCE: SQL2014 + PHP_VC: 14 + PHP_MAJOR_VER: 7.0 + PHP_MINOR_VER: latest + PHP_SDK_DIR: c:\projects\php\x64 + PHP_INSTALL_DIR: c:\projects\php\x64\bin + PHP_ZTS: --disable-zts + platform: x64 - BUILD_PLATFORM: x64 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_SDK_DIR: c:\projects\php\x64 + PHP_INSTALL_DIR: c:\projects\php\x64\bin platform: x64 - BUILD_PLATFORM: x86 TEST_PHP_SQL_SERVER: (local)\SQL2012SP1 @@ -35,17 +45,7 @@ environment: 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 - - BUILD_PLATFORM: x64 - TEST_PHP_SQL_SERVER: (local)\SQL2014 - SQL_INSTANCE: SQL2014 - PHP_VC: 14 - PHP_MAJOR_VER: 7.0 - PHP_MINOR_VER: latest - PHP_SDK_DIR: c:\projects\php\x86 - PHP_INSTALL_DIR: c:\projects\php\x86\bin - platform: x64 - BUILD_PLATFORM: x86 TEST_PHP_SQL_SERVER: (local)\SQL2008R2SP2 SQL_INSTANCE: SQL2008R2SP2 @@ -184,7 +184,6 @@ test_script: "SQL2016"; ls .\ext\*sqlsrv*.dll; $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; - "ext dir is " + $ext_dir; OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules .\ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\; } Else { "Not SQL2016" @@ -202,16 +201,17 @@ test_script: - ps: $outfiles = Get-ChildItem pdo_sqlsrv\*.out - ps: foreach($file in $difffiles){ls $file; more $file} - ps: foreach($file in $outfiles){ls $file; more $file} - - ls - 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% + - ls *.xml + - ps: $covFile = ".\coverage.xml" + - ps: $fileExists = Test-Path $covFile - ps: >- - $covFile = ${env:PHP_INSTALL_DIR} + "\coverage.xml"; - $fileExists = Test-Path $covFile - If ($fileExists -eq $True) { - "Installing codecov..." - pip install codecov - codecov -f $covFile + If ($fileExists -eq $true) { + "Installing codecov..."; + pip install codecov; + codecov -f $covFile; } after_test: From d49cf12897d0d620450ca2b67accf18f2bce6a55 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Fri, 17 Nov 2017 10:29:19 -0800 Subject: [PATCH 07/44] Modified test matrix to try different combinations --- appveyor.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 67f54bf5..333657dd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,8 +19,8 @@ environment: PHP_SDK: c:\projects\php matrix: - BUILD_PLATFORM: x64 - TEST_PHP_SQL_SERVER: (local)\SQL2014 - SQL_INSTANCE: SQL2014 + TEST_PHP_SQL_SERVER: (local)\SQL2012SP1 + SQL_INSTANCE: SQL2012SP1 PHP_VC: 14 PHP_MAJOR_VER: 7.0 PHP_MINOR_VER: latest @@ -28,6 +28,15 @@ environment: PHP_INSTALL_DIR: c:\projects\php\x64\bin PHP_ZTS: --disable-zts platform: x64 + - BUILD_PLATFORM: x86 + TEST_PHP_SQL_SERVER: (local)\SQL2014 + SQL_INSTANCE: SQL2014 + PHP_VC: 14 + PHP_MAJOR_VER: 7.0 + PHP_MINOR_VER: latest + PHP_SDK_DIR: c:\projects\php\x86 + PHP_INSTALL_DIR: c:\projects\php\x86\bin + platform: x86 - BUILD_PLATFORM: x64 TEST_PHP_SQL_SERVER: (local)\SQL2016 SQL_INSTANCE: SQL2016 @@ -37,15 +46,6 @@ environment: 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)\SQL2012SP1 - SQL_INSTANCE: SQL2012SP1 - PHP_VC: 14 - PHP_MAJOR_VER: 7.0 - PHP_MINOR_VER: latest - PHP_SDK_DIR: c:\projects\php\x86 - PHP_INSTALL_DIR: c:\projects\php\x86\bin - platform: x86 - BUILD_PLATFORM: x86 TEST_PHP_SQL_SERVER: (local)\SQL2008R2SP2 SQL_INSTANCE: SQL2008R2SP2 @@ -204,7 +204,6 @@ 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_INSTALL_DIR% - - ls *.xml - ps: $covFile = ".\coverage.xml" - ps: $fileExists = Test-Path $covFile - ps: >- From fbb32473a8dc99e38802437991d4beecdcbc13ae Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Fri, 17 Nov 2017 12:47:56 -0800 Subject: [PATCH 08/44] Use codecov.io bash --- appveyor.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 333657dd..7a74bb8f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -181,12 +181,12 @@ test_script: # - type %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log - ps: >- If ($env:SQL_INSTANCE -Match "SQL2016") { - "SQL2016"; + "Running phpt tests via OpenCppCoverage..." ls .\ext\*sqlsrv*.dll; $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules .\ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\; } Else { - "Not SQL2016" + "Running phpt tests the regular way..." .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log 2>&1; cat ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log; .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log 2>&1; @@ -208,9 +208,10 @@ test_script: - ps: $fileExists = Test-Path $covFile - ps: >- If ($fileExists -eq $true) { - "Installing codecov..."; - pip install codecov; - codecov -f $covFile; + "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 $covFile } after_test: From b035fa2e0304571fa99213f503c66ed3c2916c99 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Fri, 17 Nov 2017 13:26:46 -0800 Subject: [PATCH 09/44] Put 2016 first in the matrix --- appveyor.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7a74bb8f..dd3c8ffe 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,8 +19,8 @@ environment: PHP_SDK: c:\projects\php matrix: - BUILD_PLATFORM: x64 - 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.0 PHP_MINOR_VER: latest @@ -38,8 +38,8 @@ environment: PHP_INSTALL_DIR: c:\projects\php\x86\bin platform: x86 - BUILD_PLATFORM: x64 - TEST_PHP_SQL_SERVER: (local)\SQL2016 - SQL_INSTANCE: SQL2016 + TEST_PHP_SQL_SERVER: (local)\SQL2012SP1 + SQL_INSTANCE: SQL2012SP1 PHP_VC: 14 PHP_MAJOR_VER: 7.1 PHP_MINOR_VER: latest @@ -175,10 +175,6 @@ test_script: #- copy %APPVEYOR_BUILD_FOLDER%\test\functional\setup\*.dll %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\ #- python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\run_ksp.py -server %TEST_PHP_SQL_SERVER% -dbname %SQLSRV_DBNAME% -uid %TEST_PHP_SQL_UID% -pwd %TEST_PHP_SQL_PWD% #- python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\run_ksp.py -server %TEST_PHP_SQL_SERVER% -dbname %PDOSQLSRV_DBNAME% -uid %TEST_PHP_SQL_UID% -pwd %TEST_PHP_SQL_PWD% - # - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 - # - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log - # - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 - # - type %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log - ps: >- If ($env:SQL_INSTANCE -Match "SQL2016") { "Running phpt tests via OpenCppCoverage..." From 66d676e3f4f24bace8d8d68d91a05ba47f6a4d7d Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Fri, 17 Nov 2017 14:45:03 -0800 Subject: [PATCH 10/44] Output coverage tests to a log file for output.py --- appveyor.yml | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index dd3c8ffe..49d50743 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -180,7 +180,8 @@ test_script: "Running phpt tests via OpenCppCoverage..." ls .\ext\*sqlsrv*.dll; $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; - OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules .\ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\; + OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules .\ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log 2>&1; + cat ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log; } Else { "Running phpt tests the regular way..." .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log 2>&1; @@ -200,7 +201,7 @@ 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_INSTALL_DIR% - - ps: $covFile = ".\coverage.xml" + - ps: $covFile = "coverage.xml" - ps: $fileExists = Test-Path $covFile - ps: >- If ($fileExists -eq $true) { @@ -213,16 +214,39 @@ test_script: after_test: - cd %APPVEYOR_BUILD_FOLDER%\test\functional\ - python output.py - - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult1.xml)) - - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult2.xml)) + # there is only one xml file if running tests with coverage analysis - ps: >- - [xml]$results = Get-Content nativeresult1.xml ; - [xml]$results2 = Get-Content nativeresult2.xml ; - $failure = $results.SelectSingleNode("//failure"); - $failure2 = $results2.SelectSingleNode("//failure"); - if ($failure -ne $null -Or $failure2 -ne $null) - { - $host.SetShouldExit(1); - Write-Host "Forcing build failure due to phpt unit test failure(s)"; + If ($env:SQL_INSTANCE -Match "SQL2016") { + (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult1.xml)); + [xml]$results = Get-Content nativeresult1.xml ; + $failure = $results.SelectSingleNode("//failure"); + if ($failure -ne $null) { + $host.SetShouldExit(1); + Write-Host "Forcing build failure due to phpt unit test failure(s)"; + } + } Else { + (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult1.xml)); + (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult2.xml)); + [xml]$results = Get-Content nativeresult1.xml ; + [xml]$results2 = Get-Content nativeresult2.xml ; + $failure = $results.SelectSingleNode("//failure"); + $failure2 = $results2.SelectSingleNode("//failure"); + if ($failure -ne $null -Or $failure2 -ne $null) { + $host.SetShouldExit(1); + Write-Host "Forcing build failure due to phpt unit test failure(s)"; + } } + # - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult1.xml)) + # - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult2.xml)) + # - ps: >- + # [xml]$results = Get-Content nativeresult1.xml ; + # [xml]$results2 = Get-Content nativeresult2.xml ; + # $failure = $results.SelectSingleNode("//failure"); + # $failure2 = $results2.SelectSingleNode("//failure"); + # if ($failure -ne $null -Or $failure2 -ne $null) + # { + # $host.SetShouldExit(1); + # Write-Host "Forcing build failure due to phpt unit test failure(s)"; + # } + From 6473c951de52dec3eccc1334ebe944670580df43 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Fri, 17 Nov 2017 16:52:40 -0800 Subject: [PATCH 11/44] Debugging the output xml file(s) --- appveyor.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 49d50743..d2369c98 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -178,7 +178,6 @@ test_script: - ps: >- If ($env:SQL_INSTANCE -Match "SQL2016") { "Running phpt tests via OpenCppCoverage..." - ls .\ext\*sqlsrv*.dll; $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules .\ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log 2>&1; cat ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log; @@ -201,7 +200,7 @@ 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_INSTALL_DIR% - - ps: $covFile = "coverage.xml" + - ps: $covFile = ${env:PHP_INSTALL_DIR} + "\coverage.xml" - ps: $fileExists = Test-Path $covFile - ps: >- If ($fileExists -eq $true) { @@ -217,6 +216,7 @@ after_test: # there is only one xml file if running tests with coverage analysis - ps: >- If ($env:SQL_INSTANCE -Match "SQL2016") { + cat .\nativeresult1.xml (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult1.xml)); [xml]$results = Get-Content nativeresult1.xml ; $failure = $results.SelectSingleNode("//failure"); @@ -225,6 +225,7 @@ after_test: Write-Host "Forcing build failure due to phpt unit test failure(s)"; } } Else { + cat .\nativeresult1.xml (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult1.xml)); (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult2.xml)); [xml]$results = Get-Content nativeresult1.xml ; From 4a838a1803699b78edf1f89a29d3f288399aacda Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Fri, 17 Nov 2017 20:22:39 -0800 Subject: [PATCH 12/44] Reorganized the steps before and after tests --- appveyor.yml | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d2369c98..f0f857c1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -180,15 +180,29 @@ test_script: "Running phpt tests via OpenCppCoverage..." $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules .\ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log 2>&1; - cat ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log; + type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log; } Else { "Running phpt tests the regular way..." .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log 2>&1; - cat ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log; + type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log; .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log 2>&1; - cat ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log; + 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) { + "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\ + - python output.py - ps: $difffiles = Get-ChildItem sqlsrv\*.diff - ps: $outfiles = Get-ChildItem sqlsrv\*.out - ps: foreach($file in $difffiles){ls $file; more $file} @@ -197,22 +211,7 @@ test_script: - ps: $outfiles = Get-ChildItem pdo_sqlsrv\*.out - ps: foreach($file in $difffiles){ls $file; more $file} - ps: foreach($file in $outfiles){ls $file; more $file} - - 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: $covFile = ${env:PHP_INSTALL_DIR} + "\coverage.xml" - - ps: $fileExists = Test-Path $covFile - - ps: >- - If ($fileExists -eq $true) { - "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 $covFile - } - -after_test: - - cd %APPVEYOR_BUILD_FOLDER%\test\functional\ - - python output.py + #- cd %APPVEYOR_BUILD_FOLDER%\test\functional\ # there is only one xml file if running tests with coverage analysis - ps: >- If ($env:SQL_INSTANCE -Match "SQL2016") { From 9ac4c4af9692e53756b7473b7103f56893cff0df Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Fri, 17 Nov 2017 21:04:59 -0800 Subject: [PATCH 13/44] Check coverage.xml --- appveyor.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f0f857c1..9e8c6556 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -181,11 +181,12 @@ test_script: $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules .\ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log 2>&1; type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log; + ls } Else { "Running phpt tests the regular way..." - .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log 2>&1; + php run-tests.php -p php.exe ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log 2>&1; type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log; - .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log 2>&1; + php run-tests.php -p php.exe ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log 2>&1; type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log; } - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %SQLSRV_DBNAME% From 5bb40d7dffe031c88bc6ae67d39169fc75a0b875 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Sat, 18 Nov 2017 10:43:34 -0800 Subject: [PATCH 14/44] Modified how to report test results --- appveyor.yml | 55 ++++++++++++++++++---------------------------------- 1 file changed, 19 insertions(+), 36 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 9e8c6556..32d9fb65 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -179,9 +179,11 @@ test_script: If ($env:SQL_INSTANCE -Match "SQL2016") { "Running phpt tests via OpenCppCoverage..." $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; - OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules .\ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log 2>&1; - type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log; - ls + cd ${env:PHP_INSTALL_DIR}\ext + OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:${env:PHP_INSTALL_DIR}\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- ..\php.exe ..\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log 2>&1; + type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log; + cd .. + ls *.xml } Else { "Running phpt tests the regular way..." php run-tests.php -p php.exe ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log 2>&1; @@ -214,40 +216,21 @@ after_test: - ps: foreach($file in $outfiles){ls $file; more $file} #- cd %APPVEYOR_BUILD_FOLDER%\test\functional\ # there is only one xml file if running tests with coverage analysis - - ps: >- - If ($env:SQL_INSTANCE -Match "SQL2016") { - cat .\nativeresult1.xml - (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult1.xml)); - [xml]$results = Get-Content nativeresult1.xml ; - $failure = $results.SelectSingleNode("//failure"); - if ($failure -ne $null) { - $host.SetShouldExit(1); - Write-Host "Forcing build failure due to phpt unit test failure(s)"; - } - } Else { - cat .\nativeresult1.xml - (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult1.xml)); + - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult1.xml)) + - ps: [xml]$results = Get-Content nativeresult1.xml; + - ps: $result2Exists = Test-Path "nativeresult2.xml" + - ps: $failure = $results.SelectSingleNode("//failure"); + - ps: $failure2 = $null + - ps: >- + If ($result2Exists -eq $true) { (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult2.xml)); - [xml]$results = Get-Content nativeresult1.xml ; - [xml]$results2 = Get-Content nativeresult2.xml ; - $failure = $results.SelectSingleNode("//failure"); + [xml]$results2 = Get-Content nativeresult2.xml; $failure2 = $results2.SelectSingleNode("//failure"); - if ($failure -ne $null -Or $failure2 -ne $null) { - $host.SetShouldExit(1); - Write-Host "Forcing build failure due to phpt unit test failure(s)"; - } + } + - ps: >- + if ($failure -ne $null -Or $failure2 -ne $null) + { + $host.SetShouldExit(1); + Write-Host "Forcing build failure due to phpt unit test failure(s)"; } - # - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult1.xml)) - # - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult2.xml)) - # - ps: >- - # [xml]$results = Get-Content nativeresult1.xml ; - # [xml]$results2 = Get-Content nativeresult2.xml ; - # $failure = $results.SelectSingleNode("//failure"); - # $failure2 = $results2.SelectSingleNode("//failure"); - # if ($failure -ne $null -Or $failure2 -ne $null) - # { - # $host.SetShouldExit(1); - # Write-Host "Forcing build failure due to phpt unit test failure(s)"; - # } - From 1853abed8573bddd9a2ebf9ef5d2fb274e98af0b Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Sat, 18 Nov 2017 11:03:23 -0800 Subject: [PATCH 15/44] Fixed the errors yml --- appveyor.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 32d9fb65..22cf81a9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -179,7 +179,7 @@ test_script: If ($env:SQL_INSTANCE -Match "SQL2016") { "Running phpt tests via OpenCppCoverage..." $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; - cd ${env:PHP_INSTALL_DIR}\ext + cd ext OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:${env:PHP_INSTALL_DIR}\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- ..\php.exe ..\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log 2>&1; type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log; cd .. @@ -205,31 +205,27 @@ test_script: 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: $difffiles = Get-ChildItem pdo_sqlsrv\*.diff - - ps: $outfiles = Get-ChildItem pdo_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\ # there is only one xml file if running tests with coverage analysis - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult1.xml)) - - ps: [xml]$results = Get-Content nativeresult1.xml; + - ps: [xml]$results = Get-Content nativeresult1.xml ; - ps: $result2Exists = Test-Path "nativeresult2.xml" - - ps: $failure = $results.SelectSingleNode("//failure"); - - ps: $failure2 = $null - ps: >- If ($result2Exists -eq $true) { (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult2.xml)); - [xml]$results2 = Get-Content nativeresult2.xml; - $failure2 = $results2.SelectSingleNode("//failure"); } - ps: >- - if ($failure -ne $null -Or $failure2 -ne $null) - { + If ($difffiles -ne $null -Or $diff2files -ne $null) { $host.SetShouldExit(1); Write-Host "Forcing build failure due to phpt unit test failure(s)"; } From db9587f844edec4008352016cd8b8b2116bce9cb Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Sat, 18 Nov 2017 11:07:53 -0800 Subject: [PATCH 16/44] No need to get xml contents --- appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 22cf81a9..570b596e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -218,7 +218,6 @@ after_test: #- cd %APPVEYOR_BUILD_FOLDER%\test\functional\ # there is only one xml file if running tests with coverage analysis - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult1.xml)) - - ps: [xml]$results = Get-Content nativeresult1.xml ; - ps: $result2Exists = Test-Path "nativeresult2.xml" - ps: >- If ($result2Exists -eq $true) { From 2b838d88baaa9040b35c3aa68501dc4fee2d9497 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Sat, 18 Nov 2017 11:45:58 -0800 Subject: [PATCH 17/44] Output all contents while analyzing coverage --- appveyor.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 570b596e..8023a6af 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -180,15 +180,14 @@ test_script: "Running phpt tests via OpenCppCoverage..." $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; cd ext - OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:${env:PHP_INSTALL_DIR}\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- ..\php.exe ..\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log 2>&1; - type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log; + OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:${env:PHP_INSTALL_DIR}\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- ..\php.exe ..\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ cd .. ls *.xml } Else { "Running phpt tests the regular way..." - php run-tests.php -p php.exe ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log 2>&1; + php run-tests.php -p php.exe ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log 2>&1 type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log; - php run-tests.php -p php.exe ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log 2>&1; + php run-tests.php -p php.exe ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log 2>&1 type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log; } - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %SQLSRV_DBNAME% From 11151a7ad01fed6a996a71b4f3e42eecb90c60bc Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Sat, 18 Nov 2017 11:52:55 -0800 Subject: [PATCH 18/44] Debugging... --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 8023a6af..95a75ac6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -179,7 +179,7 @@ test_script: If ($env:SQL_INSTANCE -Match "SQL2016") { "Running phpt tests via OpenCppCoverage..." $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; - cd ext + cd ${env:PHP_INSTALL_DIR}\ext OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:${env:PHP_INSTALL_DIR}\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- ..\php.exe ..\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ cd .. ls *.xml From 3ee477d34eb8933406242a29f44fa7f64f8a8b3b Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Sat, 18 Nov 2017 12:39:40 -0800 Subject: [PATCH 19/44] Now save the output in a log file --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 95a75ac6..61daed9c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -180,7 +180,8 @@ test_script: "Running phpt tests via OpenCppCoverage..." $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; cd ${env:PHP_INSTALL_DIR}\ext - OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:${env:PHP_INSTALL_DIR}\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- ..\php.exe ..\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ + OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:${env:PHP_INSTALL_DIR}\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- ..\php.exe ..\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log 2>&1 + type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log; cd .. ls *.xml } Else { From dbae855259dbed48412793edb2e5d54c0bea4011 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Sat, 18 Nov 2017 17:12:16 -0800 Subject: [PATCH 20/44] Reverted the changes --- appveyor.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 61daed9c..a371fdcf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,11 +18,20 @@ environment: 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.0 + PHP_MINOR_VER: latest + PHP_SDK_DIR: c:\projects\php\x64 + PHP_INSTALL_DIR: c:\projects\php\x64\bin + platform: x64 - BUILD_PLATFORM: x64 TEST_PHP_SQL_SERVER: (local)\SQL2016 SQL_INSTANCE: SQL2016 PHP_VC: 14 - PHP_MAJOR_VER: 7.0 + PHP_MAJOR_VER: 7.1 PHP_MINOR_VER: latest PHP_SDK_DIR: c:\projects\php\x64 PHP_INSTALL_DIR: c:\projects\php\x64\bin @@ -37,15 +46,6 @@ environment: PHP_SDK_DIR: c:\projects\php\x86 PHP_INSTALL_DIR: c:\projects\php\x86\bin platform: x86 - - 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)\SQL2008R2SP2 SQL_INSTANCE: SQL2008R2SP2 @@ -179,10 +179,8 @@ test_script: If ($env:SQL_INSTANCE -Match "SQL2016") { "Running phpt tests via OpenCppCoverage..." $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; - cd ${env:PHP_INSTALL_DIR}\ext OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:${env:PHP_INSTALL_DIR}\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- ..\php.exe ..\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log 2>&1 type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log; - cd .. ls *.xml } Else { "Running phpt tests the regular way..." From 4997569fd31658f8693a88fa89f21c4dc6a35703 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Sat, 18 Nov 2017 17:44:56 -0800 Subject: [PATCH 21/44] Reverted another change --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index a371fdcf..11eefe29 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -184,9 +184,9 @@ test_script: ls *.xml } Else { "Running phpt tests the regular way..." - php run-tests.php -p php.exe ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log 2>&1 + php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log 2>&1 type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log; - php run-tests.php -p php.exe ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log 2>&1 + php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log 2>&1 type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log; } - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %SQLSRV_DBNAME% From b2430a957cbdeda8d646f4c66dc73180febf1d54 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Sat, 18 Nov 2017 18:10:37 -0800 Subject: [PATCH 22/44] Forgot to use the right path --- appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 11eefe29..6e9f9be6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -179,14 +179,14 @@ test_script: If ($env:SQL_INSTANCE -Match "SQL2016") { "Running phpt tests via OpenCppCoverage..." $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; - OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:${env:PHP_INSTALL_DIR}\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- ..\php.exe ..\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log 2>&1 + OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:${env:PHP_INSTALL_DIR}\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log 2>&1 type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log; ls *.xml } Else { "Running phpt tests the regular way..." - php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log 2>&1 + .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log 2>&1 type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log; - php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log 2>&1 + .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log 2>&1 type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log; } - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %SQLSRV_DBNAME% From 4fc0c8f80e9b2ab621d90fb4412f256660592c16 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Sat, 18 Nov 2017 22:06:29 -0800 Subject: [PATCH 23/44] Modified connection tests --- test/functional/pdo_sqlsrv/pdo_connect_driver.phpt | 6 ++++-- test/functional/sqlsrv/sqlsrv_connect_driver.phpt | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/functional/pdo_sqlsrv/pdo_connect_driver.phpt b/test/functional/pdo_sqlsrv/pdo_connect_driver.phpt index 6f53e50b..468f9ceb 100644 --- a/test/functional/pdo_sqlsrv/pdo_connect_driver.phpt +++ b/test/functional/pdo_sqlsrv/pdo_connect_driver.phpt @@ -52,6 +52,7 @@ function testValidValues() case 17: $value = "{ODBC Driver 17 for SQL Server}"; break; + case 14: case 13: $value = "{ODBC Driver 13 for SQL Server}"; break; @@ -60,7 +61,7 @@ function testValidValues() $value = "{ODBC Driver 11 for SQL Server}"; break; default: - $value = "invalid value"; + $value = "invalid value $msodbcsqlMaj"; } $connectionOptions = "Driver = $value"; connectVerifyOutput($connectionOptions); @@ -70,6 +71,7 @@ function testValidValues() case 17: $value = "ODBC Driver 17 for SQL Server"; break; + case 14: case 13: $value = "ODBC Driver 13 for SQL Server"; break; @@ -78,7 +80,7 @@ function testValidValues() $value = "ODBC Driver 11 for SQL Server"; break; default: - $value = "invalid value"; + $value = "invalid value $msodbcsqlMaj"; } $connectionOptions = "Driver = $value"; diff --git a/test/functional/sqlsrv/sqlsrv_connect_driver.phpt b/test/functional/sqlsrv/sqlsrv_connect_driver.phpt index 63531498..89377f1a 100644 --- a/test/functional/sqlsrv/sqlsrv_connect_driver.phpt +++ b/test/functional/sqlsrv/sqlsrv_connect_driver.phpt @@ -44,6 +44,7 @@ function testValidValues($msodbcsqlMaj, $server, $connectionOptions) case 17: $value = "{ODBC Driver 17 for SQL Server}"; break; + case 14: case 13: $value = "{ODBC Driver 13 for SQL Server}"; break; @@ -52,7 +53,7 @@ function testValidValues($msodbcsqlMaj, $server, $connectionOptions) $value = "{ODBC Driver 11 for SQL Server}"; break; default: - $value = "invalid value"; + $value = "invalid value $msodbcsqlMaj"; } $connectionOptions['Driver']=$value; connectVerifyOutput($server, $connectionOptions); @@ -62,6 +63,7 @@ function testValidValues($msodbcsqlMaj, $server, $connectionOptions) case 17: $value = "ODBC Driver 17 for SQL Server"; break; + case 14: case 13: $value = "ODBC Driver 13 for SQL Server"; break; @@ -70,7 +72,7 @@ function testValidValues($msodbcsqlMaj, $server, $connectionOptions) $value = "ODBC Driver 11 for SQL Server"; break; default: - $value = "invalid value"; + $value = "invalid value $msodbcsqlMaj"; } $connectionOptions['Driver']=$value; From 8e799949749288b0dadf5cbf3be7e9adcf7efab3 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Sun, 19 Nov 2017 21:32:47 -0800 Subject: [PATCH 24/44] Debugging output.py --- appveyor.yml | 2 +- test/functional/output.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 6e9f9be6..fb17c7d6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -179,7 +179,7 @@ test_script: If ($env:SQL_INSTANCE -Match "SQL2016") { "Running phpt tests via OpenCppCoverage..." $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; - OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:${env:PHP_INSTALL_DIR}\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log 2>&1 + OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log 2>&1 type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log; ls *.xml } Else { diff --git a/test/functional/output.py b/test/functional/output.py index 96caf7f5..f030e7e7 100644 --- a/test/functional/output.py +++ b/test/functional/output.py @@ -38,6 +38,7 @@ def returnCount(var): # path - path of the file. # Output: null def readAndPrint(inputStr, file, path): + print(path) filn = open(path + os.sep + file).readlines() for lines in filn: if inputStr in lines: @@ -50,6 +51,8 @@ def TestFilename(line): terminateChar = os.sep currentPos = 0 firstpos = len(line) * -1 + print(line) + print(firstpos) while True: currentPos = currentPos - 1 # if passed the first pos, stop From ee511175af6df7494ceeaedd47022f74e28440b6 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Mon, 20 Nov 2017 10:54:05 -0800 Subject: [PATCH 25/44] Overhauled output.py to make it read the log file only once --- appveyor.yml | 42 +++++----- test/functional/output.py | 158 ++++++++++++++------------------------ 2 files changed, 74 insertions(+), 126 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index fb17c7d6..8f4f0333 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -27,16 +27,6 @@ environment: PHP_SDK_DIR: c:\projects\php\x64 PHP_INSTALL_DIR: c:\projects\php\x64\bin platform: x64 - - BUILD_PLATFORM: x64 - 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\x64 - PHP_INSTALL_DIR: c:\projects\php\x64\bin - PHP_ZTS: --disable-zts - platform: x64 - BUILD_PLATFORM: x86 TEST_PHP_SQL_SERVER: (local)\SQL2014 SQL_INSTANCE: SQL2014 @@ -56,6 +46,16 @@ environment: PHP_INSTALL_DIR: c:\projects\php\x86\bin PHP_ZTS: --disable-zts platform: x86 + - BUILD_PLATFORM: x64 + 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\x64 + PHP_INSTALL_DIR: c:\projects\php\x64\bin + PHP_ZTS: --disable-zts + platform: x64 # 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) @@ -182,14 +182,13 @@ test_script: OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log 2>&1 type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log; ls *.xml - } Else { - "Running phpt tests the regular way..." - .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log 2>&1 - type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log; - .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\*.phpt > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log 2>&1 - type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log; - } + } + - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 + - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log + - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 + - type %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% - 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" @@ -213,14 +212,9 @@ after_test: - 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\ - # there is only one xml file if running tests with coverage analysis + - cd %APPVEYOR_BUILD_FOLDER%\test\functional\ - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult1.xml)) - - ps: $result2Exists = Test-Path "nativeresult2.xml" - - ps: >- - If ($result2Exists -eq $true) { - (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult2.xml)); - } + - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult2.xml)) - ps: >- If ($difffiles -ne $null -Or $diff2files -ne $null) { $host.SetShouldExit(1); diff --git a/test/functional/output.py b/test/functional/output.py index f030e7e7..94c3e5a8 100644 --- a/test/functional/output.py +++ b/test/functional/output.py @@ -2,139 +2,93 @@ ######################################################################################### # # Description: -# Requirement of python 3.4 to execute this script and required result log file are in the same location +# Requirement of python 3.4 to execute this script and required result log file(s) +# are in the same location # Run with command line without options required. Example: py output.py # This script parse output of PHP Native Test # -# ############################################################################################# import os import stat import re -# This module returns either the number of test or the number of failed test -# depending on the argument you requested. -# Input: var - a single variable containing either "FAIL" or "TOTAL" -# Output: Returns a number of test/s or failed test/s -def returnCount(var): - with open(os.path.dirname(os.path.realpath(__file__)) + os.sep + logfile) as f: - num = 0 - failnum = 0 - for line in f: - if "FAIL" in line or "PASS" in line: - if ".phpt" in line: - if "FAIL" in line: - failnum += 1 - num += 1 - if var == 'total': - return str(num) +# This module appends an entry to the tests list, may include the test title. +# Input: search_pattern - pattern to look for in the line of the log file +# line - current line of the log file +# index - the current index of tests +# tests_list - a list of xml entries +# get_title - boolean flag to get the test title or not +# Output: None +def get_test_entry(search_pattern, line, index, tests_list, get_title = False): + # find the full path to the test name, enclosed by square brackets + result = re.search(search_pattern, line) + pos1 = result.group(1).find('[') + pos2 = result.group(1).find(']') + test_line = str(result.group(1)) + + # get the test name by splitting this full path delimited by os.sep + substr = test_line[pos1+1:pos2] + tmp_array = substr.split(os.sep) + pos = len(tmp_array) - 1 + test_name = tmp_array[pos] + + # only upon a failure do we get the test title + if (get_title is True): + entry = '\t' + tests_list.append(entry) + test_title = test_line[0:pos1] + entry = '\t\t' + tests_list.append(entry) + tests_list.append('\t') else: - return str(failnum) + entry = '\t' + tests_list.append(entry) -# This module prints the line that matches the expression. -# Input: inputStr - String that matches -# file - file name -# path - path of the file. -# Output: null -def readAndPrint(inputStr, file, path): - print(path) - filn = open(path + os.sep + file).readlines() - for lines in filn: - if inputStr in lines: - print(lines) - -# This module returns the test file name. -# Input: line - current line of the log file -# Output: Returns the filename. -def TestFilename(line): - terminateChar = os.sep - currentPos = 0 - firstpos = len(line) * -1 - print(line) - print(firstpos) - while True: - currentPos = currentPos - 1 - # if passed the first pos, stop - if currentPos < firstpos: - break - line[currentPos] - if line[currentPos] == terminateChar: - break - file = line[currentPos+1:-1] - return file - -def genXML(logfile,number): - # Generating the nativeresult.xml file. - file = open('nativeresult' + str(number) + '.xml','w') - file.write('' + os.linesep) - file.write('' + os.linesep) - file.close() - - # Extract individual test results from the log file and - # enter it in the nativeresult.xml file. +# Extract individual test results from the log file and +# enter it in the nativeresult.xml file. +# Input: logfile - the log file +# number - the number for this xml file +def gen_XML(logfile, number): + print('================================================') + print("\n" + os.path.splitext(logfile)[0] + "\n" ) + tests_list = [] with open(os.path.dirname(os.path.realpath(__file__)) + os.sep + logfile) as f: num = 1 failnum = 0 for line in f: - file = open('nativeresult' + str(number) + '.xml','a') if "FAIL" in line or "PASS" in line: if ".phpt" in line: - - file.write('\t' + os.linesep) - stop_pos = result.group(1).find('[') - file.write('\t\t' + os.linesep) - file.write('\t' + os.linesep) + get_test_entry('FAIL(.*).', line, str(num), tests_list, True) else: - result = re.search('PASS(.*).', line) - file.write(TestFilename(str(result.group(1))) + '-' + str(num) + '"/>' + os.linesep) + get_test_entry('PASS(.*).', line, str(num), tests_list) num += 1 - file.close() + elif 'Number of tests :' in line or 'Tests skipped ' in line or 'Tests warned ' in line or'Tests failed ' in line or 'Expected fail ' in line or 'Tests passed ' in line: + print(line) + print('================================================') - file = open('nativeresult' + str(number) + '.xml','a') - file.write('' + os.linesep) - file.close() + # Generating the nativeresult.xml file. + file = open('nativeresult' + str(number) + '.xml', 'w') + file.write('' + os.linesep) + file.write('' + os.linesep) -def run(): - num = 1 - for f in os.listdir(os.path.dirname(os.path.realpath(__file__))): - if f.endswith("log"): - print('================================================') - print(os.path.splitext(f)[0]) - readAndPrint('Number of tests :', f, os.path.dirname(os.path.realpath(__file__))) - readAndPrint('Tests skipped ', f, os.path.dirname(os.path.realpath(__file__))) - readAndPrint('Tests warned ', f, os.path.dirname(os.path.realpath(__file__))) - readAndPrint('Tests failed ', f, os.path.dirname(os.path.realpath(__file__))) - readAndPrint('Expected fail ', f, os.path.dirname(os.path.realpath(__file__))) - readAndPrint('Tests passed ', f, os.path.dirname(os.path.realpath(__file__))) - print('================================================') - logfile = f - genXML(logfile,num) - num = num + 1 + index = 1 + for test in tests_list: + file.write(test + os.linesep) + file.write('' + os.linesep) + file.close() - -# ------------------------------------------------------- Main Function --------------------------------------------------- +# ----------------------- Main Function ----------------------- # Display results on screen from result log file. if __name__ == '__main__': num = 1 for f in os.listdir(os.path.dirname(os.path.realpath(__file__))): if f.endswith("log"): - print('================================================') - print("\n" + os.path.splitext(f)[0] + "\n") - readAndPrint('Number of tests :', f, os.path.dirname(os.path.realpath(__file__))) - readAndPrint('Tests skipped ', f, os.path.dirname(os.path.realpath(__file__))) - readAndPrint('Tests warned ', f, os.path.dirname(os.path.realpath(__file__))) - readAndPrint('Tests failed ', f, os.path.dirname(os.path.realpath(__file__))) - readAndPrint('Expected fail ', f, os.path.dirname(os.path.realpath(__file__))) - readAndPrint('Tests passed ', f, os.path.dirname(os.path.realpath(__file__))) - print('================================================') logfile = f - genXML(logfile,num) + gen_XML(logfile, num) num = num + 1 From 0cb448cd38a2dc3c94215a66e3026d18554ab166 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Mon, 20 Nov 2017 12:12:27 -0800 Subject: [PATCH 26/44] Removed duplicated lines --- appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 8f4f0333..b9e84c6a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -188,7 +188,6 @@ test_script: - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 - type %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% - 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" From 33a45cb8de18fdbc051c63458eb71c2de895e818 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Mon, 20 Nov 2017 12:34:34 -0800 Subject: [PATCH 27/44] Tried a diff approach for coverage --- appveyor.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index b9e84c6a..81bb15e9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -179,13 +179,12 @@ test_script: If ($env:SQL_INSTANCE -Match "SQL2016") { "Running phpt tests via OpenCppCoverage..." $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; - OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log 2>&1 - type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log; + OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ ls *.xml } - - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 + - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log - - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 + - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 - type %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% From 1a7ab4ac7ea910d4e06a6099eeaeb587e0f0ee4b Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Mon, 20 Nov 2017 16:11:53 -0800 Subject: [PATCH 28/44] Simplified the arguments to OpenCppCoverage --- appveyor.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 81bb15e9..754d5ed8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -177,9 +177,8 @@ test_script: #- python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\run_ksp.py -server %TEST_PHP_SQL_SERVER% -dbname %PDOSQLSRV_DBNAME% -uid %TEST_PHP_SQL_UID% -pwd %TEST_PHP_SQL_PWD% - ps: >- If ($env:SQL_INSTANCE -Match "SQL2016") { - "Running phpt tests via OpenCppCoverage..." - $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; - OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --sources $ext_dir\sqlsrv --modules ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ + Write-Host "Running phpt tests via OpenCppCoverage..." + OpenCppCoverage.exe --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ ls *.xml } - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 @@ -192,10 +191,10 @@ test_script: - ps: $fileExists = Test-Path "coverage.xml" - ps: >- If ($fileExists -eq $true) { - "Running coverage analysis..."; + 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" + .\codecov.sh -f "coverage.xml" } after_test: From 7f7aff02ef5e2db258ed416a914aa8991109c0fa Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Mon, 20 Nov 2017 16:13:12 -0800 Subject: [PATCH 29/44] Further simplied the call to OpenCppCoverage --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 754d5ed8..069da4b9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -178,7 +178,7 @@ test_script: - ps: >- If ($env:SQL_INSTANCE -Match "SQL2016") { Write-Host "Running phpt tests via OpenCppCoverage..." - OpenCppCoverage.exe --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --optimized_build -- .\php.exe .\run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ + OpenCppCoverage.exe --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --optimized_build -- php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ ls *.xml } - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 From bb5c2ac85a600f530d3568b80d135a972e6a2cc3 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Tue, 21 Nov 2017 08:39:15 -0800 Subject: [PATCH 30/44] Modified the command line arguments for OpenCppCoverage --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 069da4b9..ea7bbc7f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -178,7 +178,7 @@ test_script: - ps: >- If ($env:SQL_INSTANCE -Match "SQL2016") { Write-Host "Running phpt tests via OpenCppCoverage..." - OpenCppCoverage.exe --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --optimized_build -- php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ + OpenCppCoverage.exe --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml -- php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ ls *.xml } - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 From 7c1d3a524e906b922674de336e5a3706d836b8d5 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Tue, 21 Nov 2017 08:39:54 -0800 Subject: [PATCH 31/44] Reordered the test matrix again --- appveyor.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ea7bbc7f..b149989b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,6 +18,16 @@ environment: PHP_DEPSVER: 7.0 PHP_SDK: c:\projects\php matrix: + - BUILD_PLATFORM: x64 + 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\x64 + PHP_INSTALL_DIR: c:\projects\php\x64\bin + PHP_ZTS: --disable-zts + platform: x64 - BUILD_PLATFORM: x64 TEST_PHP_SQL_SERVER: (local)\SQL2012SP1 SQL_INSTANCE: SQL2012SP1 @@ -46,16 +56,6 @@ environment: PHP_INSTALL_DIR: c:\projects\php\x86\bin PHP_ZTS: --disable-zts platform: x86 - - BUILD_PLATFORM: x64 - 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\x64 - PHP_INSTALL_DIR: c:\projects\php\x64\bin - PHP_ZTS: --disable-zts - platform: x64 # 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) From 5e8cda6b44017b46dd91cda74489258425429f57 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Tue, 21 Nov 2017 10:03:33 -0800 Subject: [PATCH 32/44] Not to run tests twice --- appveyor.yml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index b149989b..00c59b45 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -178,13 +178,20 @@ test_script: - ps: >- If ($env:SQL_INSTANCE -Match "SQL2016") { Write-Host "Running phpt tests via OpenCppCoverage..." - OpenCppCoverage.exe --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml -- php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ + OpenCppCoverage.exe --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml -- 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 - } - - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 - - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log - - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 - - type %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log + } 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; + } + # - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 + # - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log + # - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 + # - type %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% @@ -194,7 +201,7 @@ test_script: Write-Host "Running coverage analysis..."; $env:PATH = ${env:PHP_INSTALL_DIR} + $env:PATH; Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh - .\codecov.sh -f "coverage.xml" + bash codecov.sh -f "coverage.xml" } after_test: @@ -210,8 +217,10 @@ after_test: - 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: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult1.xml)) - - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult2.xml)) + - 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: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult1.xml)) + # - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult2.xml)) - ps: >- If ($difffiles -ne $null -Or $diff2files -ne $null) { $host.SetShouldExit(1); From 7efd6b622972d129257750a3867d9ae1a0db727c Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Tue, 21 Nov 2017 10:49:29 -0800 Subject: [PATCH 33/44] Altered the command line arguments by putting sources back --- appveyor.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 00c59b45..1b21c758 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -178,7 +178,8 @@ test_script: - ps: >- If ($env:SQL_INSTANCE -Match "SQL2016") { Write-Host "Running phpt tests via OpenCppCoverage..." - OpenCppCoverage.exe --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml -- 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; + $ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext"; + OpenCppCoverage.exe --sources=$ext_dir\*sqlsrv* --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --quiet -- 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 { @@ -188,10 +189,6 @@ test_script: .\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; } - # - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 - # - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log - # - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 - # - type %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% @@ -219,8 +216,6 @@ after_test: - 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: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult1.xml)) - # - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult2.xml)) - ps: >- If ($difffiles -ne $null -Or $diff2files -ne $null) { $host.SetShouldExit(1); From f3293bb774532318879c824fa63e41f775ef436b Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Tue, 21 Nov 2017 11:33:48 -0800 Subject: [PATCH 34/44] Added cover_children as an argument --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 1b21c758..503c0686 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -179,7 +179,7 @@ test_script: 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* --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --quiet -- 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=$ext_dir\*sqlsrv* --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --quiet --cover_children -- 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 { From 78b9b84a6b0b7a216423ff9ae8fac635418c063b Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Tue, 21 Nov 2017 12:22:54 -0800 Subject: [PATCH 35/44] Modified the arguments again --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 503c0686..09d31ac7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -179,7 +179,7 @@ test_script: 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* --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --quiet --cover_children -- 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=$ext_dir\*sqlsrv* --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --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 { From c2ed1eacc32a5fe71e8079198cd423c4dc77e5f1 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Tue, 21 Nov 2017 14:15:58 -0800 Subject: [PATCH 36/44] Try using input coverage --- appveyor.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 09d31ac7..f8e74851 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -179,8 +179,10 @@ test_script: 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* --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --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 $ext_dir\sqlsrv --modules php_sqlsrv.dll --export_type=binary:sqlsrv.cov --quiet --cover_children --optimized_build -- 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; + OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --modules php_pdo_sqlsrv.dll --export_type=cobertura:.\coverage.xml --input_coverage=sqlsrv.cov --quiet --cover_children --optimized_build -- 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; ls *.xml } Else { Write-Host "Running phpt tests the regular way..." From 3c4999f3b4a4ba15b9846540b155f6fd0a70cd51 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Tue, 21 Nov 2017 16:37:25 -0800 Subject: [PATCH 37/44] Reverted the changes to output to log files --- appveyor.yml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f8e74851..bf54bd78 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -179,19 +179,12 @@ test_script: 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 --modules php_sqlsrv.dll --export_type=binary:sqlsrv.cov --quiet --cover_children --optimized_build -- 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; - OpenCppCoverage.exe --sources $ext_dir\pdo_sqlsrv --modules php_pdo_sqlsrv.dll --export_type=cobertura:.\coverage.xml --input_coverage=sqlsrv.cov --quiet --cover_children --optimized_build -- 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; - 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; + OpenCppCoverage.exe --sources $ext_dir\sqlsrv --sources $ext_dir\pdo_sqlsrv --modules php_sqlsrv.dll --modules php_pdo_sqlsrv.dll --export_type=cobertura:.\coverage.xml --quiet --cover_children --optimized_build -- php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ } - - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %SQLSRV_DBNAME% + - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 + - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log + - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 + - type %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" @@ -218,7 +211,7 @@ after_test: - 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: >- + - 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 0f83bc588221fcd61daa73e80911627de1aade85 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Tue, 21 Nov 2017 22:05:07 -0800 Subject: [PATCH 38/44] Added continue_after_cpp_exception --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index bf54bd78..ca20bc5a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -179,7 +179,7 @@ test_script: 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 php_sqlsrv.dll --modules php_pdo_sqlsrv.dll --export_type=cobertura:.\coverage.xml --quiet --cover_children --optimized_build -- php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ + OpenCppCoverage.exe --sources $ext_dir\sqlsrv --sources $ext_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\ } - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log From 723ffc91ef348c034318a872c266aa860382ed4a Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Wed, 22 Nov 2017 08:34:00 -0800 Subject: [PATCH 39/44] Not powershell --- appveyor.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ca20bc5a..b4adc15c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -175,12 +175,13 @@ test_script: #- copy %APPVEYOR_BUILD_FOLDER%\test\functional\setup\*.dll %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\ #- python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\run_ksp.py -server %TEST_PHP_SQL_SERVER% -dbname %SQLSRV_DBNAME% -uid %TEST_PHP_SQL_UID% -pwd %TEST_PHP_SQL_PWD% #- python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\run_ksp.py -server %TEST_PHP_SQL_SERVER% -dbname %PDOSQLSRV_DBNAME% -uid %TEST_PHP_SQL_UID% -pwd %TEST_PHP_SQL_PWD% - - 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 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\ - } + #- 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 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\ + # } + - OpenCppCoverage.exe --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P %APPVEYOR_BUILD_FOLDER%\test\functional\ - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 From 5cc2a9b327101a0e8c51ffd684b7883aad83e25a Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Wed, 22 Nov 2017 09:20:42 -0800 Subject: [PATCH 40/44] Keep debugging... back to ps --- appveyor.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index b4adc15c..0c8884e5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -175,13 +175,15 @@ test_script: #- copy %APPVEYOR_BUILD_FOLDER%\test\functional\setup\*.dll %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\ #- python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\run_ksp.py -server %TEST_PHP_SQL_SERVER% -dbname %SQLSRV_DBNAME% -uid %TEST_PHP_SQL_UID% -pwd %TEST_PHP_SQL_PWD% #- python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\run_ksp.py -server %TEST_PHP_SQL_SERVER% -dbname %PDOSQLSRV_DBNAME% -uid %TEST_PHP_SQL_UID% -pwd %TEST_PHP_SQL_PWD% - #- 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 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\ - # } - - OpenCppCoverage.exe --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv --modules *sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P %APPVEYOR_BUILD_FOLDER%\test\functional\ + - ps: >- + If ($env:SQL_INSTANCE -Match "SQL2016") { + Write-Host "Running phpt tests via OpenCppCoverage..." + ls ext\*sqlsrv*.dll + $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\ + ls *.xml + } + # - OpenCppCoverage.exe --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv --modules ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P %APPVEYOR_BUILD_FOLDER%\test\functional\ - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 From 2a51dc8d59d95d81db8c1781f95d276263f1840e Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Wed, 22 Nov 2017 09:49:10 -0800 Subject: [PATCH 41/44] Only run pdo tests for now --- appveyor.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 0c8884e5..2d1858e4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -180,14 +180,14 @@ test_script: Write-Host "Running phpt tests via OpenCppCoverage..." ls ext\*sqlsrv*.dll $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\ + 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\pdo_sqlsrv ls *.xml } # - OpenCppCoverage.exe --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv --modules ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P %APPVEYOR_BUILD_FOLDER%\test\functional\ - - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 - - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log - - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 - - type %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %SQLSRV_DBNAME% + # - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 + # - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log + # - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 + # - type %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" From b43b845d1c5a16532da7d393873ea6e7e8b03ed4 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Wed, 22 Nov 2017 10:11:38 -0800 Subject: [PATCH 42/44] Tried x86 --- appveyor.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 2d1858e4..a71f0c71 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,16 +18,16 @@ environment: PHP_DEPSVER: 7.0 PHP_SDK: c:\projects\php matrix: - - BUILD_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\x64 - PHP_INSTALL_DIR: c:\projects\php\x64\bin + PHP_SDK_DIR: c:\projects\php\x86 + PHP_INSTALL_DIR: c:\projects\php\x86\bin PHP_ZTS: --disable-zts - platform: x64 + platform: x86 - BUILD_PLATFORM: x64 TEST_PHP_SQL_SERVER: (local)\SQL2012SP1 SQL_INSTANCE: SQL2012SP1 @@ -180,7 +180,7 @@ test_script: Write-Host "Running phpt tests via OpenCppCoverage..." ls ext\*sqlsrv*.dll $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\pdo_sqlsrv + 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\ ls *.xml } # - OpenCppCoverage.exe --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv --modules ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P %APPVEYOR_BUILD_FOLDER%\test\functional\ From 3d674d88f736bd0936eaee4775d4e20d7debcf78 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Wed, 22 Nov 2017 10:58:16 -0800 Subject: [PATCH 43/44] Output to log files and changed the test matrix --- appveyor.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index a71f0c71..15aa4cdb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -37,20 +37,20 @@ environment: PHP_SDK_DIR: c:\projects\php\x64 PHP_INSTALL_DIR: c:\projects\php\x64\bin platform: x64 - - BUILD_PLATFORM: x86 + - BUILD_PLATFORM: x64 TEST_PHP_SQL_SERVER: (local)\SQL2014 SQL_INSTANCE: SQL2014 PHP_VC: 14 - PHP_MAJOR_VER: 7.0 + PHP_MAJOR_VER: 7.1 PHP_MINOR_VER: latest - PHP_SDK_DIR: c:\projects\php\x86 - PHP_INSTALL_DIR: c:\projects\php\x86\bin - platform: x86 + 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)\SQL2008R2SP2 SQL_INSTANCE: SQL2008R2SP2 PHP_VC: 14 - PHP_MAJOR_VER: 7.1 + PHP_MAJOR_VER: 7.0 PHP_MINOR_VER: latest PHP_SDK_DIR: c:\projects\php\x86 PHP_INSTALL_DIR: c:\projects\php\x86\bin @@ -178,10 +178,16 @@ test_script: - ps: >- If ($env:SQL_INSTANCE -Match "SQL2016") { Write-Host "Running phpt tests via OpenCppCoverage..." - ls ext\*sqlsrv*.dll $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\ + 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; } # - OpenCppCoverage.exe --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv --modules ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P %APPVEYOR_BUILD_FOLDER%\test\functional\ # - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 From 1e7cfec63f6af4c45977a29e92a25f237257d059 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Wed, 22 Nov 2017 14:14:34 -0800 Subject: [PATCH 44/44] Applied changes as per review comments --- appveyor.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 15aa4cdb..ae8c975d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -179,7 +179,7 @@ test_script: 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; + 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 { @@ -189,11 +189,7 @@ test_script: .\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; } - # - OpenCppCoverage.exe --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\pdo_sqlsrv --sources %PHP_SDK_DIR%\php-%PHP_VERSION%-src\ext\sqlsrv --modules ext\*sqlsrv*.dll --export_type=cobertura:.\coverage.xml --cover_children --quiet --continue_after_cpp_exception --optimized_build -- .\php.exe .\run-tests.php -P %APPVEYOR_BUILD_FOLDER%\test\functional\ - # - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 - # - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log - # - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 - # - type %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 %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"