Fixed mistakenly passing builds on AppVeyor

PowerShell doesn't automatically handle exit codes of the invoked commands automatically, and $ErrorActionPreference = "Stop" doesn't seem working. Additionally, the ocular command is moved out of the "test_script" section to "after_test" since it's not part of the actual test.
parent bbd004c1
......@@ -131,17 +131,25 @@ before_test:
}
test_script:
- cd C:\projects\dbal
- ps: >-
if ($env:db_version) {
$env:phpunit_config = "tests\appveyor\$($env:db).$($env:db_version).$($env:driver).appveyor.xml"
} else {
$env:phpunit_config = "tests\appveyor\$($env:db).$($env:driver).appveyor.xml"
}
- ps: >-
if ($env:coverage -eq "yes") {
vendor\bin\phpunit -c $($env:phpunit_config) --coverage-clover clover.xml
appveyor-retry ocular code-coverage:upload --format=php-clover clover.xml
} else {
vendor\bin\phpunit -c $($env:phpunit_config)
}
if ($LastExitCode -ne 0) {
$host.SetShouldExit($LastExitCode)
}
after_test:
- ps: >-
if ($env:coverage -eq "yes") {
appveyor-retry ocular code-coverage:upload --format=php-clover clover.xml
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment