Use unique API key name in migration test + bump migration pin

This commit is contained in:
Prem Palanisamy
2026-05-21 13:35:27 +01:00
parent 4105f2fb38
commit 041bbee5f4
2 changed files with 11 additions and 7 deletions
Generated
+4 -4
View File
@@ -4679,12 +4679,12 @@
"source": {
"type": "git",
"url": "https://github.com/utopia-php/migration.git",
"reference": "16ff6ce143a7aff20bc8c86007264bce4c767ca2"
"reference": "91140887b9ff8efcefe326857115bd37c90db1cf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/migration/zipball/16ff6ce143a7aff20bc8c86007264bce4c767ca2",
"reference": "16ff6ce143a7aff20bc8c86007264bce4c767ca2",
"url": "https://api.github.com/repos/utopia-php/migration/zipball/91140887b9ff8efcefe326857115bd37c90db1cf",
"reference": "91140887b9ff8efcefe326857115bd37c90db1cf",
"shasum": ""
},
"require": {
@@ -4744,7 +4744,7 @@
"source": "https://github.com/utopia-php/migration/tree/add-policies-migration",
"issues": "https://github.com/utopia-php/migration/issues"
},
"time": "2026-05-20T12:08:45+00:00"
"time": "2026-05-21T12:22:42+00:00"
},
{
"name": "utopia-php/mongo",
@@ -2554,10 +2554,14 @@ trait MigrationsBase
'x-appwrite-key' => $this->getDestinationProject()['apiKey'],
];
// Unique name so re-runs and parallel suites can't match a stale key
// left behind by a previous crashed run.
$keyName = 'Test API Key ' . ID::unique();
// Create API key on source project
$response = $this->client->call(Client::METHOD_POST, '/project/keys', $sourceHeaders, [
'keyId' => ID::unique(),
'name' => 'Test API Key',
'name' => $keyName,
'scopes' => ['databases.read', 'databases.write'],
'expire' => null,
]);
@@ -2596,7 +2600,7 @@ trait MigrationsBase
$foundKey = null;
foreach ($response['body']['keys'] as $k) {
if ($k['name'] === 'Test API Key') {
if ($k['name'] === $keyName) {
$foundKey = $k;
break;
@@ -2604,7 +2608,7 @@ trait MigrationsBase
}
$this->assertNotNull($foundKey);
$this->assertEquals('Test API Key', $foundKey['name']);
$this->assertEquals($keyName, $foundKey['name']);
$this->assertEqualsCanonicalizing(['databases.read', 'databases.write'], $foundKey['scopes']);
$this->assertEmpty($foundKey['expire']);
$this->assertNotEquals($apiKey['secret'], $foundKey['secret']);