Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed AppVeyor build allowed to pass #3451

Closed
Majkl578 opened this issue Feb 6, 2019 · 2 comments · Fixed by #3452
Closed

Failed AppVeyor build allowed to pass #3451

Majkl578 opened this issue Feb 6, 2019 · 2 comments · Fixed by #3452
Assignees
Labels
Milestone

Comments

@Majkl578
Copy link
Contributor

Majkl578 commented Feb 6, 2019

Right now master has a failing test on AppVeyor, yet the build is marked as successful:
https://ci.appveyor.com/project/doctrine/dbal/builds/22107072/job/ga7em29v6vktoxh2

@morozov
Copy link
Member

morozov commented Feb 6, 2019

This is most likely because we combine phpunit and ocular commands as independent ones, as if it was in bash with set +e:

dbal/.appveyor.yml

Lines 142 to 145 in 92920ed

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 {

We should use something like set -e for PowerShell or combine the commands via &&.

Example:

Microsoft Windows [Version 6.2.9200]
(c) 2012 Microsoft Corporation. All rights reserved.

C:\Users\Administrator>type test.ps1
non-existing-command
echo "I'm okay"

C:\Users\Administrator>powershell -ExecutionPolicy Unrestricted test.ps1
non-existing-command : The term 'non-existing-command' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\Administrator\test.ps1:1 char:1
+ non-existing-command
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (non-existing-command:String) []
   , CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I'm okay

C:\Users\Administrator>echo %errorlevel%
0

A potential fix may be:

C:\Users\Administrator>type test.ps1
$ErrorActionPreference = "Stop"

non-existing-command
echo "I'm okay"

C:\Users\Administrator>powershell -ExecutionPolicy Unrestricted test.ps1
non-existing-command : The term 'non-existing-command' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At C:\Users\Administrator\test.ps1:3 char:1
+ non-existing-command
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (non-existing-command:String) []
   , ParentContainsErrorRecordException
    + FullyQualifiedErrorId : CommandNotFoundException

C:\Users\Administrator>echo %errorlevel%
1

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants