1
0
Fork 0
mirror of synced 2024-09-18 18:40:24 +12:00

Make flaky test consistent

This commit is contained in:
Matej Bačo 2024-08-14 13:32:05 +00:00
parent af9acf9f70
commit a7e68836e9
2 changed files with 13 additions and 5 deletions

View file

@ -6,7 +6,7 @@
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="true"
stopOnFailure="false"
>
<extensions>
<extension class="Appwrite\Tests\TestHook" />

View file

@ -1397,7 +1397,11 @@ class FunctionsCustomServerTest extends Scope
$executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()));
], $this->getHeaders()), [
'queries' => [
Query::equal('trigger', ['http'])->toString(),
],
]);
$this->assertEquals($executions['headers']['status-code'], 200);
$this->assertEquals($executions['body']['total'], 1);
@ -1418,12 +1422,16 @@ class FunctionsCustomServerTest extends Scope
$executions = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/executions', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()));
], $this->getHeaders()), [
'queries' => [
Query::equal('trigger', ['schedule'])->toString(),
],
]);
$this->assertEquals(200, $executions['headers']['status-code']);
$this->assertCount(2, $executions['body']['executions']);
$this->assertGreaterThanOrEqual(1, $executions['body']['executions']);
$this->assertIsArray($executions['body']['executions']);
$this->assertEquals($executions['body']['executions'][1]['trigger'], 'schedule');
$this->assertEquals($executions['body']['executions'][0]['trigger'], 'schedule');
// Cleanup : Delete function
$response = $this->client->call(Client::METHOD_DELETE, '/functions/' . $functionId, [