Skip to content

Commit ea17d1d

Browse files
committed
Store failing page for Crawler test
As the E2E/Crawler is very generic it's hard to pinpoint what page is failing and why. We stored the failing page(s) with GitLab CI but this was lost after the migration.
1 parent c715c97 commit ea17d1d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

webapp/tests/E2E/Controller/ControllerRolesTraversalTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,12 @@ public function visitWithNoContest(string $url, bool $dropdown): void
227227
try {
228228
self::assertSelectorExists('a#navbarDropdownContests:contains("no contest")', "Failed at: " . $url);
229229
} catch (\Exception $e) {
230-
$gitlabArtifacts = getenv('GITLABARTIFACTS');
231-
if ($gitlabArtifacts != '') {
232-
$fileHandler = fopen(sprintf("%s/%s", $gitlabArtifacts, str_replace('/', '_s_', $url)), 'w');
233-
fwrite($fileHandler, $response->getContent());
230+
if (getenv('CI')) { // We're running in GHA.
231+
$ciArtifacts = getenv('ARTIFACTS');
232+
if ($ciArtifacts != '') {
233+
$fileHandler = fopen(sprintf("%s/%s", $ciArtifacts, str_replace('/', '_s_', $url)), 'w');
234+
fwrite($fileHandler, $response->getContent());
235+
}
234236
}
235237
throw $e;
236238
}

0 commit comments

Comments
 (0)