Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linter errors in app config perf tests #16048

Merged
1 commit merged into from
Jun 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,18 @@ export class ListSettingsTest extends AppConfigTest<ListTestOptions> {
}
};

public async globalSetup() {
public async globalSetup(): Promise<void> {
if (!this.parsedOptions.count.value) {
return;
}
await executeParallel(
async (_count: number, _index: number) => {
async () => {
await this.client.addConfigurationSetting({
key: ListSettingsTest.prefix + generateUuid(),
value: "random"
});
},
this.parsedOptions.count.value!,
this.parsedOptions.count.value,
32
);
}
Expand All @@ -40,12 +43,13 @@ export class ListSettingsTest extends AppConfigTest<ListTestOptions> {
for await (const response of this.client
.listConfigurationSettings({ keyFilter: ListSettingsTest.prefix + "*" })
.byPage()) {
// eslint-disable-next-line no-empty
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

choosing to do this because this is what Harsha has in all the other perf tests

Copy link
Member

@deyaaeldeen deyaaeldeen Jun 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not like this tbh but this is a comment to @HarshaNalluru. I always advocate for perf tests to have meaningful logic. cc @mikeharder

Copy link
Member

@HarshaNalluru HarshaNalluru Jun 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what we have in other languages as well.
The intention is that we don't do any additional work and to keep the test as minimal as possible which is ideal for perf testing.

for (const _ of response.items) {
}
}
}

public async globalCleanup() {
public async globalCleanup(): Promise<void> {
const keys: string[] = [];
for await (const response of this.client
.listConfigurationSettings({ keyFilter: ListSettingsTest.prefix + "*" })
Expand All @@ -54,11 +58,14 @@ export class ListSettingsTest extends AppConfigTest<ListTestOptions> {
keys.push(setting.key);
}
}
if (!this.parsedOptions.count.value) {
return;
}
await executeParallel(
async (count: number, _: number) => {
async (count: number) => {
await this.client.deleteConfigurationSetting({ key: keys[count] });
},
this.parsedOptions.count.value!,
this.parsedOptions.count.value,
32
);
}
Expand Down