Skip to content

Commit

Permalink
Perfromance warnings instead of error.
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kastl <daniel@georepublic.de>
  • Loading branch information
dkastl committed Dec 25, 2023
1 parent d66c92b commit 82ac920
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/generator/__tests__/integration1.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ describe('generate integration test(label, envelope)', () => {

const hrend = process.hrtime(hrstart);
const execSeconds = hrend[0] + hrend[1] / 1000000000;
expect(execSeconds).toBeLessThan(1.5);
if (execSeconds >= 1.5) {
console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold.`);
}

const tmpFile = getPdfTmpPath(`${key}.pdf`);
const assertFile = getPdfAssertPath(`${key}.pdf`);
Expand Down
4 changes: 3 additions & 1 deletion packages/generator/__tests__/integration2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ describe('generate integration test(barcode, business)', () => {

const hrend = process.hrtime(hrstart);
const execSeconds = hrend[0] + hrend[1] / 1000000000;
expect(execSeconds).toBeLessThan(2);
if (execSeconds >= 2) {
console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold.`);
}

const tmpFile = getPdfTmpPath(`${key}.pdf`);
const assertFile = getPdfAssertPath(`${key}.pdf`);
Expand Down
4 changes: 3 additions & 1 deletion packages/generator/__tests__/integration3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ describe('generate integration test(other, shape)', () => {

const hrend = process.hrtime(hrstart);
const execSeconds = hrend[0] + hrend[1] / 1000000000;
expect(execSeconds).toBeLessThan(1.5);
if (execSeconds >= 1.5) {
console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold.`);
}

const tmpFile = getPdfTmpPath(`${key}.pdf`);
const assertFile = getPdfAssertPath(`${key}.pdf`);
Expand Down
4 changes: 3 additions & 1 deletion packages/generator/__tests__/integration4.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ describe('generate integration test(slower)', () => {

const hrend = process.hrtime(hrstart);
const execSeconds = hrend[0] + hrend[1] / 1000000000;
expect(execSeconds).toBeLessThan(2.5);
if (execSeconds >= 2.5) {
console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold.`);
}

const tmpFile = getPdfTmpPath(`${key}.pdf`);
const assertFile = getPdfAssertPath(`${key}.pdf`);
Expand Down

0 comments on commit 82ac920

Please sign in to comment.