From 53772df20218247df6084a2b25f365d7af06e3e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sat, 16 Aug 2025 14:14:38 +0200 Subject: [PATCH] Improve ci/cd logging --- tests/e2e/Services/Sites/SitesBase.php | 17 ++++++++++++++++- .../Services/Sites/SitesCustomServerTest.php | 6 ++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/tests/e2e/Services/Sites/SitesBase.php b/tests/e2e/Services/Sites/SitesBase.php index 2054744863..722313fac0 100644 --- a/tests/e2e/Services/Sites/SitesBase.php +++ b/tests/e2e/Services/Sites/SitesBase.php @@ -48,8 +48,23 @@ trait SitesBase 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], ])); + + if ($deployment['body']['status'] === 'failed') { + $this->fail('Deployment failed: ' . json_encode($deployment['body'], JSON_PRETTY_PRINT)); + } + + Console::execute("docker inspect openruntimes-executor --format='{{.State.ExitCode}}'", '', $this->stdout, $this->stderr); + if ($this->stdout !== '0') { + $msg = 'Executor has a problem: ' . $this->stderr . ' (' . $this->stdout . '), current status: '; + + Console::execute("docker compose logs openruntimes-executor", '', $this->stdout, $this->stderr); + $msg .= $this->stdout . ' (' . $this->stderr . ')'; + + $this->fail($msg . json_encode($deployment['body'], JSON_PRETTY_PRINT)); + } + $this->assertEquals('ready', $deployment['body']['status'], 'Deployment status is not ready, deployment: ' . json_encode($deployment['body'], JSON_PRETTY_PRINT)); - }, 150000, 500); + }, 300000, 500); // Not === so multipart/form-data works fine too if (($params['activate'] ?? false) == true) { diff --git a/tests/e2e/Services/Sites/SitesCustomServerTest.php b/tests/e2e/Services/Sites/SitesCustomServerTest.php index 8680ca191c..e38f1c8f19 100644 --- a/tests/e2e/Services/Sites/SitesCustomServerTest.php +++ b/tests/e2e/Services/Sites/SitesCustomServerTest.php @@ -405,8 +405,10 @@ class SitesCustomServerTest extends Scope ]); $this->assertNotEmpty($deploymentId); - $site = $this->getSite($siteId); - $this->assertEquals('ssr', $site['body']['adapter']); + $this->assertEventually(function () use ($siteId, &$site) { + $site = $this->getSite($siteId); + $this->assertEquals('ssr', $site['body']['adapter']); + }); $proxyClient = new Client(); $proxyClient->setEndpoint('http://' . $domain);