Modified how to report test results
This commit is contained in:
parent
9ac4c4af96
commit
5bb40d7dff
53
appveyor.yml
53
appveyor.yml
|
@ -179,9 +179,11 @@ test_script:
|
||||||
If ($env:SQL_INSTANCE -Match "SQL2016") {
|
If ($env:SQL_INSTANCE -Match "SQL2016") {
|
||||||
"Running phpt tests via OpenCppCoverage..."
|
"Running phpt tests via OpenCppCoverage..."
|
||||||
$ext_dir = ${env:PHP_SDK_DIR} + "\php-" + ${env:PHP_VERSION} + "-src\ext";
|
$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;
|
cd ${env:PHP_INSTALL_DIR}\ext
|
||||||
type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.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\ > ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log 2>&1;
|
||||||
ls
|
type ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrvtests.log;
|
||||||
|
cd ..
|
||||||
|
ls *.xml
|
||||||
} Else {
|
} Else {
|
||||||
"Running phpt tests the regular way..."
|
"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;
|
||||||
|
@ -214,40 +216,21 @@ after_test:
|
||||||
- ps: foreach($file in $outfiles){ls $file; more $file}
|
- ps: foreach($file in $outfiles){ls $file; more $file}
|
||||||
#- cd %APPVEYOR_BUILD_FOLDER%\test\functional\
|
#- cd %APPVEYOR_BUILD_FOLDER%\test\functional\
|
||||||
# there is only one xml file if running tests with coverage analysis
|
# 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: $failure = $results.SelectSingleNode("//failure");
|
||||||
|
- ps: $failure2 = $null
|
||||||
- ps: >-
|
- ps: >-
|
||||||
If ($env:SQL_INSTANCE -Match "SQL2016") {
|
If ($result2Exists -eq $true) {
|
||||||
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));
|
|
||||||
(new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\nativeresult2.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;
|
||||||
[xml]$results2 = Get-Content nativeresult2.xml ;
|
|
||||||
$failure = $results.SelectSingleNode("//failure");
|
|
||||||
$failure2 = $results2.SelectSingleNode("//failure");
|
$failure2 = $results2.SelectSingleNode("//failure");
|
||||||
if ($failure -ne $null -Or $failure2 -ne $null) {
|
}
|
||||||
$host.SetShouldExit(1);
|
- ps: >-
|
||||||
Write-Host "Forcing build failure due to phpt unit test failure(s)";
|
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)";
|
|
||||||
# }
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue