Updated: Comment 0

Problem/Motivation

In #2096595: Make all PHPUnit tests pass with --strict we enabled strict mode. Sadly the time does not stop if you are on a breakpoint inside your debugger so you end up with just a single second to do all your debugging.
This is a really great initiative to speed up our development :p

Proposed resolution

Remove the strict tag but still try to add as many assertions as possible.

Remaining tasks

User interface changes

API changes

Files: 
CommentFileSizeAuthor
#9 simpletest-runner-phpunit-2105583-9-FAIL.patch1.05 KBtim.plunkett
PASSED: [[SimpleTest]]: [MySQL] 58,413 pass(es).
[ View ]
#9 simpletest-runner-phpunit-2105583-9-PASS.patch459 bytestim.plunkett
PASSED: [[SimpleTest]]: [MySQL] 58,810 pass(es).
[ View ]
#1 phpunit-2105583-1.patch434 bytesdawehner
PASSED: [[SimpleTest]]: [MySQL] 58,397 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new434 bytes
PASSED: [[SimpleTest]]: [MySQL] 58,397 pass(es).
[ View ]

Removed the strict tag as this the only way to allow debugging of that stuff.

It seems that phpunit allows you to add --strict on the command line, but no way to suppress a strict flag in the config. So, either we should do this, or anyone who wants to debug has to copy and edit the config file (or hack it temporarily).

So, either we should do this, or anyone who wants to debug has to copy and edit the config file (or hack it temporarily).

I am sorry but this is the worst idea ever.

Status:Needs review» Reviewed & tested by the community

This is a bummer, but the correct thing to do.

After this is committed, can it be set back to postponed? We can fix this for real once https://github.com/sebastianbergmann/phpunit/issues/914 happens.

Well, Drupal 8 probably can't use phpunit 3.8 as it requires php 5.4

Component:simpletest.module» other

OK, so how about have 'needs to pass --strict' as a coding standard, set the testbots to use --strict, and remove it from phpunit.xml.dist?

#2057905: [policy, no patch] Discuss the standards for phpunit based tests

Status:Reviewed & tested by the community» Postponed

This bug report made me laugh out loud. Thanks for that. :)

Committed and pushed to 8.x. Thanks! Marking postponed, per #4.

I didn't quite follow #7 though? So we can restore this functionality in a different way?

Status:Postponed» Needs review
StatusFileSize
new459 bytes
PASSED: [[SimpleTest]]: [MySQL] 58,810 pass(es).
[ View ]
new1.05 KB
PASSED: [[SimpleTest]]: [MySQL] 58,413 pass(es).
[ View ]

Actually, what about this?
Then testbot will run them as strict.

(The fail patch reverts one of the fixes to make it strict).

Well, it is a problem if tests in the testbot behave different then on local systems.

Yah, it's better to have consistency.

So: Farewell, --strict. It was nice knowing you. But maybe still have a PHPUnit coding standard about always using an assertion, for clarity, and also because you can't make a fail message without it.

Status:Needs review» Postponed

Okay, back to postponed, in case PHPUnit itself is ever fixed.

PHPUnit fixed this https://github.com/sebastianbergmann/phpunit/commit/9101f51

But that isn't in stable yet and will be only in 3.4...