Skip to content

Commit 1a46c79

Browse files
committed
Add e2e coverage for silent build failures
1 parent 0c312ac commit 1a46c79

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/e2e/ExecutorTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,22 @@ public function testBuild(): void
301301
$this->assertEquals(400, $response['headers']['status-code']);
302302
$this->assertEquals('build_failed', $response['body']['type']);
303303

304+
/** Silent user error in build command */
305+
$params = [
306+
'runtimeId' => 'test-build-fail-silent-' . $runtimeId,
307+
'source' => '/storage/functions/php/code.tar.gz',
308+
'destination' => '/storage/builds/test',
309+
'entrypoint' => 'index.php',
310+
'image' => 'openruntimes/php:v5-8.1',
311+
'command' => 'exit 1',
312+
'remove' => true
313+
];
314+
315+
$response = $this->client->call(Client::METHOD_POST, '/runtimes', [], $params);
316+
$this->assertEquals(400, $response['headers']['status-code']);
317+
$this->assertEquals('build_failed', $response['body']['type']);
318+
$this->assertStringContainsString('Build command exited with code 1.', $response['body']['message']);
319+
304320
/** Invalid cache key */
305321
$params = [
306322
'runtimeId' => 'test-build-fail-cache-key-' . $runtimeId,

0 commit comments

Comments
 (0)