Skip to content

Commit

Permalink
[Perf Framework] rename runAsync method to run (Azure#18033)
Browse files Browse the repository at this point in the history
  • Loading branch information
timovv committed Oct 20, 2021
1 parent a97c7b8 commit 2e806ad
Show file tree
Hide file tree
Showing 70 changed files with 88 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class ListSettingsTest extends AppConfigTest<ListTestOptions> {
);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
for await (const response of this.client
.listConfigurationSettings({ keyFilter: ListSettingsTest.prefix + "*" })
.byPage()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class ArtifactListTest extends ContainerRegistryTest<ContainerRegistryTes
this.repository = this.client.getRepository(getEnvVar("REPOSITORY_NAME"));
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
const listIterator = this.repository.listManifestProperties();

for await (const manifest of listIterator) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class RepositoryListTest extends ContainerRegistryTest<ContainerRegistryT
super();
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
const listIterator = this.client.listRepositoryNames();

// eslint-disable-next-line no-empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class BearerTokenAuthenticationPolicyChallengeTest extends PerfTest {
};
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
const { pipeline, testHttpsClient, request } = BearerTokenAuthenticationPolicyChallengeTest;
await pipeline!.sendRequest(testHttpsClient!, request!);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class SendCloudEventsTest extends PerfTest<SendCloudEventsPerfTestOptions
this.client = new EventGridPublisherClient(endpoint, "CloudEvent", new AzureKeyCredential(key));
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.client.send(this.events);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class SendTest extends PerfTest<SendTestOptions> {
await this.producer.close();
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.producer.sendBatch(this.eventBatch);
}
}
2 changes: 1 addition & 1 deletion sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class SendTest extends PerfTest<SendTestOptions> {
await this.producer.close();
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.producer.sendBatch(this.eventBatch);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class CustomModelRecognitionTest extends PerfTest<BeginRecognizeCustomFor
}
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
const modelId = CustomModelRecognitionTest.sessionModel?.modelId;
if (!modelId) {
return unreachable("Failed to initialize model.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class ClientSecretCredentialPersistenceTest extends PerfTest {
ClientSecretCredentialPersistenceTest.credential = credential;
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await ClientSecretCredentialPersistenceTest.credential.getToken(scope);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export abstract class CertificateTest extends PerfTest {
export class GetCertificateTest extends CertificateTest {
public options = {};

async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.certificateClient.getCertificate(CertificateTest.certificateName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class DecryptTest extends CryptographyTest {
this.cipherText = encryptResult.result!;
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await CryptographyTest.cryptoClient!.decrypt({
algorithm: this.algorithm,
ciphertext: this.cipherText!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class SignTest extends CryptographyTest {
.digest();
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await CryptographyTest.cryptoClient!.sign("RS256", this.digest!);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class UnwrapKeyTest extends CryptographyTest {
this.encryptedKey = wrapResult.result;
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await CryptographyTest.cryptoClient!.unwrapKey(this.wrapAlgorithm, this.encryptedKey!);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export abstract class KeyTest extends PerfTest<KeyPerfTestOptions> {
}

export class GetKeyTest extends KeyTest {
async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.keyClient.getKey(KeyTest.keyName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class GetSecretTest extends SecretTest {
await this.secretClient.setSecret(GetSecretTest.secretName, "value");
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.secretClient.getSecret(GetSecretTest.secretName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class ListSecretsTest extends SecretTest<ListSecretPerfTestOptions> {
await Promise.all(secretToCreate);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
// eslint-disable-next-line no-empty
for await (const _secret of this.secretClient.listPropertiesOfSecrets()) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class AnomaliesListTest extends MetricsAdvisorTest<MetricsAdvisorTestOpti
this.alertConfigId = getEnvVar("METRICS_ADVISOR_ALERT_CONFIG_ID");
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
const listIterator = this.client.listAnomalies({
alertConfigId: this.alertConfigId,
id: this.alertId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class IncidentsListTest extends MetricsAdvisorTest<MetricsAdvisorTestOpti
this.alertConfigId = getEnvVar("METRICS_ADVISOR_ALERT_CONFIG_ID");
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
const listIterator = this.client.listIncidents({
alertConfigId: this.alertConfigId,
id: this.alertId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class RootCauseTest extends MetricsAdvisorTest<MetricsAdvisorTestOptions>
this.incidentId = getEnvVar("METRICS_ADVISOR_INCIDENT_ID");
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
const result = await this.client.getIncidentRootCauses(this.detectionConfigId, this.incidentId);
// eslint-disable-next-line no-empty
for (const _rootcause of result.rootCauses) {
Expand Down
2 changes: 1 addition & 1 deletion sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class LogQueryTest extends MonitorQueryLog<MonitorQueryTestOptions> {
"AppRequests | summarize avgRequestDuration=avg(DurationMs) by bin(TimeGenerated, 10m), _ResourceId";
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.client.queryWorkspace(this.workspaceId, this.query, {
startTime: new Date("2021-07-25"),
endTime: new Date("2021-07-26")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class LogQueryBatchTest extends MonitorQueryLog<MonitorQueryTestOptions>
];
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.client.queryBatch(this.queryBatch);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class MetricsQueryTest extends MonitorQueryMetrics<MonitorQueryTestOption
this.aggregations = ["Count"];
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.client.queryResource(this.metricsUri, this.metricNames, {
aggregations: this.aggregations
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class AutoCompleteTest extends SearchDocumentsBase<SearchDocumentsTestOpt
await super.populateIndex(this.parsedOptions.documentsCount.value!);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.searchClient.autocomplete("historic", this.suggesterName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class IndexDocumentsTest extends SearchDocumentsBase<SearchDocumentsTestO
this.hotels = generateHotels(this.parsedOptions.documentsCount.value!);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
for (let i = 0; i < this.hotels.length; i++) {
this.hotels[i].hotelId = Math.floor(
Math.random() * (this.hotels.length * 2 - this.hotels.length + 1) + this.hotels.length
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class SearchDocumentsTest extends SearchDocumentsBase<SearchDocumentsTest
await super.populateIndex(this.parsedOptions.documentsCount.value!);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.searchClient.search("");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class SuggestTest extends SearchDocumentsBase<SearchDocumentsTestOptions>
await super.populateIndex(this.parsedOptions.documentsCount.value!);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.searchClient.suggest("historic", this.suggesterName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class BatchSendTest extends ServiceBusTest<SendTestOptions> {
this.batch = new Array(this.parsedOptions.numberOfMessages.value!).fill(sbMessage);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await BatchSendTest.sender.sendBatch(this.batch);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class BatchSendTest extends ServiceBusTest<SendTestOptions> {
this.batch = new Array(this.parsedOptions.numberOfMessages.value!).fill(sbMessage);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await BatchSendTest.sender.sendMessages(this.batch);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class StorageBlobDownloadTest extends StorageBlobTest<StorageBlobDownload
);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
const downloadResponse = await this.blockBlobClient.download(Aborter.none, 0);
await drainStream(downloadResponse.readableStreamBody!);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class StorageBlobListTest extends StorageBlobTest<StorageBlobListTestOpti
);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
// List blobs
let marker = undefined;
do {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class StorageBlobUploadTest extends StorageBlobTest<StorageBlobUploadTest
this.buffer = Buffer.alloc(this.parsedOptions.size.value!);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.blockBlobClient.upload(Aborter.none, this.buffer, this.parsedOptions.size.value!);
}
}
2 changes: 1 addition & 1 deletion sdk/storage/perf-tests/storage-blob/test/core-http.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class CoreHTTPDownloadWithSASTest extends StorageBlobDownloadWithSASTest
);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
const response = await this.client.sendRequest(this.webResource);
await drainStream(response.readableStreamBody!);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class CoreHTTPSDownloadWithSASTest extends StorageBlobDownloadWithSASTest
});
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
const response = await this.client.sendRequest(this.request);
await drainStream(response.readableStreamBody!);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class StorageBlobDownloadWithSASTest extends StorageBlobTest<
);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
const downloadResponse = await this.blobClientFromSAS.download();
await drainStream(downloadResponse.readableStreamBody!);
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/perf-tests/storage-blob/test/download.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class StorageBlobDownloadTest extends StorageBlobTest<StorageBlobDownload
);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
const downloadResponse = await this.blockBlobClient.download();
await drainStream(downloadResponse.readableStreamBody!);
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/perf-tests/storage-blob/test/listBlobs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class StorageBlobListTest extends StorageBlobTest<StorageBlobListTestOpti
);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
for await (const segmentResponse of this.containerClient.listBlobsFlat().byPage()) {
// eslint-disable-next-line no-empty
for (const _ of segmentResponse.segment.blobItems) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class NodeFetchDownloadWithSASTest extends StorageBlobDownloadWithSASTest
this.agent = new https.Agent({ keepAlive: true });
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
const response = await node_fetch(this.sasUrl, { agent: this.agent });
await drainStream(response.body);
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/perf-tests/storage-blob/test/upload.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class StorageBlobUploadTest extends StorageBlobTest<StorageBlobUploadTest
this.buffer = Buffer.alloc(this.parsedOptions.size.value!);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.containerClient.uploadBlockBlob(
this.blobName,
this.buffer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class StorageBlobUploadFileTest extends StorageBlobUploadTest {
await super.globalCleanup();
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.blockBlobClient.uploadFile(fileName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class StorageDFSAppendTest extends StorageDFSTest<StorageDFSAppendTestOpt
await this.fileClient.create();
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.fileClient.append(this.buffer, 0, this.parsedOptions.size.value!);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class StorageDFSReadTest extends StorageDFSTest<StorageDFSReadTestOptions
await this.fileClient.upload(Buffer.alloc(this.parsedOptions.size.value!));
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
const ReadResponse = await this.fileClient.read();
await drainStream(ReadResponse.readableStreamBody!);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class StorageDFSUploadTest extends StorageDFSTest<StorageFileShareUploadT
this.buffer = Buffer.alloc(this.parsedOptions.size.value!);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.fileClient.upload(this.buffer);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class StorageDFSUploadFromFileTest extends StorageDFSUploadTest {
await super.globalCleanup();
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
await this.fileClient.uploadFile(localFileName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class StorageFileShareDownloadTest extends StorageFileShareTest<
await this.fileClient.uploadRange(Aborter.none, this.buffer, 0, this.parsedOptions.size.value!);
}

async runAsync(): Promise<void> {
async run(): Promise<void> {
const downloadResponse = await this.fileClient.download(Aborter.none, 0);
await drainStream(downloadResponse.readableStreamBody!);
}
Expand Down
Loading

0 comments on commit 2e806ad

Please sign in to comment.