1
0
Fork 0
mirror of synced 2024-06-14 00:34:51 +12:00

Add tests and add buildTime to worker

This commit is contained in:
Bradley Schofield 2022-10-19 02:43:40 +01:00
parent 380a45f987
commit fe4028f588
2 changed files with 6 additions and 0 deletions

View file

@ -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 */

View file

@ -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