Skip to content

Commit 993bb90

Browse files
committed
Remove test slowness output checks from reporter tests
1 parent af7b2d5 commit 993bb90

17 files changed

+189
-232
lines changed

lib/reporters/verbose.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ const whileCorked = require('./while-corked');
2020

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

23+
// Display duration only over a threshold. The environment variable is checked
24+
// to reduce variability within AVA's own test suite. Don't use it.
25+
const durationThreshold = Math.max(100, Number.parseInt(process.env.AVA_VERBOSE_DURATION_THRESHOLD, 10) || 0);
26+
2327
class LineWriter extends stream.Writable {
2428
constructor(dest) {
2529
super();
@@ -322,9 +326,7 @@ class VerboseReporter {
322326
} else if (evt.knownFailing) {
323327
this.lineWriter.writeLine(`${colors.error(figures.tick)} ${colors.error(this.prefixTitle(evt.testFile, evt.title))}`);
324328
} else {
325-
// Display duration only over a threshold
326-
const threshold = 100;
327-
const duration = evt.duration > threshold ? colors.duration(' (' + prettyMs(evt.duration) + ')') : '';
329+
const duration = evt.duration > durationThreshold ? colors.duration(' (' + prettyMs(evt.duration) + ')') : '';
328330

329331
this.lineWriter.writeLine(`${colors.pass(figures.tick)} ${this.prefixTitle(evt.testFile, evt.title)}${duration}`);
330332
}

test-tap/fixture/report/regular/slow.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

test-tap/helper/report.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const createApi = options => {
2121
...options,
2222
env: {
2323
...options.env,
24+
AVA_VERBOSE_DURATION_THRESHOLD: String(60 * 1000),
2425
NODE_NO_WARNINGS: '1'
2526
}
2627
});
@@ -61,7 +62,6 @@ exports.sanitizers = {
6162
experimentalWarning: string => string.replace(/^\(node:\d+\) ExperimentalWarning.+\n/g, ''),
6263
lineEndings: string => replaceString(string, '\r\n', '\n'),
6364
posix: string => replaceString(string, '\\', '/'),
64-
slow: string => string.replace(/(?<slow>slow.+?)\(\d+m?s\)/g, '$<slow> (000ms)'),
6565
version: string => replaceString(string, `v${pkg.version}`, 'v1.0.0-beta.5.1')
6666
};
6767

test-tap/reporters/mini.regular.v10.log

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,148 +12,143 @@
1212
1 passed
1313
1 test failed---tty-stream-chunk-separator
1414
---tty-stream-chunk-separator
15-
* slow › slow
16-
17-
2 passed
18-
1 test failed---tty-stream-chunk-separator
19-
---tty-stream-chunk-separator
2015
* test › passes
2116

22-
3 passed
17+
2 passed
2318
1 test failed
2419
1 skipped
2520
1 todo---tty-stream-chunk-separator
2621
---tty-stream-chunk-separator
2722
* test › fails
2823

29-
3 passed
24+
2 passed
3025
2 tests failed
3126
1 skipped
3227
1 todo---tty-stream-chunk-separator
3328
---tty-stream-chunk-separator
3429
* test › known failure
3530

36-
3 passed
31+
2 passed
3732
1 known failure
3833
2 tests failed
3934
1 skipped
4035
1 todo---tty-stream-chunk-separator
4136
---tty-stream-chunk-separator
4237
* test › no longer failing
4338

44-
3 passed
39+
2 passed
4540
1 known failure
4641
3 tests failed
4742
1 skipped
4843
1 todo---tty-stream-chunk-separator
4944
---tty-stream-chunk-separator
5045
* test › logs
5146

52-
3 passed
47+
2 passed
5348
1 known failure
5449
4 tests failed
5550
1 skipped
5651
1 todo---tty-stream-chunk-separator
5752
---tty-stream-chunk-separator
5853
* test › formatted
5954

60-
3 passed
55+
2 passed
6156
1 known failure
6257
5 tests failed
6358
1 skipped
6459
1 todo---tty-stream-chunk-separator
6560
---tty-stream-chunk-separator
6661
* test › power-assert
6762

68-
3 passed
63+
2 passed
6964
1 known failure
7065
6 tests failed
7166
1 skipped
7267
1 todo---tty-stream-chunk-separator
7368
---tty-stream-chunk-separator
7469
* test › bad throws
7570

76-
3 passed
71+
2 passed
7772
1 known failure
7873
7 tests failed
7974
1 skipped
8075
1 todo---tty-stream-chunk-separator
8176
---tty-stream-chunk-separator
8277
* test › bad notThrows
8378

84-
3 passed
79+
2 passed
8580
1 known failure
8681
8 tests failed
8782
1 skipped
8883
1 todo---tty-stream-chunk-separator
8984
---tty-stream-chunk-separator
9085
* test › implementation throws non-error
9186

92-
3 passed
87+
2 passed
9388
1 known failure
9489
9 tests failed
9590
1 skipped
9691
1 todo---tty-stream-chunk-separator
9792
---tty-stream-chunk-separator
9893
* traces-in-t-throws › throws
9994

100-
3 passed
95+
2 passed
10196
1 known failure
10297
10 tests failed
10398
1 skipped
10499
1 todo---tty-stream-chunk-separator
105100
---tty-stream-chunk-separator
106101
* traces-in-t-throws › notThrows
107102

108-
3 passed
103+
2 passed
109104
1 known failure
110105
11 tests failed
111106
1 skipped
112107
1 todo---tty-stream-chunk-separator
113108
---tty-stream-chunk-separator
114109
* traces-in-t-throws › notThrowsAsync
115110

116-
3 passed
111+
2 passed
117112
1 known failure
118113
12 tests failed
119114
1 skipped
120115
1 todo---tty-stream-chunk-separator
121116
---tty-stream-chunk-separator
122117
* traces-in-t-throws › throwsAsync
123118

124-
3 passed
119+
2 passed
125120
1 known failure
126121
13 tests failed
127122
1 skipped
128123
1 todo---tty-stream-chunk-separator
129124
---tty-stream-chunk-separator
130125
* traces-in-t-throws › throwsAsync different error
131126

132-
3 passed
127+
2 passed
133128
1 known failure
134129
14 tests failed
135130
1 skipped
136131
1 todo---tty-stream-chunk-separator
137132
---tty-stream-chunk-separator
138133
* uncaught-exception › passes
139134

140-
4 passed
135+
3 passed
141136
1 known failure
142137
14 tests failed
143138
1 skipped
144139
1 todo---tty-stream-chunk-separator
145140
---tty-stream-chunk-separator
146141
* unhandled-rejection › passes
147142

148-
5 passed
143+
4 passed
149144
1 known failure
150145
14 tests failed
151146
1 skipped
152147
1 todo---tty-stream-chunk-separator
153148
---tty-stream-chunk-separator
154149
* unhandled-rejection › unhandled non-error rejection
155150

156-
6 passed
151+
5 passed
157152
1 known failure
158153
14 tests failed
159154
1 skipped

test-tap/reporters/mini.regular.v12.log

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,148 +12,143 @@
1212
1 passed
1313
1 test failed---tty-stream-chunk-separator
1414
---tty-stream-chunk-separator
15-
* slow › slow
16-
17-
2 passed
18-
1 test failed---tty-stream-chunk-separator
19-
---tty-stream-chunk-separator
2015
* test › passes
2116

22-
3 passed
17+
2 passed
2318
1 test failed
2419
1 skipped
2520
1 todo---tty-stream-chunk-separator
2621
---tty-stream-chunk-separator
2722
* test › fails
2823

29-
3 passed
24+
2 passed
3025
2 tests failed
3126
1 skipped
3227
1 todo---tty-stream-chunk-separator
3328
---tty-stream-chunk-separator
3429
* test › known failure
3530

36-
3 passed
31+
2 passed
3732
1 known failure
3833
2 tests failed
3934
1 skipped
4035
1 todo---tty-stream-chunk-separator
4136
---tty-stream-chunk-separator
4237
* test › no longer failing
4338

44-
3 passed
39+
2 passed
4540
1 known failure
4641
3 tests failed
4742
1 skipped
4843
1 todo---tty-stream-chunk-separator
4944
---tty-stream-chunk-separator
5045
* test › logs
5146

52-
3 passed
47+
2 passed
5348
1 known failure
5449
4 tests failed
5550
1 skipped
5651
1 todo---tty-stream-chunk-separator
5752
---tty-stream-chunk-separator
5853
* test › formatted
5954

60-
3 passed
55+
2 passed
6156
1 known failure
6257
5 tests failed
6358
1 skipped
6459
1 todo---tty-stream-chunk-separator
6560
---tty-stream-chunk-separator
6661
* test › power-assert
6762

68-
3 passed
63+
2 passed
6964
1 known failure
7065
6 tests failed
7166
1 skipped
7267
1 todo---tty-stream-chunk-separator
7368
---tty-stream-chunk-separator
7469
* test › bad throws
7570

76-
3 passed
71+
2 passed
7772
1 known failure
7873
7 tests failed
7974
1 skipped
8075
1 todo---tty-stream-chunk-separator
8176
---tty-stream-chunk-separator
8277
* test › bad notThrows
8378

84-
3 passed
79+
2 passed
8580
1 known failure
8681
8 tests failed
8782
1 skipped
8883
1 todo---tty-stream-chunk-separator
8984
---tty-stream-chunk-separator
9085
* test › implementation throws non-error
9186

92-
3 passed
87+
2 passed
9388
1 known failure
9489
9 tests failed
9590
1 skipped
9691
1 todo---tty-stream-chunk-separator
9792
---tty-stream-chunk-separator
9893
* traces-in-t-throws › throws
9994

100-
3 passed
95+
2 passed
10196
1 known failure
10297
10 tests failed
10398
1 skipped
10499
1 todo---tty-stream-chunk-separator
105100
---tty-stream-chunk-separator
106101
* traces-in-t-throws › notThrows
107102

108-
3 passed
103+
2 passed
109104
1 known failure
110105
11 tests failed
111106
1 skipped
112107
1 todo---tty-stream-chunk-separator
113108
---tty-stream-chunk-separator
114109
* traces-in-t-throws › notThrowsAsync
115110

116-
3 passed
111+
2 passed
117112
1 known failure
118113
12 tests failed
119114
1 skipped
120115
1 todo---tty-stream-chunk-separator
121116
---tty-stream-chunk-separator
122117
* traces-in-t-throws › throwsAsync
123118

124-
3 passed
119+
2 passed
125120
1 known failure
126121
13 tests failed
127122
1 skipped
128123
1 todo---tty-stream-chunk-separator
129124
---tty-stream-chunk-separator
130125
* traces-in-t-throws › throwsAsync different error
131126

132-
3 passed
127+
2 passed
133128
1 known failure
134129
14 tests failed
135130
1 skipped
136131
1 todo---tty-stream-chunk-separator
137132
---tty-stream-chunk-separator
138133
* uncaught-exception › passes
139134

140-
4 passed
135+
3 passed
141136
1 known failure
142137
14 tests failed
143138
1 skipped
144139
1 todo---tty-stream-chunk-separator
145140
---tty-stream-chunk-separator
146141
* unhandled-rejection › passes
147142

148-
5 passed
143+
4 passed
149144
1 known failure
150145
14 tests failed
151146
1 skipped
152147
1 todo---tty-stream-chunk-separator
153148
---tty-stream-chunk-separator
154149
* unhandled-rejection › unhandled non-error rejection
155150

156-
6 passed
151+
5 passed
157152
1 known failure
158153
14 tests failed
159154
1 skipped

0 commit comments

Comments
 (0)