mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 17:08:45 +00:00
Merge pull request #10085 from appwrite/fix-tests
Fix tests, for `Cloud`
This commit is contained in:
commit
aa03045382
2 changed files with 32 additions and 6 deletions
|
|
@ -1414,9 +1414,20 @@ trait DatabasesBase
|
|||
$this->assertEquals($releaseYearIndex['body']['key'], $movies['body']['indexes'][1]['key']);
|
||||
$this->assertEquals($releaseWithDate1['body']['key'], $movies['body']['indexes'][2]['key']);
|
||||
$this->assertEquals($releaseWithDate2['body']['key'], $movies['body']['indexes'][3]['key']);
|
||||
foreach ($movies['body']['indexes'] as $index) {
|
||||
$this->assertEquals('available', $index['status']);
|
||||
}
|
||||
|
||||
$this->assertEventually(function () use ($databaseId, $data) {
|
||||
$movies = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $data['moviesId'], array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
]));
|
||||
|
||||
foreach ($movies['body']['indexes'] as $index) {
|
||||
$this->assertEquals('available', $index['status']);
|
||||
}
|
||||
|
||||
return true;
|
||||
}, 60000, 500);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1470,9 +1470,24 @@ class DatabasesCustomServerTest extends Scope
|
|||
$this->assertCount(64, $collection['body']['attributes']);
|
||||
$this->assertCount(0, $collection['body']['indexes']);
|
||||
|
||||
foreach ($collection['body']['attributes'] as $attribute) {
|
||||
$this->assertEquals('available', $attribute['status'], 'attribute: ' . $attribute['key']);
|
||||
}
|
||||
$this->assertEventually(function () use ($databaseId, $collectionId) {
|
||||
$collection = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
]));
|
||||
|
||||
foreach ($collection['body']['attributes'] ?? [] as $attribute) {
|
||||
$this->assertEquals(
|
||||
'available',
|
||||
$attribute['status'],
|
||||
'attribute: ' . $attribute['key']
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}, 60000, 500);
|
||||
|
||||
|
||||
// Test indexLimit = 64
|
||||
// MariaDB, MySQL, and MongoDB create 6 indexes per new collection
|
||||
|
|
|
|||
Loading…
Reference in a new issue