ui5-test-runner 5.5.1 → 5.5.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/package.json +1 -1
- package/src/batch.js +32 -16
- package/src/capabilities/tests/ui5/timezone.html +27 -0
- package/src/job.js +1 -1
- package/src/output.js +1 -1
- package/src/start.js +6 -2
- package/src/timeout.js +2 -2
package/package.json
CHANGED
package/src/batch.js
CHANGED
|
@@ -7,6 +7,8 @@ const { parallelize } = require('./parallelize')
|
|
|
7
7
|
const { $statusProgressCount } = require('./symbols')
|
|
8
8
|
const { $valueSources } = require('./symbols')
|
|
9
9
|
const { getCommand, toLongName } = require('./job')
|
|
10
|
+
const { save } = require('./report')
|
|
11
|
+
const { end } = require('./end')
|
|
10
12
|
|
|
11
13
|
const batchParameters = getCommand('.').options
|
|
12
14
|
.filter(option => option.description.includes('📡'))
|
|
@@ -17,10 +19,9 @@ const batchParameters = getCommand('.').options
|
|
|
17
19
|
|
|
18
20
|
const root = join(__dirname, '..')
|
|
19
21
|
|
|
20
|
-
const folder = (
|
|
22
|
+
const folder = (job, folderPath) => {
|
|
21
23
|
getOutput(job).debug('batch', `adding folder: ${folderPath}`)
|
|
22
|
-
batchItems.push({
|
|
23
|
-
job,
|
|
24
|
+
job.batchItems.push({
|
|
24
25
|
path: folderPath,
|
|
25
26
|
id: filename(folderPath),
|
|
26
27
|
label: folderPath,
|
|
@@ -28,15 +29,14 @@ const folder = (batchItems, job, folderPath) => {
|
|
|
28
29
|
})
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
const configurationFile = (
|
|
32
|
+
const configurationFile = (job, configurationFilePath) => {
|
|
32
33
|
getOutput(job).debug('batch', `adding configuration file: ${configurationFilePath}`)
|
|
33
34
|
try {
|
|
34
35
|
const {
|
|
35
36
|
batchId: id = filename(configurationFilePath),
|
|
36
37
|
batchLabel: label = configurationFilePath
|
|
37
38
|
} = require(configurationFilePath)
|
|
38
|
-
batchItems.push({
|
|
39
|
-
job,
|
|
39
|
+
job.batchItems.push({
|
|
40
40
|
path: configurationFilePath,
|
|
41
41
|
id,
|
|
42
42
|
label,
|
|
@@ -47,7 +47,10 @@ const configurationFile = (batchItems, job, configurationFilePath) => {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
const task = async (
|
|
50
|
+
const task = async function (batchItem) {
|
|
51
|
+
const { id, label, args } = batchItem
|
|
52
|
+
batchItem.start = new Date()
|
|
53
|
+
const job = this
|
|
51
54
|
const output = getOutput(job)
|
|
52
55
|
const progress = newProgress(job)
|
|
53
56
|
const reportDir = join(job.reportDir, id)
|
|
@@ -104,6 +107,8 @@ const task = async ({ job, id, label, args }) => {
|
|
|
104
107
|
childProcess.on('close', async code => {
|
|
105
108
|
await stdout.close()
|
|
106
109
|
await stderr.close()
|
|
110
|
+
batchItem.statusCode = code
|
|
111
|
+
batchItem.end = new Date()
|
|
107
112
|
if (code !== 0) {
|
|
108
113
|
reject(code)
|
|
109
114
|
} else {
|
|
@@ -116,7 +121,7 @@ const task = async ({ job, id, label, args }) => {
|
|
|
116
121
|
.then(() => {
|
|
117
122
|
output.log('✔️ ', progress.label)
|
|
118
123
|
}, (reason) => {
|
|
119
|
-
++job.
|
|
124
|
+
++job.failed
|
|
120
125
|
output.log('❌', progress.label, reason)
|
|
121
126
|
})
|
|
122
127
|
.finally(() => {
|
|
@@ -135,7 +140,9 @@ async function batch (job) {
|
|
|
135
140
|
* --report-dir is always passed to aggregate reports under one root folder
|
|
136
141
|
*/
|
|
137
142
|
const output = getOutput(job)
|
|
138
|
-
|
|
143
|
+
job.start = new Date()
|
|
144
|
+
job.failed = 0
|
|
145
|
+
job.batchItems = []
|
|
139
146
|
for (const batch of job.batch) {
|
|
140
147
|
output.debug('batch', `processing: ${batch}`)
|
|
141
148
|
// check if path
|
|
@@ -146,9 +153,9 @@ async function batch (job) {
|
|
|
146
153
|
}
|
|
147
154
|
const pathStat = await stat(path)
|
|
148
155
|
if (pathStat.isDirectory()) {
|
|
149
|
-
folder(
|
|
156
|
+
folder(job, path)
|
|
150
157
|
} else if (pathStat.isFile() && extname(path) === '.json') {
|
|
151
|
-
configurationFile(
|
|
158
|
+
configurationFile(job, path)
|
|
152
159
|
} else {
|
|
153
160
|
output.batchFailed(batch, 'only folders and JSON configuration files are supported')
|
|
154
161
|
}
|
|
@@ -171,24 +178,33 @@ async function batch (job) {
|
|
|
171
178
|
const pathStat = await stat(path)
|
|
172
179
|
if (pathStat.isDirectory()) {
|
|
173
180
|
if (re.test(path) || re.test(path.replaceAll('\\', '/'))) {
|
|
174
|
-
folder(
|
|
181
|
+
folder(job, path)
|
|
175
182
|
continue
|
|
176
183
|
}
|
|
177
184
|
await scan(path)
|
|
178
185
|
} else if (pathStat.isFile() && (re.test(path) || re.test(path.replaceAll('\\', '/')))) {
|
|
179
|
-
configurationFile(
|
|
186
|
+
configurationFile(job, path)
|
|
180
187
|
}
|
|
181
188
|
}
|
|
182
189
|
}
|
|
183
190
|
await scan(job.cwd)
|
|
184
191
|
}
|
|
185
|
-
if (batchItems.length) {
|
|
192
|
+
if (job.batchItems.length) {
|
|
186
193
|
job.status = 'Running batch items...'
|
|
187
|
-
await parallelize(task, batchItems, job.parallel)
|
|
188
|
-
// TODO: end command ?
|
|
194
|
+
await parallelize(task.bind(job), job.batchItems, job.parallel)
|
|
189
195
|
} else {
|
|
190
196
|
output.batchFailed(job.batch, 'no match')
|
|
191
197
|
}
|
|
198
|
+
|
|
199
|
+
job.end = new Date()
|
|
200
|
+
job.failed = !!job.failed
|
|
201
|
+
if (job.failed) {
|
|
202
|
+
process.exitCode = -1
|
|
203
|
+
}
|
|
204
|
+
await save(job)
|
|
205
|
+
if (job.endScript) {
|
|
206
|
+
await end(job)
|
|
207
|
+
}
|
|
192
208
|
output.stop()
|
|
193
209
|
return 0
|
|
194
210
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<script id='sap-ui-bootstrap'
|
|
7
|
+
src='https://ui5.sap.com/resources/sap-ui-core.js'
|
|
8
|
+
data-sap-ui-libs='sap.m'
|
|
9
|
+
data-sap-ui-theme='sap_horizon'
|
|
10
|
+
data-sap-ui-compatVersion='edge'>
|
|
11
|
+
</script>
|
|
12
|
+
<style>
|
|
13
|
+
html, body { height: 100%; }
|
|
14
|
+
</style>
|
|
15
|
+
<script>
|
|
16
|
+
sap.ui.require([
|
|
17
|
+
"sap/ui/core/date/UI5Date",
|
|
18
|
+
], function (UI5Date) {
|
|
19
|
+
console.log(UI5Date.getInstance(2025,2,15,23,2,0))
|
|
20
|
+
});
|
|
21
|
+
</script>
|
|
22
|
+
</head>
|
|
23
|
+
<body class='sapUiBody'>
|
|
24
|
+
<pre>TZ=UTC node . --webapp . --url http://localhost:0/src/capabilities/tests/ui5/timezone.html --debug-keep-browser-open -- --visible</pre>
|
|
25
|
+
and check the console
|
|
26
|
+
</body>
|
|
27
|
+
</html>
|
package/src/job.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const { Command, Option, InvalidArgumentError } = require('commander')
|
|
4
4
|
const { statSync, accessSync, constants } = require('fs')
|
|
5
5
|
const { dirname, join, isAbsolute } = require('path')
|
|
6
|
-
const { name, description, version } = require(join(__dirname, '../package.json'))
|
|
6
|
+
const { name, description, version = 'dev' } = require(join(__dirname, '../package.json'))
|
|
7
7
|
const { getOutput } = require('./output')
|
|
8
8
|
const { $valueSources, $remoteOnLegacy } = require('./symbols')
|
|
9
9
|
const { buildAndCheckMode } = require('./job-mode')
|
package/src/output.js
CHANGED
|
@@ -265,7 +265,7 @@ function build (job) {
|
|
|
265
265
|
lines: 0,
|
|
266
266
|
|
|
267
267
|
version: () => {
|
|
268
|
-
const { name, version } = require(join(__dirname, '../package.json'))
|
|
268
|
+
const { name, version = 'dev' } = require(join(__dirname, '../package.json'))
|
|
269
269
|
log(job, p80()`${name}@${version}`)
|
|
270
270
|
if (job.debugDevMode) {
|
|
271
271
|
log(job, p80()`⚠️ Development mode ⚠️`)
|
package/src/start.js
CHANGED
|
@@ -16,8 +16,12 @@ async function start (job) {
|
|
|
16
16
|
|
|
17
17
|
// check if node
|
|
18
18
|
if (command === 'node') {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
let [node] = process.argv
|
|
20
|
+
if (node.includes(' ')) {
|
|
21
|
+
node = `"${node}"`
|
|
22
|
+
}
|
|
23
|
+
output.debug('start', `Replacing node with ${node}`)
|
|
24
|
+
start = [node, ...parameters].join(' ')
|
|
21
25
|
} else {
|
|
22
26
|
// check if existing NPM script
|
|
23
27
|
const packagePath = join(job.cwd, 'package.json')
|