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

Reduce test time by lowering the sample count for perf tests #1888

Merged
merged 1 commit into from
Jun 7, 2018
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions news/3 Code Health/1887.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reduce sample count used to capture performance metrics in order to reduce time taken to complete the tests.
2 changes: 1 addition & 1 deletion src/test/performance/load.perf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ suite('Activation Times', () => {
if (process.env.ACTIVATION_TIMES_LOG_FILE_PATH) {
const logFile = process.env.ACTIVATION_TIMES_LOG_FILE_PATH;
const sampleCounter = fs.existsSync(logFile) ? fs.readFileSync(logFile, { encoding: 'utf8' }).toString().split(/\r?\n/g).length : 1;
if (sampleCounter > 10) {
if (sampleCounter > 5) {
return;
}
test(`Capture Extension Activation Times (Version: ${process.env.ACTIVATION_TIMES_EXT_VERSION}, sample: ${sampleCounter})`, async () => {
Expand Down
6 changes: 5 additions & 1 deletion src/test/performanceTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class TestRunner {
await del([path.join(tmpFolder, '**')]);
await this.extractLatestExtension(publishedExtensionPath);

const timesToLoadEachVersion = 3;
const timesToLoadEachVersion = 2;
const devLogFiles: string[] = [];
const releaseLogFiles: string[] = [];
const newAnalysisEngineLogFiles: string[] = [];
Expand All @@ -47,20 +47,24 @@ class TestRunner {
await this.enableNewAnalysisEngine(false);

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

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

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

console.log('Compare Performance Results');
await this.runPerfTest(devLogFiles, releaseLogFiles, newAnalysisEngineLogFiles);
}
private async enableNewAnalysisEngine(enable: boolean) {
Expand Down