Problem/Motivation
Running the tests in any issue fork leads to a test error, while the (old) test status on the project page is still green.
Created 9 May 2023 at 16:25 CEST. 679eab97922f51b95e975a1accaf2b99f3c2729c pushed to 3356155-update-twig-twig-minimum merge request. Updated 9 May 2023 at 16:27 CEST.
10 pass, 1 fail - View results on dispatcher
Show: Failing classes All
✓ ✗
10 1 Twig_tweak.Twig_tweak
1 Twig_tweak.Drupal\Tests\twig_tweak\Kernel\EntityViewBuilderTest
✗
Drupal\Tests\twig_tweak\Kernel\EntityViewBuilderTest
fail: [Other] Line 0 of sites/default/files/simpletest/phpunit-7.xml:
PHPUnit Test failed to complete; Error: PHPUnit 9.6.7 by Sebastian Bergmann and contributors.
Testing Drupal\Tests\twig_tweak\Kernel\EntityViewBuilderTest
F 1 / 1 (100%)
Time: 00:00.883, Memory: 4.00 MB
There was 1 failure:
1) Drupal\Tests\twig_tweak\Kernel\EntityViewBuilderTest::testEntityViewBuilder
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'Public node'
+'Public node'
/var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:122
/var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php:79
/var/www/html/modules/contrib/twig_tweak/tests/src/Kernel/EntityViewBuilderTest.php:95
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
FAILURES!
Tests: 1, Assertions: 16, Failures: 1.Locally all tests pass, so it might be an issue with Drupal CI or Issue forks?
Steps to reproduce
Create an issue (like this) with no relevant changes and see the test fail
Proposed resolution
Rerun tests at https://www.drupal.org/node/2643614/qa to check if this also fails
Fix the test (unclear what's wrong)
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork twig_tweak-3359306
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
anybodyComment #4
anybodyQueueing a test to show the issue without changing anything!
Comment #5
anybodyComment #6
anybodyOkay let's hope linebreaks or hidden characters are the reason... the last tests at least shows some differences to start with:
Comment #7
anybodyInteresting, looks like this test fails since 10.1.x
Might this be related to #3153468: Strip HTML tags when using assertEquals() to compare markup perhaps?
Still couldn't find a difference between:
and guess it must be something like a hidden character, escaping or something like that... -.-
Comment #8
anybodyOkay I was now able to reproduce this locally, after upgrading to 10.1.x-dev!
Here are the correct details, invisible online:
Comment #9
anybodyI tried switching to
self::assertXmlStringEqualsXmlString()so it doesn't need all the ugly markup cleanups anymore, but sadly there seems to be a bug in PHPUnit 9,x (9.5 required by Drupal 10.1.x) so it's not usable (yet):Similar here:
https://github.com/RSS-Bridge/rss-bridge/issues/2704
I couldn't find a way around it, so I'll proceed with the (ugly) cleanups for now. But as soon as possible, that should better be switched, I guess.
Comment #10
anybodyThis was the simple reason: #3117230: Remove redundant role="article" from <article> html tags
Comment #11
anybody@Chi: Would be super cool if you could merge this, as the failing tests currently polute the other issues test results.
See #10 for the root cause (core template change).
Only for that reason I'm setting the priority to major.
Comment #12
anybodyComment #13
chi commentedSorry totally missed this issue.
Moving credits to #3363045: Cheat sheet: format_size fliter needs explanation.