ui5-test-runner 5.7.4 โ 5.8.1
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/package.json +4 -4
- package/src/batch.js +2 -4
- package/src/job-mode.js +2 -1
- package/src/job.js +1 -0
- package/src/output.js +22 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ui5-test-runner",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.1",
|
|
4
4
|
"description": "Standalone test runner for UI5",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"ps-tree": "^1.2.0",
|
|
50
50
|
"punybind": "^1.2.1",
|
|
51
51
|
"punyexpr": "1.1.1",
|
|
52
|
-
"reserve": "2.3.
|
|
52
|
+
"reserve": "2.3.3"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@openui5/types": "^1.136.
|
|
56
|
-
"@ui5/cli": "^4.0.
|
|
55
|
+
"@openui5/types": "^1.136.1",
|
|
56
|
+
"@ui5/cli": "^4.0.19",
|
|
57
57
|
"@ui5/middleware-code-coverage": "^2.0.1",
|
|
58
58
|
"dotenv": "^16.5.0",
|
|
59
59
|
"jest": "^29.7.0",
|
package/src/batch.js
CHANGED
|
@@ -2,7 +2,7 @@ const { open, readdir, stat, unlink } = require('fs/promises')
|
|
|
2
2
|
const { extname, isAbsolute, join } = require('path')
|
|
3
3
|
const { allocPromise, filename } = require('./tools')
|
|
4
4
|
const { fork } = require('child_process')
|
|
5
|
-
const {
|
|
5
|
+
const { getOutput, newProgress } = require('./output')
|
|
6
6
|
const { parallelize } = require('./parallelize')
|
|
7
7
|
const { $statusProgressCount } = require('./symbols')
|
|
8
8
|
const { $valueSources } = require('./symbols')
|
|
@@ -56,9 +56,7 @@ const task = async function (batchItem) {
|
|
|
56
56
|
const reportDir = join(job.reportDir, id)
|
|
57
57
|
progress.label = `${label} (${id})`
|
|
58
58
|
progress.count = 1
|
|
59
|
-
|
|
60
|
-
output.log(`${label}...`)
|
|
61
|
-
}
|
|
59
|
+
output.batchStartingTask(label)
|
|
62
60
|
const { promise, resolve, reject } = allocPromise()
|
|
63
61
|
const parameters = [
|
|
64
62
|
...args,
|
package/src/job-mode.js
CHANGED
package/src/job.js
CHANGED
|
@@ -113,6 +113,7 @@ function getCommand (cwd) {
|
|
|
113
113
|
.option('--offline [flag]', '[๐ป๐๐งช๐ก] Limit network usage (implies --no-npm-install)', boolean, false)
|
|
114
114
|
.option('--env <name=value...>', '[๐ป๐๐งช๐ก] Set environment variable', arrayOf(string))
|
|
115
115
|
.option('--localhost <host>', `[๐ป๐๐งช๐ก] ${DANGEROUS_OPTION} Hostname for legacy URLs and callbacks`, string, 'localhost')
|
|
116
|
+
.option('--ci [flag]', '[๐ป๐๐งช๐ก] CI mode (no interactive output)', boolean, false)
|
|
116
117
|
|
|
117
118
|
// Common to legacy and url
|
|
118
119
|
.option('--webapp <path>', '[๐ป๐] Base folder of the web application (relative to cwd)', 'webapp')
|
package/src/output.js
CHANGED
|
@@ -10,8 +10,6 @@ const {
|
|
|
10
10
|
} = require('./symbols')
|
|
11
11
|
const { filename, noop, pad } = require('./tools')
|
|
12
12
|
|
|
13
|
-
const inJest = typeof jest !== 'undefined'
|
|
14
|
-
const interactive = process.stdout.columns !== undefined && !inJest
|
|
15
13
|
const $output = Symbol('output')
|
|
16
14
|
const $outputStart = Symbol('output-start')
|
|
17
15
|
const $outputProgress = Symbol('output-progress')
|
|
@@ -19,22 +17,9 @@ const $logServerIncomingCount = Symbol('log-server-incoming')
|
|
|
19
17
|
const $logServerRedirectedCount = Symbol('log-server-redirected')
|
|
20
18
|
const $logServerClosedCount = Symbol('log-server-closed')
|
|
21
19
|
const $logServerRequests = Symbol('log-server-requests')
|
|
20
|
+
const $interactive = Symbol('interactive')
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
const UTF8_BOM_CODE = '\ufeff'
|
|
25
|
-
process.stdout.write(UTF8_BOM_CODE)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
let cons
|
|
29
|
-
if (inJest) {
|
|
30
|
-
cons = {
|
|
31
|
-
log: noop,
|
|
32
|
-
warn: noop,
|
|
33
|
-
error: noop
|
|
34
|
-
}
|
|
35
|
-
} else {
|
|
36
|
-
cons = console
|
|
37
|
-
}
|
|
22
|
+
let cons = console
|
|
38
23
|
|
|
39
24
|
const formatTime = duration => {
|
|
40
25
|
duration = Math.ceil(duration / 1000)
|
|
@@ -129,7 +114,7 @@ function progress (job, cleanFirst = true) {
|
|
|
129
114
|
})
|
|
130
115
|
}
|
|
131
116
|
const sequence = []
|
|
132
|
-
if (interactive) {
|
|
117
|
+
if (job[$interactive]) {
|
|
133
118
|
if (cleanFirst) {
|
|
134
119
|
sequence.push(...buildCleanSequence(job))
|
|
135
120
|
}
|
|
@@ -248,8 +233,21 @@ function browserIssue (job, { type, url, code, dir }) {
|
|
|
248
233
|
}
|
|
249
234
|
|
|
250
235
|
function build (job) {
|
|
236
|
+
let interactive = !job.ci
|
|
237
|
+
const inJest = typeof jest !== 'undefined'
|
|
238
|
+
if (inJest) {
|
|
239
|
+
cons = { log: noop, warn: noop, error: noop }
|
|
240
|
+
interactive = false
|
|
241
|
+
} else if (process.stdout.columns === undefined || !process.stdout.isTTY) {
|
|
242
|
+
interactive = false
|
|
243
|
+
}
|
|
244
|
+
if (!interactive) {
|
|
245
|
+
const UTF8_BOM_CODE = '\ufeff'
|
|
246
|
+
process.stdout.write(UTF8_BOM_CODE)
|
|
247
|
+
}
|
|
251
248
|
let wrap
|
|
252
249
|
if (interactive) {
|
|
250
|
+
job[$interactive] = true
|
|
253
251
|
wrap = method => function () {
|
|
254
252
|
clean(job)
|
|
255
253
|
try {
|
|
@@ -476,6 +474,12 @@ function build (job) {
|
|
|
476
474
|
log(job, p80()`โ ๏ธ [SKIPIF] Skipping execution (--if)`)
|
|
477
475
|
}),
|
|
478
476
|
|
|
477
|
+
batchStartingTask: wrap((label) => {
|
|
478
|
+
if (!interactive) {
|
|
479
|
+
log(job, p80()`${label}...`)
|
|
480
|
+
}
|
|
481
|
+
}),
|
|
482
|
+
|
|
479
483
|
batchFailed: wrap((batch, reason) => {
|
|
480
484
|
log(job, p80()`โ ๏ธ [BATCHF] Failed to resolve batch ${batch}: ${reason}`)
|
|
481
485
|
}),
|
|
@@ -662,8 +666,6 @@ function build (job) {
|
|
|
662
666
|
}
|
|
663
667
|
|
|
664
668
|
module.exports = {
|
|
665
|
-
interactive,
|
|
666
|
-
|
|
667
669
|
getOutput (job) {
|
|
668
670
|
if (!job[$output]) {
|
|
669
671
|
job[$output] = build(job)
|