@camperaid/watest 2.6.0 → 2.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/base.js CHANGED
@@ -67,6 +67,30 @@ function contains(
67
67
  msg,
68
68
  { ignore_unexpected, fail_ = fail, success_ = success } = {},
69
69
  ) {
70
+ // string contains array of strings: check each substring.
71
+ if (typeof got == 'string' && expected instanceof Array) {
72
+ let isok = true;
73
+ for (let e of expected) {
74
+ if (typeof e != 'string') {
75
+ fail_(`${msg}, expected string item, got ${typeof e}: ${stringify(e)}`);
76
+ isok = false;
77
+ continue;
78
+ }
79
+ if (!got.includes(e)) {
80
+ fail_(
81
+ `${msg}, got string doesn't contain expected string, got: ${stringify(
82
+ got,
83
+ )}, expected: ${stringify(e)}`,
84
+ );
85
+ isok = false;
86
+ }
87
+ }
88
+ if (isok) {
89
+ success_(`${msg}, got: ${stringify(got)}`);
90
+ }
91
+ return isok;
92
+ }
93
+
70
94
  if (typeof got == 'string' || typeof expected == 'string') {
71
95
  if (typeof got != 'string') {
72
96
  fail_(`${msg}, expected string, got object: []`);
@@ -189,7 +213,7 @@ function is_primitive(
189
213
 
190
214
  // Overlimit got: keep it small to not pollute output.
191
215
  let printable_got =
192
- String(got).length > limit ? `${String(got).substring(0, limit)}…` : got;
216
+ String(got).length > limit ? `${String(got).substring(0, limit)}...` : got;
193
217
  if (typeof got == 'string') {
194
218
  printable_got = `'${printable_got}'`;
195
219
  }
@@ -286,8 +310,22 @@ function is_object_impl(
286
310
  ) {
287
311
  const contextmsg = `${msg}${(fieldpath && ` '${fieldpath}' field`) || ''}`;
288
312
 
289
- // Primitive values
313
+ // When got is null / a primitive but expected is a plain object or array,
314
+ // report a clear type mismatch rather than falling into is_primitive where
315
+ // the value would stringify as [object Object].
316
+ // Functions and RegExps are excluded: is_primitive handles them as
317
+ // predicates / pattern matchers against the primitive got value.
290
318
  if (!(got instanceof Object)) {
319
+ if (
320
+ expected instanceof Object &&
321
+ typeof expected !== 'function' &&
322
+ !(expected instanceof RegExp)
323
+ ) {
324
+ fail_(
325
+ `${contextmsg} value mismatch, got: ${stringify(got)}, expected: ${stringify(expected)}`,
326
+ );
327
+ return false;
328
+ }
291
329
  return is_primitive(got, expected, contextmsg, {
292
330
  enrich_failure_msg: true,
293
331
  fail_,
package/core/series.js CHANGED
@@ -87,7 +87,7 @@ class Series {
87
87
  core,
88
88
  LogPipe,
89
89
  webdriver,
90
- webdrivers = settings.webdrivers,
90
+ webdrivers = settings.webdrivers || [],
91
91
  },
92
92
  ) {
93
93
  this.debunk = debunk;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camperaid/watest",
3
- "version": "2.6.0",
3
+ "version": "2.6.2",
4
4
  "description": "Web Application Testsuite",
5
5
  "type": "module",
6
6
  "engines": {
@@ -17,12 +17,12 @@ export async function test() {
17
17
  `failure`,
18
18
  );
19
19
 
20
- // string: failure: got string, expected array
20
+ // string, empty array: success (contains all of nothing)
21
21
  await is_output(
22
22
  () => contains('cat', [], `String contains`),
23
+ [`Ok: String contains, got: 'cat'`],
23
24
  [],
24
- [`Failed: String contains, got string, expected object: []`],
25
- `failure`,
25
+ `string empty array`,
26
26
  );
27
27
 
28
28
  // string: failure: doesn't contains
@@ -35,6 +35,34 @@ export async function test() {
35
35
  `failure`,
36
36
  );
37
37
 
38
+ // string, string[]: success
39
+ await is_output(
40
+ () =>
41
+ contains(
42
+ 'green cat on a mat',
43
+ ['green', 'cat', 'mat'],
44
+ `String contains all`,
45
+ ),
46
+ [`Ok: String contains all, got: 'green cat on a mat'`],
47
+ [],
48
+ `string array success`,
49
+ );
50
+
51
+ // string, string[]: partial failure
52
+ await is_output(
53
+ () =>
54
+ contains(
55
+ 'green cat on a mat',
56
+ ['green', 'dog', 'mat'],
57
+ `String contains all`,
58
+ ),
59
+ [],
60
+ [
61
+ `Failed: String contains all, got string doesn't contain expected string, got: 'green cat on a mat', expected: 'dog'`,
62
+ ],
63
+ `string array failure`,
64
+ );
65
+
38
66
  // array: success
39
67
  await is_output(
40
68
  () => contains([0, 1], [1], `Array contains`),
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "../../../..": {
18
18
  "name": "@camperaid/watest",
19
- "version": "2.5.1",
19
+ "version": "2.6.2",
20
20
  "dev": true,
21
21
  "license": "MPL",
22
22
  "dependencies": {
@@ -187,7 +187,6 @@
187
187
  "version": "8.12.1",
188
188
  "dev": true,
189
189
  "license": "MIT",
190
- "peer": true,
191
190
  "bin": {
192
191
  "acorn": "bin/acorn"
193
192
  },
@@ -451,7 +450,6 @@
451
450
  "version": "9.8.0",
452
451
  "dev": true,
453
452
  "license": "MIT",
454
- "peer": true,
455
453
  "dependencies": {
456
454
  "@eslint-community/eslint-utils": "^4.2.0",
457
455
  "@eslint-community/regexpp": "^4.11.0",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "../../../..": {
18
18
  "name": "@camperaid/watest",
19
- "version": "2.5.1",
19
+ "version": "2.6.2",
20
20
  "dev": true,
21
21
  "license": "MPL",
22
22
  "dependencies": {
@@ -187,7 +187,6 @@
187
187
  "version": "8.12.1",
188
188
  "dev": true,
189
189
  "license": "MIT",
190
- "peer": true,
191
190
  "bin": {
192
191
  "acorn": "bin/acorn"
193
192
  },
@@ -451,7 +450,6 @@
451
450
  "version": "9.8.0",
452
451
  "dev": true,
453
452
  "license": "MIT",
454
- "peer": true,
455
453
  "dependencies": {
456
454
  "@eslint-community/eslint-utils": "^4.2.0",
457
455
  "@eslint-community/regexpp": "^4.11.0",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "../../../..": {
18
18
  "name": "@camperaid/watest",
19
- "version": "2.5.1",
19
+ "version": "2.6.2",
20
20
  "dev": true,
21
21
  "license": "MPL",
22
22
  "dependencies": {
@@ -187,7 +187,6 @@
187
187
  "version": "8.12.1",
188
188
  "dev": true,
189
189
  "license": "MIT",
190
- "peer": true,
191
190
  "bin": {
192
191
  "acorn": "bin/acorn"
193
192
  },
@@ -451,7 +450,6 @@
451
450
  "version": "9.8.0",
452
451
  "dev": true,
453
452
  "license": "MIT",
454
- "peer": true,
455
453
  "dependencies": {
456
454
  "@eslint-community/eslint-utils": "^4.2.0",
457
455
  "@eslint-community/regexpp": "^4.11.0",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "../../../..": {
18
18
  "name": "@camperaid/watest",
19
- "version": "2.5.1",
19
+ "version": "2.6.2",
20
20
  "dev": true,
21
21
  "license": "MPL",
22
22
  "dependencies": {
@@ -187,7 +187,6 @@
187
187
  "version": "8.12.1",
188
188
  "dev": true,
189
189
  "license": "MIT",
190
- "peer": true,
191
190
  "bin": {
192
191
  "acorn": "bin/acorn"
193
192
  },
@@ -451,7 +450,6 @@
451
450
  "version": "9.8.0",
452
451
  "dev": true,
453
452
  "license": "MIT",
454
- "peer": true,
455
453
  "dependencies": {
456
454
  "@eslint-community/eslint-utils": "^4.2.0",
457
455
  "@eslint-community/regexpp": "^4.11.0",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "../../../..": {
18
18
  "name": "@camperaid/watest",
19
- "version": "2.5.1",
19
+ "version": "2.6.2",
20
20
  "dev": true,
21
21
  "license": "MPL",
22
22
  "dependencies": {
@@ -187,7 +187,6 @@
187
187
  "version": "8.12.1",
188
188
  "dev": true,
189
189
  "license": "MIT",
190
- "peer": true,
191
190
  "bin": {
192
191
  "acorn": "bin/acorn"
193
192
  },
@@ -451,7 +450,6 @@
451
450
  "version": "9.8.0",
452
451
  "dev": true,
453
452
  "license": "MIT",
454
- "peer": true,
455
453
  "dependencies": {
456
454
  "@eslint-community/eslint-utils": "^4.2.0",
457
455
  "@eslint-community/regexpp": "^4.11.0",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "../../../..": {
18
18
  "name": "@camperaid/watest",
19
- "version": "2.5.1",
19
+ "version": "2.6.1",
20
20
  "dev": true,
21
21
  "license": "MPL",
22
22
  "dependencies": {
@@ -187,7 +187,6 @@
187
187
  "version": "8.12.1",
188
188
  "dev": true,
189
189
  "license": "MIT",
190
- "peer": true,
191
190
  "bin": {
192
191
  "acorn": "bin/acorn"
193
192
  },
@@ -451,7 +450,6 @@
451
450
  "version": "9.8.0",
452
451
  "dev": true,
453
452
  "license": "MIT",
454
- "peer": true,
455
453
  "dependencies": {
456
454
  "@eslint-community/eslint-utils": "^4.2.0",
457
455
  "@eslint-community/regexpp": "^4.11.0",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "../../../..": {
18
18
  "name": "@camperaid/watest",
19
- "version": "2.5.1",
19
+ "version": "2.6.1",
20
20
  "dev": true,
21
21
  "license": "MPL",
22
22
  "dependencies": {
@@ -187,7 +187,6 @@
187
187
  "version": "8.12.1",
188
188
  "dev": true,
189
189
  "license": "MIT",
190
- "peer": true,
191
190
  "bin": {
192
191
  "acorn": "bin/acorn"
193
192
  },
@@ -451,7 +450,6 @@
451
450
  "version": "9.8.0",
452
451
  "dev": true,
453
452
  "license": "MIT",
454
- "peer": true,
455
453
  "dependencies": {
456
454
  "@eslint-community/eslint-utils": "^4.2.0",
457
455
  "@eslint-community/regexpp": "^4.11.0",
@@ -48,9 +48,14 @@ export async function test() {
48
48
 
49
49
  const LogPipe = createMockLogPipe();
50
50
  LogPipe.suppressStdStreams();
51
+ const savedRcLogDir = settings.rc.log_dir;
52
+ const savedLogDir = settings.log_dir;
53
+ settings.rc.log_dir = '/tmp';
51
54
  try {
52
55
  await MockSeries.run([], { ts, LogPipe });
53
56
  } finally {
57
+ settings.rc.log_dir = savedRcLogDir;
58
+ settings.log_dir = savedLogDir;
54
59
  LogPipe.restoreStdStreams();
55
60
  }
56
61
 
@@ -45,9 +45,14 @@ export async function test() {
45
45
 
46
46
  const LogPipe = createMockLogPipe();
47
47
  LogPipe.suppressStdStreams();
48
+ const savedRcLogDir = settings.rc.log_dir;
49
+ const savedLogDir = settings.log_dir;
50
+ settings.rc.log_dir = '/tmp';
48
51
  try {
49
52
  await MockSeries.run([], { ts, LogPipe });
50
53
  } finally {
54
+ settings.rc.log_dir = savedRcLogDir;
55
+ settings.log_dir = savedLogDir;
51
56
  LogPipe.restoreStdStreams();
52
57
  }
53
58
 
@@ -11,8 +11,6 @@ import { settings } from '../../../core/settings.js';
11
11
  const completed_in = name => got => got.startsWith(`>${name} completed in`);
12
12
 
13
13
  export async function test() {
14
- const { webdrivers } = settings;
15
-
16
14
  let failed = false;
17
15
  const ts = {
18
16
  'tests': {
@@ -44,6 +42,12 @@ export async function test() {
44
42
 
45
43
  const LogPipe = createMockLogPipe();
46
44
  LogPipe.suppressStdStreams();
45
+ const savedRcLogDir = settings.rc.log_dir;
46
+ const savedRcWebdrivers = settings.rc.webdrivers;
47
+ const savedLogDir = settings.log_dir;
48
+ const savedWebdrivers = settings.webdrivers;
49
+ settings.rc.log_dir = '/tmp';
50
+ settings.rc.webdrivers = ['chrome', 'firefox'];
47
51
  try {
48
52
  await MockSeries.run([], {
49
53
  ts,
@@ -56,7 +60,14 @@ export async function test() {
56
60
  LogPipe.restoreStdStreams();
57
61
  }
58
62
 
59
- const chromeLogs = webdrivers.includes('chrome')
63
+ const { webdrivers: activeWebdrivers } = settings;
64
+ settings.rc.log_dir = savedRcLogDir;
65
+ settings.rc.webdrivers = savedRcWebdrivers;
66
+ settings.log_dir = savedLogDir;
67
+ settings.webdrivers = savedWebdrivers;
68
+
69
+ // Chrome first-run logs.
70
+ const chromeFirstRunLogs = activeWebdrivers.includes('chrome')
60
71
  ? [
61
72
  [
62
73
  'mac/webdriver/chrome/log',
@@ -92,23 +103,11 @@ export async function test() {
92
103
  '\x1B[38;5;243mCompleted\x1B[0m mac/webdriver/chrome/end-to-end/history',
93
104
  ],
94
105
  ],
95
- [
96
- 'mac/webdriver/chrome/end-to-end/history-verify/log',
97
- [
98
- '\x1B[38;5;99mStarted\x1B[0m mac/webdriver/chrome/end-to-end/history-verify',
99
- '!Running: mac/webdriver/chrome/end-to-end/history-verify/t_history.js, path: tests/webdriver/end-to-end/history/t_history.js',
100
- '\x1B[32mOk:\x1B[0m TestoOk',
101
- completed_in(
102
- 'mac/webdriver/chrome/end-to-end/history-verify/t_history.js',
103
- ),
104
- '\x1B[102mmac/webdriver/chrome/end-to-end/history-verify\x1B[0m Total: 1',
105
- '\x1B[38;5;243mCompleted\x1B[0m mac/webdriver/chrome/end-to-end/history-verify',
106
- ],
107
- ],
108
106
  ]
109
107
  : [];
110
108
 
111
- const firefoxLogs = webdrivers.includes('firefox')
109
+ // Firefox logs (runs after chrome first pass).
110
+ const firefoxLogs = activeWebdrivers.includes('firefox')
112
111
  ? [
113
112
  [
114
113
  'mac/webdriver/firefox/log',
@@ -142,6 +141,25 @@ export async function test() {
142
141
  ]
143
142
  : [];
144
143
 
144
+ // Chrome verify logs (runs after firefox pass).
145
+ const chromeVerifyLogs = activeWebdrivers.includes('chrome')
146
+ ? [
147
+ [
148
+ 'mac/webdriver/chrome/end-to-end/history-verify/log',
149
+ [
150
+ '\x1B[38;5;99mStarted\x1B[0m mac/webdriver/chrome/end-to-end/history-verify',
151
+ '!Running: mac/webdriver/chrome/end-to-end/history-verify/t_history.js, path: tests/webdriver/end-to-end/history/t_history.js',
152
+ '\x1B[32mOk:\x1B[0m TestoOk',
153
+ completed_in(
154
+ 'mac/webdriver/chrome/end-to-end/history-verify/t_history.js',
155
+ ),
156
+ '\x1B[102mmac/webdriver/chrome/end-to-end/history-verify\x1B[0m Total: 1',
157
+ '\x1B[38;5;243mCompleted\x1B[0m mac/webdriver/chrome/end-to-end/history-verify',
158
+ ],
159
+ ],
160
+ ]
161
+ : [];
162
+
145
163
  const buffers = LogPipe.FileStream.getLoggingBuffers();
146
164
  is(
147
165
  buffers,
@@ -163,8 +181,9 @@ export async function test() {
163
181
  '\x1B[38;5;243mCompleted\x1B[0m mac/webdriver',
164
182
  ],
165
183
  ],
166
- ...chromeLogs,
184
+ ...chromeFirstRunLogs,
167
185
  ...firefoxLogs,
186
+ ...chromeVerifyLogs,
168
187
  ],
169
188
  'logging verify',
170
189
  );
@@ -1,4 +1,9 @@
1
- import { is_test_output, MockSeries, fail } from '../test.js';
1
+ import {
2
+ is_test_output,
3
+ MockSeries,
4
+ fail,
5
+ settings_preamble,
6
+ } from '../test.js';
2
7
 
3
8
  export async function test() {
4
9
  const ts = {
@@ -18,22 +23,16 @@ export async function test() {
18
23
  };
19
24
 
20
25
  const expected_stdout = [
21
- 'Settings: no temporary storage dir',
22
- 'Settings: logging into /tmp',
23
- 'Settings: webdriver_chrome_args=[]',
24
- 'Settings: chrome webdrivers',
26
+ ...settings_preamble(),
25
27
  '\x1B[38;5;99mStarted\x1B[0m mac/',
26
28
  '\x1B[38;5;99mStarted\x1B[0m mac/unit',
27
29
  '!Running: mac/unit/t_testo.js, path: tests/unit/t_testo.js',
28
30
  '>mac/unit/t_testo.js completed in',
29
31
  '\x1B[38;5;243mCompleted\x1B[0m mac/unit',
30
- 'Logs are written to',
31
32
  '\x1B[41m\x1B[37m>mac/unit/t_testo.js\x1B[0m Failure count: 1',
32
33
  '\x1B[41m\x1B[37mFailed!\x1B[0m Passed: 0. Failed: 1',
33
34
  '\x1B[38;5;243mCompleted\x1B[0m mac/',
34
- 'Logs are written to',
35
35
  'Elapsed:',
36
- 'Logs are written to',
37
36
  'Testsuite: shutdown',
38
37
  ];
39
38
 
@@ -1,4 +1,9 @@
1
- import { is_test_output, MockSeries, success } from '../test.js';
1
+ import {
2
+ is_test_output,
3
+ MockSeries,
4
+ success,
5
+ settings_preamble,
6
+ } from '../test.js';
2
7
 
3
8
  export async function test() {
4
9
  const ts = {
@@ -24,17 +29,12 @@ export async function test() {
24
29
  '\x1B[32mOk:\x1B[0m Testo',
25
30
  '>mac/unit/t_testo.js completed in',
26
31
  '\x1B[38;5;243mCompleted\x1B[0m mac/unit',
27
- 'Logs are written to',
28
32
  '\x1B[102mSuccess!\x1B[0m Total: 1',
29
33
  '\x1B[38;5;243mCompleted\x1B[0m mac/',
30
- 'Logs are written to',
31
34
  ];
32
35
 
33
36
  const expected_stdout = [
34
- 'Settings: no temporary storage dir',
35
- 'Settings: logging into /tmp',
36
- 'Settings: webdriver_chrome_args=[]',
37
- 'Settings: chrome webdrivers',
37
+ ...settings_preamble(),
38
38
  ...expected_out_for_success,
39
39
  ...expected_out_for_success,
40
40
  ...expected_out_for_success,
@@ -42,7 +42,6 @@ export async function test() {
42
42
  ...expected_out_for_success,
43
43
 
44
44
  'Elapsed:',
45
- 'Logs are written to',
46
45
  'Testsuite: shutdown',
47
46
  ];
48
47
 
@@ -1,4 +1,9 @@
1
- import { is_test_output, MockSeries, success } from '../test.js';
1
+ import {
2
+ is_test_output,
3
+ MockSeries,
4
+ success,
5
+ settings_preamble,
6
+ } from '../test.js';
2
7
 
3
8
  export async function test() {
4
9
  const ts = {
@@ -33,10 +38,7 @@ export async function test() {
33
38
  await is_test_output(
34
39
  () => MockSeries.run([], { ts }),
35
40
  [
36
- 'Settings: no temporary storage dir',
37
- 'Settings: logging into /tmp',
38
- 'Settings: webdriver_chrome_args=[]',
39
- 'Settings: chrome webdrivers',
41
+ ...settings_preamble(),
40
42
  '\x1B[38;5;99mStarted\x1B[0m mac/',
41
43
  '\x1B[38;5;99mStarted\x1B[0m mac/unit',
42
44
  '\x1B[38;5;99mStarted\x1B[0m mac/unit/base',
@@ -44,20 +46,15 @@ export async function test() {
44
46
  '\x1B[32mOk:\x1B[0m Testo',
45
47
  '>mac/unit/base/t_testo.js completed in',
46
48
  '\x1B[38;5;243mCompleted\x1B[0m mac/unit/base',
47
- 'Logs are written to',
48
49
  '\x1B[38;5;99mStarted\x1B[0m mac/unit/core',
49
50
  '!Running: mac/unit/core/t_presto.js, path: tests/unit/core/t_presto.js',
50
51
  '\x1B[32mOk:\x1B[0m Presto',
51
52
  '>mac/unit/core/t_presto.js completed in',
52
53
  '\x1B[38;5;243mCompleted\x1B[0m mac/unit/core',
53
- 'Logs are written to',
54
54
  '\x1B[38;5;243mCompleted\x1B[0m mac/unit',
55
- 'Logs are written to',
56
55
  '\x1B[102mSuccess!\x1B[0m Total: 2',
57
56
  '\x1B[38;5;243mCompleted\x1B[0m mac/',
58
- 'Logs are written to',
59
57
  'Elapsed:',
60
- 'Logs are written to',
61
58
  'Testsuite: shutdown',
62
59
  ],
63
60
  [],
@@ -1,4 +1,10 @@
1
- import { fail, is_test_output, MockSeries, success } from '../test.js';
1
+ import {
2
+ fail,
3
+ is_test_output,
4
+ MockSeries,
5
+ success,
6
+ settings_preamble,
7
+ } from '../test.js';
2
8
 
3
9
  export async function test() {
4
10
  let testfailed = false;
@@ -31,10 +37,7 @@ export async function test() {
31
37
  };
32
38
 
33
39
  const expected_stdout = [
34
- 'Settings: no temporary storage dir',
35
- 'Settings: logging into /tmp',
36
- 'Settings: webdriver_chrome_args=[]',
37
- 'Settings: chrome webdrivers',
40
+ ...settings_preamble(),
38
41
  '\x1B[38;5;99mStarted\x1B[0m mac/',
39
42
  '\x1B[38;5;99mStarted\x1B[0m mac/webdriver',
40
43
  '\x1B[38;5;99mStarted\x1B[0m mac/webdriver/chrome',
@@ -43,11 +46,8 @@ export async function test() {
43
46
  '!Running: mac/webdriver/chrome/end-to-end/sharing/t_shared_editing.js, path: tests/webdriver/end-to-end/sharing/t_shared_editing.js',
44
47
  '>mac/webdriver/chrome/end-to-end/sharing/t_shared_editing.js completed in',
45
48
  '\x1B[38;5;243mCompleted\x1B[0m mac/webdriver/chrome/end-to-end/sharing',
46
- 'Logs are written to',
47
49
  '\x1B[38;5;243mCompleted\x1B[0m mac/webdriver/chrome/end-to-end',
48
- 'Logs are written to',
49
50
  '\x1B[38;5;243mCompleted\x1B[0m mac/webdriver/chrome',
50
- 'Logs are written to',
51
51
  '\x1B[38;5;99mStarted\x1B[0m mac/webdriver/firefox',
52
52
  '\x1B[38;5;99mStarted\x1B[0m mac/webdriver/firefox/end-to-end',
53
53
  '\x1B[38;5;99mStarted\x1B[0m mac/webdriver/firefox/end-to-end/sharing',
@@ -55,17 +55,12 @@ export async function test() {
55
55
  '\x1B[32mOk:\x1B[0m WDSuccessio',
56
56
  '>mac/webdriver/firefox/end-to-end/sharing/t_shared_editing.js completed in',
57
57
  '\x1B[38;5;243mCompleted\x1B[0m mac/webdriver/firefox/end-to-end/sharing',
58
- 'Logs are written to',
59
58
  '\x1B[38;5;243mCompleted\x1B[0m mac/webdriver/firefox/end-to-end',
60
- 'Logs are written to',
61
59
  '\x1B[38;5;243mCompleted\x1B[0m mac/webdriver/firefox',
62
- 'Logs are written to',
63
60
  '\x1B[38;5;243mCompleted\x1B[0m mac/webdriver',
64
- 'Logs are written to',
65
61
  '\x1B[41m\x1B[37m>mac/webdriver/chrome/end-to-end/sharing/t_shared_editing.js\x1B[0m Failure count: 1',
66
62
  '\x1B[41m\x1B[37mFailed!\x1B[0m Passed: 1. Failed: 1',
67
63
  '\x1B[38;5;243mCompleted\x1B[0m mac/',
68
- 'Logs are written to',
69
64
  '\x1B[38;5;99mStarted\x1B[0m mac/',
70
65
  '\x1B[38;5;99mStarted\x1B[0m mac/webdriver',
71
66
  '\x1B[38;5;99mStarted\x1B[0m mac/webdriver/chrome',
@@ -75,18 +70,12 @@ export async function test() {
75
70
  '\x1B[32mOk:\x1B[0m WDSuccessio',
76
71
  '>mac/webdriver/chrome/end-to-end/sharing-verify/t_shared_editing.js completed in',
77
72
  '\x1B[38;5;243mCompleted\x1B[0m mac/webdriver/chrome/end-to-end/sharing-verify',
78
- 'Logs are written to',
79
73
  '\x1B[38;5;243mCompleted\x1B[0m mac/webdriver/chrome/end-to-end',
80
- 'Logs are written to',
81
74
  '\x1B[38;5;243mCompleted\x1B[0m mac/webdriver/chrome',
82
- 'Logs are written to',
83
75
  '\x1B[38;5;243mCompleted\x1B[0m mac/webdriver',
84
- 'Logs are written to',
85
76
  '\x1B[102mSuccess!\x1B[0m Total: 1',
86
77
  '\x1B[38;5;243mCompleted\x1B[0m mac/',
87
- 'Logs are written to',
88
78
  'Elapsed:',
89
- 'Logs are written to',
90
79
  'Testsuite: shutdown',
91
80
  ];
92
81
 
@@ -1,4 +1,10 @@
1
- import { fail, is_test_output, MockSeries, success } from '../test.js';
1
+ import {
2
+ fail,
3
+ is_test_output,
4
+ MockSeries,
5
+ success,
6
+ settings_preamble,
7
+ } from '../test.js';
2
8
 
3
9
  export async function test() {
4
10
  const ts = {
@@ -31,10 +37,7 @@ export async function test() {
31
37
  };
32
38
 
33
39
  const expected_stdout = [
34
- 'Settings: no temporary storage dir',
35
- 'Settings: logging into /tmp',
36
- 'Settings: webdriver_chrome_args=[]',
37
- 'Settings: chrome webdrivers',
40
+ ...settings_preamble(),
38
41
  '\x1B[38;5;99mStarted\x1B[0m mac/',
39
42
  '\x1B[38;5;99mStarted\x1B[0m mac/unit',
40
43
  '\x1B[38;5;99mStarted\x1B[0m mac/unit/base',
@@ -42,33 +45,25 @@ export async function test() {
42
45
  '\x1B[32mOk:\x1B[0m Testo',
43
46
  '>mac/unit/base/t_testo.js completed in',
44
47
  '\x1B[38;5;243mCompleted\x1B[0m mac/unit/base',
45
- 'Logs are written to',
46
48
  '\x1B[38;5;99mStarted\x1B[0m mac/unit/core',
47
49
  '!Running: mac/unit/core/t_presto.js, path: tests/unit/core/t_presto.js',
48
50
  '>mac/unit/core/t_presto.js completed in',
49
51
  '\x1B[38;5;243mCompleted\x1B[0m mac/unit/core',
50
- 'Logs are written to',
51
52
  '\x1B[38;5;243mCompleted\x1B[0m mac/unit',
52
- 'Logs are written to',
53
53
  '\x1B[41m\x1B[37m>mac/unit/core/t_presto.js\x1B[0m Failure count: 1',
54
54
  '\x1B[41m\x1B[37mFailed!\x1B[0m Passed: 1. Failed: 1',
55
55
  '\x1B[38;5;243mCompleted\x1B[0m mac/',
56
- 'Logs are written to',
57
56
  '\x1B[38;5;99mStarted\x1B[0m mac/',
58
57
  '\x1B[38;5;99mStarted\x1B[0m mac/unit',
59
58
  '\x1B[38;5;99mStarted\x1B[0m mac/unit/core-verify',
60
59
  '!Running: mac/unit/core-verify/t_presto.js, path: tests/unit/core/t_presto.js',
61
60
  '>mac/unit/core-verify/t_presto.js completed in',
62
61
  '\x1B[38;5;243mCompleted\x1B[0m mac/unit/core-verify',
63
- 'Logs are written to',
64
62
  '\x1B[38;5;243mCompleted\x1B[0m mac/unit',
65
- 'Logs are written to',
66
63
  '\x1B[41m\x1B[37m>mac/unit/core-verify/t_presto.js\x1B[0m Failure count: 1',
67
64
  '\x1B[41m\x1B[37mFailed!\x1B[0m Passed: 0. Failed: 1',
68
65
  '\x1B[38;5;243mCompleted\x1B[0m mac/',
69
- 'Logs are written to',
70
66
  'Elapsed:',
71
- 'Logs are written to',
72
67
  'Testsuite: shutdown',
73
68
  ];
74
69
 
@@ -1,4 +1,5 @@
1
1
  import { is_test_output } from '../../base/test.js';
2
+ import { settings_preamble } from '../test.js';
2
3
  import { MockSeriesWithServicer } from './mock-servicer.js';
3
4
 
4
5
  export async function test() {
@@ -21,19 +22,14 @@ export async function test() {
21
22
  await is_test_output(
22
23
  () => MockSeriesWithServicer.run([], { ts }),
23
24
  [
24
- 'Settings: no temporary storage dir',
25
- 'Settings: logging into /tmp',
26
- 'Settings: webdriver_chrome_args=[]',
27
- 'Settings: chrome webdrivers',
25
+ ...settings_preamble(),
28
26
  '\x1B[38;5;99mStarted\x1B[0m mac/',
29
27
  '!Running: mac, path: tests/meta.js',
30
28
  '\x1B[32mOk:\x1B[0m Skipped: meta.enabled=false',
31
29
  '>mac completed in',
32
30
  '\x1B[102mSuccess!\x1B[0m Total: 1',
33
31
  '\x1B[38;5;243mCompleted\x1B[0m mac/',
34
- 'Logs are written to',
35
32
  'Elapsed:',
36
- 'Logs are written to',
37
33
  'Testsuite: shutdown',
38
34
  ],
39
35
  [],
@@ -1,4 +1,5 @@
1
1
  import { is_test_output, success } from '../../base/test.js';
2
+ import { settings_preamble } from '../test.js';
2
3
  import { MockSeriesWithServicer } from './mock-servicer.js';
3
4
 
4
5
  export async function test() {
@@ -33,10 +34,7 @@ export async function test() {
33
34
  await is_test_output(
34
35
  () => MockSeriesWithServicer.run([], { ts }),
35
36
  [
36
- 'Settings: no temporary storage dir',
37
- 'Settings: logging into /tmp',
38
- 'Settings: webdriver_chrome_args=[]',
39
- 'Settings: chrome webdrivers',
37
+ ...settings_preamble(),
40
38
  '\x1B[38;5;99mStarted\x1B[0m mac/',
41
39
 
42
40
  // Parent folder init - starts parent services
@@ -75,7 +73,6 @@ export async function test() {
75
73
  '>mac/nested/uninit completed in',
76
74
 
77
75
  '\x1B[38;5;243mCompleted\x1B[0m mac/nested',
78
- 'Logs are written to',
79
76
 
80
77
  // Parent uninit - stops parent services
81
78
  '!Running: mac/uninit, path: tests/meta.js',
@@ -86,9 +83,7 @@ export async function test() {
86
83
 
87
84
  '\x1B[102mSuccess!\x1B[0m Total: 2',
88
85
  '\x1B[38;5;243mCompleted\x1B[0m mac/',
89
- 'Logs are written to',
90
86
  'Elapsed:',
91
- 'Logs are written to',
92
87
 
93
88
  // Final shutdown should happen here with no remaining services
94
89
  'MockServicer:docker shutdown',
@@ -1,4 +1,5 @@
1
1
  import { is_test_output, success } from '../../base/test.js';
2
+ import { settings_preamble } from '../test.js';
2
3
  import { MockSeriesWithServicer } from './mock-servicer.js';
3
4
 
4
5
  /**
@@ -24,10 +25,7 @@ export async function test() {
24
25
  await is_test_output(
25
26
  () => MockSeriesWithServicer.run([], { ts }),
26
27
  [
27
- 'Settings: no temporary storage dir',
28
- 'Settings: logging into /tmp',
29
- 'Settings: webdriver_chrome_args=[]',
30
- 'Settings: chrome webdrivers',
28
+ ...settings_preamble(),
31
29
  '\x1B[38;5;99mStarted\x1B[0m mac/',
32
30
  '!Running: mac/init, path: tests/meta.js',
33
31
  'MockServicer:kubernetes init',
@@ -42,9 +40,7 @@ export async function test() {
42
40
  '>mac/uninit completed in',
43
41
  '\x1B[102mSuccess!\x1B[0m Total: 1',
44
42
  '\x1B[38;5;243mCompleted\x1B[0m mac/',
45
- 'Logs are written to',
46
43
  'Elapsed:',
47
- 'Logs are written to',
48
44
  'MockServicer:kubernetes shutdown',
49
45
  'Testsuite: shutdown',
50
46
  ],
@@ -14,6 +14,7 @@
14
14
  */
15
15
 
16
16
  import { is_test_output, success } from '../../base/test.js';
17
+ import { settings_preamble } from '../test.js';
17
18
  import { MockSeriesWithServicer } from './mock-servicer.js';
18
19
 
19
20
  export async function test() {
@@ -64,10 +65,7 @@ export async function test() {
64
65
  await is_test_output(
65
66
  () => MockSeriesWithServicer.run([], { ts }),
66
67
  [
67
- 'Settings: no temporary storage dir',
68
- 'Settings: logging into /tmp',
69
- 'Settings: webdriver_chrome_args=[]',
70
- 'Settings: chrome webdrivers',
68
+ ...settings_preamble(),
71
69
  '\x1B[38;5;99mStarted\x1B[0m mac/',
72
70
  '\x1B[38;5;99mStarted\x1B[0m mac/folder1',
73
71
 
@@ -87,7 +85,6 @@ export async function test() {
87
85
  '>mac/folder1/uninit completed in',
88
86
 
89
87
  '\x1B[38;5;243mCompleted\x1B[0m mac/folder1',
90
- 'Logs are written to',
91
88
  '\x1B[38;5;99mStarted\x1B[0m mac/folder2',
92
89
 
93
90
  // Folder 2: switch to kubernetes servicer (no shutdown - servicer handles conflicts)
@@ -106,7 +103,6 @@ export async function test() {
106
103
  '>mac/folder2/uninit completed in',
107
104
 
108
105
  '\x1B[38;5;243mCompleted\x1B[0m mac/folder2',
109
- 'Logs are written to',
110
106
  '\x1B[38;5;99mStarted\x1B[0m mac/folder3',
111
107
 
112
108
  // Folder 3: switch back to docker servicer (no shutdown - servicer handles conflicts)
@@ -125,12 +121,9 @@ export async function test() {
125
121
  '>mac/folder3/uninit completed in',
126
122
 
127
123
  '\x1B[38;5;243mCompleted\x1B[0m mac/folder3',
128
- 'Logs are written to',
129
124
  '\x1B[102mSuccess!\x1B[0m Total: 3',
130
125
  '\x1B[38;5;243mCompleted\x1B[0m mac/',
131
- 'Logs are written to',
132
126
  'Elapsed:',
133
- 'Logs are written to',
134
127
  'MockServicer:docker shutdown',
135
128
  'Testsuite: shutdown',
136
129
  ],
@@ -1,4 +1,5 @@
1
1
  import { is_test_output, success } from '../../base/test.js';
2
+ import { settings_preamble } from '../test.js';
2
3
  import { MockSeriesWithServicer } from './mock-servicer.js';
3
4
 
4
5
  export async function test() {
@@ -20,10 +21,7 @@ export async function test() {
20
21
  await is_test_output(
21
22
  () => MockSeriesWithServicer.run([], { ts }),
22
23
  [
23
- 'Settings: no temporary storage dir',
24
- 'Settings: logging into /tmp',
25
- 'Settings: webdriver_chrome_args=[]',
26
- 'Settings: chrome webdrivers',
24
+ ...settings_preamble(),
27
25
  '\x1B[38;5;99mStarted\x1B[0m mac/',
28
26
  '!Running: mac/init, path: tests/meta.js',
29
27
  'MockServicer:docker init',
@@ -40,9 +38,7 @@ export async function test() {
40
38
  '>mac/uninit completed in',
41
39
  '\x1B[102mSuccess!\x1B[0m Total: 1',
42
40
  '\x1B[38;5;243mCompleted\x1B[0m mac/',
43
- 'Logs are written to',
44
41
  'Elapsed:',
45
- 'Logs are written to',
46
42
  'MockServicer:docker shutdown',
47
43
  'Testsuite: shutdown',
48
44
  ],
@@ -1,5 +1,6 @@
1
1
  import { Core } from '../../core/core.js';
2
2
  import { Series } from '../../core/series.js';
3
+ import { settings } from '../../core/settings.js';
3
4
 
4
5
  function build_tests(tests) {
5
6
  return tests.map(t => ({
@@ -62,6 +63,25 @@ export function running_checker(name, path) {
62
63
  return `\n!Running: ${name}, path: ${path}\n\n`;
63
64
  }
64
65
 
66
+ /**
67
+ * Returns expected settings preamble lines based on current config.
68
+ */
69
+ export function settings_preamble() {
70
+ const lines = [
71
+ settings.rc.tmp_dir
72
+ ? `Settings: temporary storage dir is at ${settings.tmp_storage_dir}`
73
+ : 'Settings: no temporary storage dir',
74
+ settings.rc.log_dir
75
+ ? `Settings: logging into ${settings.rc.log_dir}`
76
+ : 'Settings: no file logging',
77
+ `Settings: webdriver_chrome_args=${JSON.stringify(settings.webdriver_chrome_args)}`,
78
+ ];
79
+ if (settings.webdrivers) {
80
+ lines.push(`Settings: ${settings.webdrivers.join(', ')} webdrivers`);
81
+ }
82
+ return lines;
83
+ }
84
+
65
85
  export function make_perform_function(tests) {
66
86
  return async () => {
67
87
  const series = new Series('tests/', {
@@ -44,6 +44,11 @@ function getChromeOptions() {
44
44
  chromeOptions.addArguments('no-sandbox');
45
45
  chromeOptions.addArguments('disable-dev-shm-usage');
46
46
 
47
+ // Use pipe-based DevTools instead of a port file. Prevents
48
+ // "DevToolsActivePort file doesn't exist" when Chrome exits early or on some
49
+ // macOS setups (Chrome 111+).
50
+ chromeOptions.addArguments('remote-debugging-pipe');
51
+
47
52
  // Disable disk cache so stale resources from previous deploys are never
48
53
  // served from cache. Each test session fetches everything from the network.
49
54
  chromeOptions.addArguments('disk-cache-size=0');