Page MenuHomePhabricator

Shellbox PHPUnit coverage job is failing
Closed, ResolvedPublic

Description

From https://integration.wikimedia.org/ci/job/phpunit-coverage-php72-docker-publish/365/console

113:25:38 PHPUnit 8.5.13 by Sebastian Bergmann and contributors.
213:25:38
313:25:41 EEFF.FF.EEF...................EEEEEEEEEEEEEE................... 63 / 135 ( 46%)
413:25:42 ............................................................... 126 / 135 ( 93%)
513:25:43 ......... 135 / 135 (100%)
613:25:43
713:25:43 Time: 4.95 seconds, Memory: 50.00 MB
813:25:43
913:25:43 There were 18 errors:
1013:25:43
1113:25:43 1) Shellbox\Tests\ClientTest::testSimpleCall
1213:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
1313:25:43
1413:25:43 /src/src/Client.php:183
1513:25:43 /src/src/Client.php:118
1613:25:43 /src/tests/ClientTest.php:13
1713:25:43 /src/tests/ClientServerTestCase.php:65
1813:25:43
1913:25:43 2) Shellbox\Tests\ClientTest::testCallClass
2013:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
2113:25:43
2213:25:43 /src/src/Client.php:183
2313:25:43 /src/src/Client.php:118
2413:25:43 /src/tests/ClientTest.php:24
2513:25:43 /src/tests/ClientTest.php:28
2613:25:43 /src/tests/ClientServerTestCase.php:65
2713:25:43
2813:25:43 3) Shellbox\Tests\ClientTest::testBinary
2913:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
3013:25:43
3113:25:43 /src/src/Client.php:183
3213:25:43 /src/src/Client.php:118
3313:25:43 /src/tests/ClientTest.php:24
3413:25:43 /src/tests/ClientTest.php:115
3513:25:43 /src/tests/ClientServerTestCase.php:65
3613:25:43
3713:25:43 4) Shellbox\Tests\ClientTest::testBoundaryCrossingChunkEnd
3813:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
3913:25:43
4013:25:43 /src/src/Client.php:183
4113:25:43 /src/src/Client.php:118
4213:25:43 /src/tests/ClientTest.php:24
4313:25:43 /src/tests/ClientTest.php:124
4413:25:43 /src/tests/ClientServerTestCase.php:65
4513:25:43
4613:25:43 5) Shellbox\Tests\Command\RemoteBoxedExecutorTest::testExecuteEcho
4713:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
4813:25:43
4913:25:43 /src/src/Client.php:183
5013:25:43 /src/src/Command/RemoteBoxedExecutor.php:80
5113:25:43 /src/src/Command/BoxedCommand.php:183
5213:25:43 /src/tests/Command/BoxedExecutorTestTrait.php:40
5313:25:43 /src/tests/ClientServerTestCase.php:65
5413:25:43
5513:25:43 6) Shellbox\Tests\Command\RemoteBoxedExecutorTest::testCopy
5613:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
5713:25:43
5813:25:43 /src/src/Client.php:183
5913:25:43 /src/src/Command/RemoteBoxedExecutor.php:80
6013:25:43 /src/src/Command/BoxedCommand.php:183
6113:25:43 /src/tests/Command/BoxedExecutorTestTrait.php:52
6213:25:43 /src/tests/ClientServerTestCase.php:65
6313:25:43
6413:25:43 7) Shellbox\Tests\Command\RemoteBoxedExecutorTest::testCopyWithDirs
6513:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
6613:25:43
6713:25:43 /src/src/Client.php:183
6813:25:43 /src/src/Command/RemoteBoxedExecutor.php:80
6913:25:43 /src/src/Command/BoxedCommand.php:183
7013:25:43 /src/tests/Command/BoxedExecutorTestTrait.php:64
7113:25:43 /src/tests/ClientServerTestCase.php:65
7213:25:43
7313:25:43 8) Shellbox\Tests\Command\RemoteBoxedExecutorTest::testGlob
7413:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
7513:25:43
7613:25:43 /src/src/Client.php:183
7713:25:43 /src/src/Command/RemoteBoxedExecutor.php:80
7813:25:43 /src/src/Command/BoxedCommand.php:183
7913:25:43 /src/tests/Command/BoxedExecutorTestTrait.php:77
8013:25:43 /src/tests/ClientServerTestCase.php:65
8113:25:43
8213:25:43 9) Shellbox\Tests\Command\RemoteBoxedExecutorTest::testInputFileFromFile
8313:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
8413:25:43
8513:25:43 /src/src/Client.php:183
8613:25:43 /src/src/Command/RemoteBoxedExecutor.php:80
8713:25:43 /src/src/Command/BoxedCommand.php:183
8813:25:43 /src/tests/Command/BoxedExecutorTestTrait.php:93
8913:25:43 /src/tests/ClientServerTestCase.php:65
9013:25:43
9113:25:43 10) Shellbox\Tests\Command\RemoteBoxedExecutorTest::testOutputFileToFile
9213:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
9313:25:43
9413:25:43 /src/src/Client.php:183
9513:25:43 /src/src/Command/RemoteBoxedExecutor.php:80
9613:25:43 /src/src/Command/BoxedCommand.php:183
9713:25:43 /src/tests/Command/BoxedExecutorTestTrait.php:106
9813:25:43 /src/tests/ClientServerTestCase.php:65
9913:25:43
10013:25:43 11) Shellbox\Tests\Command\RemoteBoxedExecutorTest::testOutputGlobToFile
10113:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
10213:25:43
10313:25:43 /src/src/Client.php:183
10413:25:43 /src/src/Command/RemoteBoxedExecutor.php:80
10513:25:43 /src/src/Command/BoxedCommand.php:183
10613:25:43 /src/tests/Command/BoxedExecutorTestTrait.php:121
10713:25:43 /src/tests/ClientServerTestCase.php:65
10813:25:43
10913:25:43 12) Shellbox\Tests\Command\RemoteBoxedExecutorTest::testMissingOutput
11013:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
11113:25:43
11213:25:43 /src/src/Client.php:183
11313:25:43 /src/src/Command/RemoteBoxedExecutor.php:80
11413:25:43 /src/src/Command/BoxedCommand.php:183
11513:25:43 /src/tests/Command/BoxedExecutorTestTrait.php:133
11613:25:43 /src/tests/ClientServerTestCase.php:65
11713:25:43
11813:25:43 13) Shellbox\Tests\Command\RemoteBoxedExecutorTest::testStdin
11913:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
12013:25:43
12113:25:43 /src/src/Client.php:183
12213:25:43 /src/src/Command/RemoteBoxedExecutor.php:80
12313:25:43 /src/src/Command/BoxedCommand.php:183
12413:25:43 /src/tests/Command/BoxedExecutorTestTrait.php:148
12513:25:43 /src/tests/ClientServerTestCase.php:65
12613:25:43
12713:25:43 14) Shellbox\Tests\Command\RemoteBoxedExecutorTest::testStderr
12813:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
12913:25:43
13013:25:43 /src/src/Client.php:183
13113:25:43 /src/src/Command/RemoteBoxedExecutor.php:80
13213:25:43 /src/src/Command/BoxedCommand.php:183
13313:25:43 /src/tests/Command/BoxedExecutorTestTrait.php:158
13413:25:43 /src/tests/ClientServerTestCase.php:65
13513:25:43
13613:25:43 15) Shellbox\Tests\Command\RemoteBoxedExecutorTest::testEnvironment
13713:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
13813:25:43
13913:25:43 /src/src/Client.php:183
14013:25:43 /src/src/Command/RemoteBoxedExecutor.php:80
14113:25:43 /src/src/Command/BoxedCommand.php:183
14213:25:43 /src/tests/Command/BoxedExecutorTestTrait.php:168
14313:25:43 /src/tests/ClientServerTestCase.php:65
14413:25:43
14513:25:43 16) Shellbox\Tests\Command\RemoteBoxedExecutorTest::testT69870
14613:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
14713:25:43
14813:25:43 /src/src/Client.php:183
14913:25:43 /src/src/Command/RemoteBoxedExecutor.php:80
15013:25:43 /src/src/Command/BoxedCommand.php:183
15113:25:43 /src/tests/Command/BoxedExecutorTestTrait.php:177
15213:25:43 /src/tests/ClientServerTestCase.php:65
15313:25:43
15413:25:43 17) Shellbox\Tests\Command\RemoteBoxedExecutorTest::testLogStderr
15513:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
15613:25:43
15713:25:43 /src/src/Client.php:183
15813:25:43 /src/src/Command/RemoteBoxedExecutor.php:80
15913:25:43 /src/src/Command/BoxedCommand.php:183
16013:25:43 /src/tests/Command/BoxedExecutorTestTrait.php:194
16113:25:43 /src/tests/ClientServerTestCase.php:65
16213:25:43
16313:25:43 18) Shellbox\Tests\Command\RemoteBoxedExecutorTest::testIncludeStderr
16413:25:43 Shellbox\ShellboxError: Shellbox server returned status code 500
16513:25:43
16613:25:43 /src/src/Client.php:183
16713:25:43 /src/src/Command/RemoteBoxedExecutor.php:80
16813:25:43 /src/src/Command/BoxedCommand.php:183
16913:25:43 /src/tests/Command/BoxedExecutorTestTrait.php:214
17013:25:43 /src/tests/ClientServerTestCase.php:65
17113:25:43
17213:25:43 --
17313:25:43
17413:25:43 There were 5 failures:
17513:25:43
17613:25:43 1) Shellbox\Tests\ClientTest::testCallException
17713:25:43 Failed asserting that exception message 'Shellbox server returned status code 500' contains 'eee'.
17813:25:43
17913:25:43 /src/tests/ClientServerTestCase.php:65
18013:25:43
18113:25:43 2) Shellbox\Tests\ClientTest::testCallError
18213:25:43 Failed asserting that exception message 'Shellbox server returned status code 500' matches '/PHP error in .* line \d*: fff/'.
18313:25:43
18413:25:43 /src/tests/ClientServerTestCase.php:65
18513:25:43
18613:25:43 3) Shellbox\Tests\ClientTest::testForceBad200
18713:25:43 Failed asserting that exception message 'Shellbox server returned status code 500' contains 'Shellbox server returned incorrect Content-Type'.
18813:25:43
18913:25:43 /src/tests/ClientServerTestCase.php:65
19013:25:43
19113:25:43 4) Shellbox\Tests\ClientTest::testBadContentDisposition
19213:25:43 Failed asserting that exception message 'Shellbox server returned status code 500' contains 'Unknown content disposition type'.
19313:25:43
19413:25:43 /src/tests/ClientServerTestCase.php:65
19513:25:43
19613:25:43 5) Shellbox\Tests\ClientTest::testHmacFailure
19713:25:43 Failed asserting that exception message 'Shellbox server returned status code 500' matches '/HMAC signature verification failed/'.
19813:25:43
19913:25:43 /src/tests/ClientServerTestCase.php:65
20013:25:43
20113:25:43 ERRORS!
20213:25:43 Tests: 135, Assertions: 156, Errors: 18, Failures: 5.

I looked into this very quickly locally and all the tests passed, so something else is happening.

Event Timeline

Change 651577 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/libs/Shellbox@master] Ensure test server runs with xdebug enabled

https://gerrit.wikimedia.org/r/651577

This was difficult to debug because the logs from the server go into /tmp but then are deleted once the test is over, whether it succeeded or not. So I hacked the TempDirManager to not delete them, and the logs made it obvious to figure out that xdebug not being loaded was the problem. But hacking TempDirManager caused other tests to start failing (I guess reasonably) which sent me down a few rabbit holes that were ultimately caused by my own doing.

It would be nice if we could have something like rMW96657099fc69: Report logs for each individual test failure for the Shellbox server logs, where if the test fails they'll get printed.

Change 651577 merged by jenkins-bot:
[mediawiki/libs/Shellbox@master] Ensure test server runs with xdebug enabled

https://gerrit.wikimedia.org/r/651577