Skip to content

Commit 5d3fda6

Browse files
authored
test: Fix e2e AutoReview test (#1070)
It looks like in some versions of PHPUnit the assert equal canonicalizing is not really taking care of the keys. I can't find the changelog about it though.
1 parent d7a74ed commit 5d3fda6

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

tests/AutoReview/GAE2ETest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use PHPUnit\Framework\Attributes\CoversNothing;
1818
use PHPUnit\Framework\TestCase;
1919
use function array_diff;
20+
use function sort;
2021

2122
/**
2223
* @internal
@@ -32,6 +33,8 @@ class GAE2ETest extends TestCase
3233
public function test_github_actions_executes_all_the_e2e_tests(): void
3334
{
3435
$expected = array_diff(E2ECollector::getE2ENames(), self::IGNORED_E2E_TESTS);
36+
sort($expected);
37+
3538
$actual = GAE2ECollector::getExecutedE2ETests();
3639

3740
self::assertEqualsCanonicalizing($expected, $actual);

tests/AutoReview/MakefileE2ETest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use function array_values;
2424
use function current;
2525
use function Safe\file_get_contents;
26+
use function sort;
2627
use function str_starts_with;
2728

2829
/**
@@ -93,7 +94,10 @@ private static function retrieveE2ERule(): array
9394
$e2eRule = current($e2eRules);
9495
self::assertNotFalse($e2eRule, 'Expected to find the e2e rule in the Makefile.');
9596

96-
return $e2eRule->getPrerequisites();
97+
$finalE2eRules = $e2eRule->getPrerequisites();
98+
sort($finalE2eRules);
99+
100+
return $finalE2eRules;
97101
}
98102

99103
/**

0 commit comments

Comments
 (0)