-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use retry callback block for admin API in API exporter tests. (#8485)
- Loading branch information
Showing
3 changed files
with
97 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -293,17 +293,19 @@ Future<void> _testExportedApiSynchronization( | |
// recently created files as a guard against race conditions. | ||
fakeTime.elapseSync(days: 1); | ||
|
||
final adminApi = createPubApiClient( | ||
authToken: createFakeServiceAccountToken(email: '[email protected]'), | ||
); | ||
await adminApi.adminInvokeAction( | ||
'moderate-package-version', | ||
AdminInvokeActionArguments(arguments: { | ||
'case': 'none', | ||
'package': 'bar', | ||
'version': '2.0.0', | ||
'state': 'true', | ||
}), | ||
await withHttpPubApiClient( | ||
bearerToken: createFakeServiceAccountToken(email: '[email protected]'), | ||
fn: (adminApi) async { | ||
await adminApi.adminInvokeAction( | ||
'moderate-package-version', | ||
AdminInvokeActionArguments(arguments: { | ||
'case': 'none', | ||
'package': 'bar', | ||
'version': '2.0.0', | ||
'state': 'true', | ||
}), | ||
); | ||
}, | ||
); | ||
|
||
// Synchronize again | ||
|
@@ -330,18 +332,19 @@ Future<void> _testExportedApiSynchronization( | |
|
||
_log.info('## Version reinstated'); | ||
{ | ||
final adminApi = createPubApiClient( | ||
authToken: createFakeServiceAccountToken(email: '[email protected]'), | ||
); | ||
await adminApi.adminInvokeAction( | ||
'moderate-package-version', | ||
AdminInvokeActionArguments(arguments: { | ||
'case': 'none', | ||
'package': 'bar', | ||
'version': '2.0.0', | ||
'state': 'false', | ||
}), | ||
); | ||
await withHttpPubApiClient( | ||
bearerToken: createFakeServiceAccountToken(email: '[email protected]'), | ||
fn: (adminApi) async { | ||
await adminApi.adminInvokeAction( | ||
'moderate-package-version', | ||
AdminInvokeActionArguments(arguments: { | ||
'case': 'none', | ||
'package': 'bar', | ||
'version': '2.0.0', | ||
'state': 'false', | ||
}), | ||
); | ||
}); | ||
|
||
// Synchronize again | ||
await synchronize(); | ||
|
@@ -371,17 +374,18 @@ Future<void> _testExportedApiSynchronization( | |
// recently created files as a guard against race conditions. | ||
fakeTime.elapseSync(days: 1); | ||
|
||
final adminApi = createPubApiClient( | ||
authToken: createFakeServiceAccountToken(email: '[email protected]'), | ||
); | ||
await adminApi.adminInvokeAction( | ||
'moderate-package', | ||
AdminInvokeActionArguments(arguments: { | ||
'case': 'none', | ||
'package': 'bar', | ||
'state': 'true', | ||
}), | ||
); | ||
await withHttpPubApiClient( | ||
bearerToken: createFakeServiceAccountToken(email: '[email protected]'), | ||
fn: (adminApi) async { | ||
await adminApi.adminInvokeAction( | ||
'moderate-package', | ||
AdminInvokeActionArguments(arguments: { | ||
'case': 'none', | ||
'package': 'bar', | ||
'state': 'true', | ||
}), | ||
); | ||
}); | ||
|
||
// Synchronize again | ||
await synchronize(); | ||
|
@@ -402,17 +406,18 @@ Future<void> _testExportedApiSynchronization( | |
|
||
_log.info('## Package reinstated'); | ||
{ | ||
final adminApi = createPubApiClient( | ||
authToken: createFakeServiceAccountToken(email: '[email protected]'), | ||
); | ||
await adminApi.adminInvokeAction( | ||
'moderate-package', | ||
AdminInvokeActionArguments(arguments: { | ||
'case': 'none', | ||
'package': 'bar', | ||
'state': 'false', | ||
}), | ||
); | ||
await withHttpPubApiClient( | ||
bearerToken: createFakeServiceAccountToken(email: '[email protected]'), | ||
fn: (adminApi) async { | ||
await adminApi.adminInvokeAction( | ||
'moderate-package', | ||
AdminInvokeActionArguments(arguments: { | ||
'case': 'none', | ||
'package': 'bar', | ||
'state': 'false', | ||
}), | ||
); | ||
}); | ||
|
||
// Synchronize again | ||
await synchronize(); | ||
|