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

Exit code changed since 5.7.7 #2446

Closed
greg0ire opened this issue Jan 26, 2017 · 4 comments
Closed

Exit code changed since 5.7.7 #2446

greg0ire opened this issue Jan 26, 2017 · 4 comments
Assignees
Labels
type/backward-compatibility Something will be/is intentionally broken

Comments

@greg0ire
Copy link
Contributor

All the builds in our org projects are failing because we keep using getMock() until we drop phpunit 4, but run them with phpunit 5. Not very clever, I know, but since yesterday, the previously harmless warnings triggered by getMock() make the build fail because it seems the exit code is no longer 0. This looks like a BC-break, are you going to revert it or is it deliberate?

@michaelehrlein
Copy link

Same problem in our build chain, downgraded to 5.7.6 this morning...

@remicollet
Copy link
Contributor

Same thing, seems critical.

@sebastianbergmann
Copy link
Owner

The only change in PHPUnit 5.7.7 that I can think of that would be causing this is #2349 / f4cf4d1.

I believe that exiting with a return code that signals "not successful" is the right thing to do when there are warnings. I will revert PHPUnit 5.7 to not signal "not successful" when there are warnings. But I will leave this change in PHPUnit 6.0.

@sebastianbergmann sebastianbergmann self-assigned this Jan 26, 2017
@sebastianbergmann sebastianbergmann added the type/bug Something is broken label Jan 26, 2017
@sebastianbergmann
Copy link
Owner

I can reproduce this issue:

<?php
class Test extends PHPUnit_Framework_TestCase
{
    public function testOne()
    {
        throw new PHPUnit_Framework_Warning;
    }
}

PHPUnit 5.7.6

$ phpunit Test
PHPUnit 5.7.6 by Sebastian Bergmann and contributors.

W                                                                   1 / 1 (100%)

Time: 39 ms, Memory: 4.00MB

There was 1 warning:

1) Test::testOne

/home/sb/Test.php:6

WARNINGS!
Tests: 1, Assertions: 0, Warnings: 1.
$ echo $?                  
0

PHPUnit 5.7.7

$ phpunit Test
PHPUnit 5.7.7 by Sebastian Bergmann and contributors.

W                                                                   1 / 1 (100%)

Time: 33 ms, Memory: 4.00MB

There was 1 warning:

1) Test::testOne

/home/sb/Test.php:6

WARNINGS!
Tests: 1, Assertions: 0, Warnings: 1.
$ echo $?
1

@sebastianbergmann sebastianbergmann added type/backward-compatibility Something will be/is intentionally broken and removed type/bug Something is broken labels Jan 26, 2017
sebastianbergmann added a commit that referenced this issue Jan 27, 2017
sebastianbergmann pushed a commit that referenced this issue Jan 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/backward-compatibility Something will be/is intentionally broken
Projects
None yet
Development

No branches or pull requests

4 participants