Skip to content

Commit 870dbfe

Browse files
authored
Reduce test time by lowering the sample count for perf tests (#1888)
1 parent d4f7799 commit 870dbfe

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

news/3 Code Health/1887.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Reduce sample count used to capture performance metrics in order to reduce time taken to complete the tests.

src/test/performance/load.perf.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ suite('Activation Times', () => {
1818
if (process.env.ACTIVATION_TIMES_LOG_FILE_PATH) {
1919
const logFile = process.env.ACTIVATION_TIMES_LOG_FILE_PATH;
2020
const sampleCounter = fs.existsSync(logFile) ? fs.readFileSync(logFile, { encoding: 'utf8' }).toString().split(/\r?\n/g).length : 1;
21-
if (sampleCounter > 10) {
21+
if (sampleCounter > 5) {
2222
return;
2323
}
2424
test(`Capture Extension Activation Times (Version: ${process.env.ACTIVATION_TIMES_EXT_VERSION}, sample: ${sampleCounter})`, async () => {

src/test/performanceTest.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class TestRunner {
3838
await del([path.join(tmpFolder, '**')]);
3939
await this.extractLatestExtension(publishedExtensionPath);
4040

41-
const timesToLoadEachVersion = 3;
41+
const timesToLoadEachVersion = 2;
4242
const devLogFiles: string[] = [];
4343
const releaseLogFiles: string[] = [];
4444
const newAnalysisEngineLogFiles: string[] = [];
@@ -47,20 +47,24 @@ class TestRunner {
4747
await this.enableNewAnalysisEngine(false);
4848

4949
const devLogFile = path.join(logFilesPath, `dev_loadtimes${i}.txt`);
50+
console.log(`Start Performance Tests: Counter ${i}, for Dev version with Jedi`);
5051
await this.capturePerfTimes(Version.Dev, devLogFile);
5152
devLogFiles.push(devLogFile);
5253

5354
const releaseLogFile = path.join(logFilesPath, `release_loadtimes${i}.txt`);
55+
console.log(`Start Performance Tests: Counter ${i}, for Release version with Jedi`);
5456
await this.capturePerfTimes(Version.Release, releaseLogFile);
5557
releaseLogFiles.push(releaseLogFile);
5658

5759
// New Analysis engine.
5860
await this.enableNewAnalysisEngine(true);
5961
const newAnalysisEngineLogFile = path.join(logFilesPath, `newAnalysisEngine_loadtimes${i}.txt`);
62+
console.log(`Start Performance Tests: Counter ${i}, for Release version with Analysis Engine`);
6063
await this.capturePerfTimes(Version.Release, newAnalysisEngineLogFile);
6164
newAnalysisEngineLogFiles.push(newAnalysisEngineLogFile);
6265
}
6366

67+
console.log('Compare Performance Results');
6468
await this.runPerfTest(devLogFiles, releaseLogFiles, newAnalysisEngineLogFiles);
6569
}
6670
private async enableNewAnalysisEngine(enable: boolean) {

0 commit comments

Comments
 (0)