Skip to content

Commit

Permalink
test: Fix e2e AutoReview test (#1070)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
theofidry authored Sep 2, 2024
1 parent d7a74ed commit 5d3fda6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tests/AutoReview/GAE2ETest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use PHPUnit\Framework\Attributes\CoversNothing;
use PHPUnit\Framework\TestCase;
use function array_diff;
use function sort;

/**
* @internal
Expand All @@ -32,6 +33,8 @@ class GAE2ETest extends TestCase
public function test_github_actions_executes_all_the_e2e_tests(): void
{
$expected = array_diff(E2ECollector::getE2ENames(), self::IGNORED_E2E_TESTS);
sort($expected);

$actual = GAE2ECollector::getExecutedE2ETests();

self::assertEqualsCanonicalizing($expected, $actual);
Expand Down
6 changes: 5 additions & 1 deletion tests/AutoReview/MakefileE2ETest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use function array_values;
use function current;
use function Safe\file_get_contents;
use function sort;
use function str_starts_with;

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

return $e2eRule->getPrerequisites();
$finalE2eRules = $e2eRule->getPrerequisites();
sort($finalE2eRules);

return $finalE2eRules;
}

/**
Expand Down

0 comments on commit 5d3fda6

Please sign in to comment.