mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Fix tests
This commit is contained in:
+2
-2
@@ -3,8 +3,8 @@
|
||||
"runner.path": "tests/benchmarks",
|
||||
"runner.file_pattern": "*Bench.php",
|
||||
"runner.bootstrap": "app/init.php",
|
||||
"runner.revs": 500,
|
||||
"runner.iterations": 3,
|
||||
"runner.revs": 1000,
|
||||
"runner.iterations": 5,
|
||||
"runner.warmup": 1,
|
||||
"report.generators": {
|
||||
"appwrite": {
|
||||
|
||||
@@ -82,7 +82,6 @@ abstract class Base extends Scope
|
||||
|
||||
public function createDatabase(array $params = [])
|
||||
{
|
||||
// Create database
|
||||
$database = $this->client->call(Client::METHOD_POST, '/databases', [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
@@ -96,8 +95,7 @@ abstract class Base extends Scope
|
||||
|
||||
public function createCollection(array $params = [])
|
||||
{
|
||||
// Create collection
|
||||
$movies = $this->client->call(Client::METHOD_POST, '/databases/' . static::$databaseId . '/collections', [
|
||||
$collection = $this->client->call(Client::METHOD_POST, '/databases/' . static::$databaseId . '/collections', [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
@@ -110,7 +108,7 @@ abstract class Base extends Scope
|
||||
Permission::write(Role::user($this->getUser()['$id'])),
|
||||
],
|
||||
]);
|
||||
static::$collectionId = $movies['body']['$id'];
|
||||
static::$collectionId = $collection['body']['$id'];
|
||||
|
||||
// Create attribute
|
||||
$this->client->call(Client::METHOD_POST, '/databases/' . static::$databaseId . '/collections/' . static::$collectionId . '/attributes/string', [
|
||||
@@ -123,6 +121,7 @@ abstract class Base extends Scope
|
||||
'required' => true,
|
||||
]);
|
||||
|
||||
// Wait for attribute to be ready
|
||||
sleep(2);
|
||||
}
|
||||
|
||||
@@ -130,7 +129,6 @@ abstract class Base extends Scope
|
||||
{
|
||||
$count = $params['documents'] ?? 1;
|
||||
|
||||
// Create documents
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
$response = $this->client->call(Client::METHOD_POST, '/databases/' . static::$databaseId . '/collections/' . static::$collectionId . '/documents', [
|
||||
'content-type' => 'application/json',
|
||||
|
||||
@@ -17,7 +17,7 @@ class AbuseTest extends Scope
|
||||
use ProjectCustom;
|
||||
use SideNone;
|
||||
|
||||
protected function setUp(): void
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class UsageTest extends Scope
|
||||
|
||||
protected string $projectId;
|
||||
|
||||
protected function setUp(): void
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
}
|
||||
@@ -754,7 +754,7 @@ class UsageTest extends Scope
|
||||
$this->validateDates($response['executionsFailure']);
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
public function tearDown(): void
|
||||
{
|
||||
$this->usersCount = 0;
|
||||
$this->requestsCount = 0;
|
||||
|
||||
Reference in New Issue
Block a user