mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Prepare build errors for executor bump
This commit is contained in:
3 files changed
+2
-12
No files matched your search
@@ -763,7 +763,7 @@ class Builds extends Action
|
||||
$span?->set('build.runtime.error_message', $error->getMessage());
|
||||
$span?->set('build.runtime.executor_error_type', $error->getType());
|
||||
|
||||
$err = \in_array($error->getType(), [ExecutorException::BUILD_FAILED, ExecutorException::RUNTIME_FAILED], true)
|
||||
$err = $error->getType() === ExecutorException::BUILD_FAILED
|
||||
? new BuildException($error->getMessage(), previous: $error)
|
||||
: $error;
|
||||
} catch (\Throwable $error) {
|
||||
|
||||
@@ -6,7 +6,6 @@ class Exception extends \Exception
|
||||
{
|
||||
public const string GENERAL_UNKNOWN = 'general_unknown';
|
||||
public const string BUILD_FAILED = 'build_failed';
|
||||
public const string RUNTIME_FAILED = 'runtime_failed';
|
||||
|
||||
public function __construct(
|
||||
string $message = '',
|
||||
|
||||
@@ -2954,16 +2954,7 @@ final class SitesCustomServerTest extends Scope
|
||||
$this->assertEventually(function () use ($siteId, $deploymentId) {
|
||||
$deployment = $this->getDeployment($siteId, $deploymentId);
|
||||
$this->assertEquals('failed', $deployment['body']['status'], 'Deployment status does not match: ' . json_encode($deployment['body'], JSON_PRETTY_PRINT));
|
||||
|
||||
$buildLogs = \preg_replace('/\x1b\[[0-9;]*m/', '', (string) $deployment['body']['buildLogs']) ?? '';
|
||||
$errorLogs = \array_values(\array_filter(\array_map(
|
||||
static fn (string $line): string => \trim(\preg_replace('/^\[\d{2}:\d{2}:\d{2}\]\s+\[open-runtimes\]\s*/', '', $line) ?? ''),
|
||||
\explode("\n", $buildLogs),
|
||||
), static fn (string $line): bool => \str_starts_with($line, 'Error:')));
|
||||
|
||||
$this->assertSame([
|
||||
"Error: No source code found. Ensure your source isn't empty.",
|
||||
], $errorLogs, 'Deployment logs should expose the exact user build error: ' . json_encode($deployment['body'], JSON_PRETTY_PRINT));
|
||||
$this->assertStringContainsString('Error:', (string) $deployment['body']['buildLogs'], 'Deployment logs do not match: ' . json_encode($deployment['body'], JSON_PRETTY_PRINT));
|
||||
}, 100000, 500);
|
||||
|
||||
$this->cleanupSite($siteId);
|
||||
|
||||
Reference in new issue
Block a user