Skip to content

Commit

Permalink
Remove test slowness output checks from reporter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
novemberborn committed Apr 25, 2020
1 parent af7b2d5 commit 993bb90
Show file tree
Hide file tree
Showing 17 changed files with 189 additions and 232 deletions.
8 changes: 5 additions & 3 deletions lib/reporters/verbose.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ const whileCorked = require('./while-corked');

const nodeInternals = require('stack-utils').nodeInternals();

// Display duration only over a threshold. The environment variable is checked
// to reduce variability within AVA's own test suite. Don't use it.
const durationThreshold = Math.max(100, Number.parseInt(process.env.AVA_VERBOSE_DURATION_THRESHOLD, 10) || 0);

class LineWriter extends stream.Writable {
constructor(dest) {
super();
Expand Down Expand Up @@ -322,9 +326,7 @@ class VerboseReporter {
} else if (evt.knownFailing) {
this.lineWriter.writeLine(`${colors.error(figures.tick)} ${colors.error(this.prefixTitle(evt.testFile, evt.title))}`);
} else {
// Display duration only over a threshold
const threshold = 100;
const duration = evt.duration > threshold ? colors.duration(' (' + prettyMs(evt.duration) + ')') : '';
const duration = evt.duration > durationThreshold ? colors.duration(' (' + prettyMs(evt.duration) + ')') : '';

this.lineWriter.writeLine(`${colors.pass(figures.tick)} ${this.prefixTitle(evt.testFile, evt.title)}${duration}`);
}
Expand Down
5 changes: 0 additions & 5 deletions test-tap/fixture/report/regular/slow.js

This file was deleted.

2 changes: 1 addition & 1 deletion test-tap/helper/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const createApi = options => {
...options,
env: {
...options.env,
AVA_VERBOSE_DURATION_THRESHOLD: String(60 * 1000),
NODE_NO_WARNINGS: '1'
}
});
Expand Down Expand Up @@ -61,7 +62,6 @@ exports.sanitizers = {
experimentalWarning: string => string.replace(/^\(node:\d+\) ExperimentalWarning.+\n/g, ''),
lineEndings: string => replaceString(string, '\r\n', '\n'),
posix: string => replaceString(string, '\\', '/'),
slow: string => string.replace(/(?<slow>slow.+?)\(\d+m?s\)/g, '$<slow> (000ms)'),
version: string => replaceString(string, `v${pkg.version}`, 'v1.0.0-beta.5.1')
};

Expand Down
41 changes: 18 additions & 23 deletions test-tap/reporters/mini.regular.v10.log
Original file line number Diff line number Diff line change
Expand Up @@ -12,148 +12,143 @@
1 passed
1 test failed---tty-stream-chunk-separator
---tty-stream-chunk-separator
* slow › slow

2 passed
1 test failed---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › passes

3 passed
2 passed
1 test failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › fails

3 passed
2 passed
2 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › known failure

3 passed
2 passed
1 known failure
2 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › no longer failing

3 passed
2 passed
1 known failure
3 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › logs

3 passed
2 passed
1 known failure
4 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › formatted

3 passed
2 passed
1 known failure
5 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › power-assert

3 passed
2 passed
1 known failure
6 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › bad throws

3 passed
2 passed
1 known failure
7 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › bad notThrows

3 passed
2 passed
1 known failure
8 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › implementation throws non-error

3 passed
2 passed
1 known failure
9 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* traces-in-t-throws › throws

3 passed
2 passed
1 known failure
10 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* traces-in-t-throws › notThrows

3 passed
2 passed
1 known failure
11 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* traces-in-t-throws › notThrowsAsync

3 passed
2 passed
1 known failure
12 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* traces-in-t-throws › throwsAsync

3 passed
2 passed
1 known failure
13 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* traces-in-t-throws › throwsAsync different error

3 passed
2 passed
1 known failure
14 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* uncaught-exception › passes

4 passed
3 passed
1 known failure
14 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* unhandled-rejection › passes

5 passed
4 passed
1 known failure
14 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* unhandled-rejection › unhandled non-error rejection

6 passed
5 passed
1 known failure
14 tests failed
1 skipped
Expand Down
41 changes: 18 additions & 23 deletions test-tap/reporters/mini.regular.v12.log
Original file line number Diff line number Diff line change
Expand Up @@ -12,148 +12,143 @@
1 passed
1 test failed---tty-stream-chunk-separator
---tty-stream-chunk-separator
* slow › slow

2 passed
1 test failed---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › passes

3 passed
2 passed
1 test failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › fails

3 passed
2 passed
2 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › known failure

3 passed
2 passed
1 known failure
2 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › no longer failing

3 passed
2 passed
1 known failure
3 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › logs

3 passed
2 passed
1 known failure
4 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › formatted

3 passed
2 passed
1 known failure
5 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › power-assert

3 passed
2 passed
1 known failure
6 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › bad throws

3 passed
2 passed
1 known failure
7 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › bad notThrows

3 passed
2 passed
1 known failure
8 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* test › implementation throws non-error

3 passed
2 passed
1 known failure
9 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* traces-in-t-throws › throws

3 passed
2 passed
1 known failure
10 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* traces-in-t-throws › notThrows

3 passed
2 passed
1 known failure
11 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* traces-in-t-throws › notThrowsAsync

3 passed
2 passed
1 known failure
12 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* traces-in-t-throws › throwsAsync

3 passed
2 passed
1 known failure
13 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* traces-in-t-throws › throwsAsync different error

3 passed
2 passed
1 known failure
14 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* uncaught-exception › passes

4 passed
3 passed
1 known failure
14 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* unhandled-rejection › passes

5 passed
4 passed
1 known failure
14 tests failed
1 skipped
1 todo---tty-stream-chunk-separator
---tty-stream-chunk-separator
* unhandled-rejection › unhandled non-error rejection

6 passed
5 passed
1 known failure
14 tests failed
1 skipped
Expand Down
Loading

0 comments on commit 993bb90

Please sign in to comment.