Merge pull request #10085 from appwrite/fix-tests

Fix tests, for `Cloud`
This commit is contained in:
Jake Barnby 2025-07-01 14:28:23 +00:00 committed by GitHub
commit aa03045382
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 32 additions and 6 deletions

View file

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

View file

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