php-language-server icon indicating copy to clipboard operation
php-language-server copied to clipboard

Unit test from branch master fail

Open DanNYSPD opened this issue 5 years ago • 0 comments
trafficstars

Hi there, I cloned from the master branch and run unit test (all of them) but I'm curious about the fact that the first test execution throw me 2 errors:

PHPUnit 6.5.14 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.3.20 with Xdebug 2.9.6
Configuration: /projects/php-language-server/phpunit.xml.dist

...........R...................................................  63 / 258 ( 24%)
............................................................... 126 / 258 ( 48%)
........I...................................................... 189 / 258 ( 73%)
..................F...F........................................ 252 / 258 ( 97%)
......                                                          258 / 258 (100%)

Time: 5.04 minutes, Memory: 542.59MB

There were 2 failures:

1) LanguageServer\Tests\ValidationTest::testDefinitionsAndReferences with data set #14 ('/projects/php-langua...ts.php')
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
-        'type__tostring' => 'bool[]'
+        'type__tostring' => 'array<\__CLASS__,bool>'

/projects/php-language-server/tests/Validation/ValidationTest.php:66

2) LanguageServer\Tests\ValidationTest::testDefinitionsAndReferences with data set #18 ('/projects/php-langua...an.php')
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
-        'type__tostring' => 'bool[]'
+        'type__tostring' => 'array<string,bool>'

/projects/php-language-server/tests/Validation/ValidationTest.php:66

--

There was 1 risky test:

1) LanguageServer\Tests\LanguageServerTest::testIndexingWithDirectFileAccess
This test did not perform any assertions

--

There was 1 incomplete test:

1) LanguageServer\Tests\Server\TextDocument\ParseErrorsTest::testParseErrorsWithOnlyStartLine
This diagnostic not yet implemented in tolerant-php-parser

/projects/php-language-server/tests/Server/TextDocument/ParseErrorsTest.php:132

FAILURES!
Tests: 258, Assertions: 410, Failures: 2, Incomplete: 1, Risky: 1.

But I didn't change the the code, then I run again the test and then it pass all, so I notice that the firts test change the next files:

  • tests/Validation/cases/arrayValueShouldBeBoolean.php.expected.json
  • tests/Validation/cases/magicConsts.php.expected.json

I track the firts test output to the ValidationTest.php class and I notice that after line 66 it changes the json files.

Basically it changes the toString expected value from 'bool[]' to 'array<string,bool>' and bool[] to array<\CLASS,bool>, I'm not sure if the php version 7.3 that I'm using produce this (or from a previous change in php version like 7.2).

The thing is that I don't know if this can produce error on the CI test can think/consider a PR as wrong, if this is not the case then what is the reason about changing these files.

PHP 7.3.20 with Xdebug 2.9.6

DanNYSPD avatar Aug 16 '20 05:08 DanNYSPD