diff --git a/app/workers/builds.php b/app/workers/builds.php index bf780c6464..129d3f0bbf 100644 --- a/app/workers/builds.php +++ b/app/workers/builds.php @@ -181,6 +181,10 @@ class BuildsV1 extends Worker $build->setAttribute('stderr', $response['stderr']); $build->setAttribute('stdout', $response['response']); + /* Also update the deployment buildTime */ + $deployment->setAttribute('buildTime', $response['duration']); + $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); + Console::success("Build id: $buildId created"); /** Set auto deploy */ diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 5e498368ea..7694bf8ac2 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -550,6 +550,7 @@ class FunctionsCustomServerTest extends Scope $this->assertIsArray($function['body']['deployments']); $this->assertCount(2, $function['body']['deployments']); $this->assertEquals($function['body']['deployments'][0]['$id'], $data['deploymentId']); + $this->assertGreaterThanOrEqual(2, $function['body']['deployments'][0]['buildTime']); return $data; } @@ -568,6 +569,7 @@ class FunctionsCustomServerTest extends Scope ], $this->getHeaders())); $this->assertEquals(200, $function['headers']['status-code']); + $this->assertEquals(0, $function['body']['buildTime']); /** * Test for FAILURE