@testomatio/reporter 2.10.0 → 2.10.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/lib/bin/cli.js +6 -3
- package/package.json +1 -1
- package/src/bin/cli.js +6 -3
package/lib/bin/cli.js
CHANGED
|
@@ -56,6 +56,7 @@ program
|
|
|
56
56
|
.option('--kind <type>', 'Specify run type: automated, manual, or mixed')
|
|
57
57
|
.option('--filter <filter>', 'Scope the prepared run to tests matching the filter (no execution)')
|
|
58
58
|
.option('--format <format>', 'Machine-readable output: print only the run id to stdout (e.g. --format id)')
|
|
59
|
+
.option('--warn', 'Exit 0 instead of 1 when the filter matches no tests (warn only)')
|
|
59
60
|
.action(async (opts) => {
|
|
60
61
|
(0, utils_js_1.cleanLatestRunId)();
|
|
61
62
|
log_js_1.log.info('Starting a new Run on Testomat.io...');
|
|
@@ -69,7 +70,8 @@ program
|
|
|
69
70
|
const tests = await client.prepareRun({ pipe, pipeOptions: optsArray.join(':') });
|
|
70
71
|
if (!tests || tests.length === 0) {
|
|
71
72
|
log_js_1.log.warn(picocolors_1.default.yellow('No tests found for the filter. Run not created.'));
|
|
72
|
-
|
|
73
|
+
// --warn treats an empty match as a normal outcome (e.g. a PR touching no mapped files)
|
|
74
|
+
process.exit(opts.warn ? 0 : 1);
|
|
73
75
|
}
|
|
74
76
|
createRunParams.configuration = {
|
|
75
77
|
tests: tests.filter(id => id.startsWith('T')).map(id => id.slice(1)),
|
|
@@ -114,6 +116,7 @@ program
|
|
|
114
116
|
.option('--kind <type>', 'Specify run type: automated, manual, or mixed')
|
|
115
117
|
.option('--remote <profile>', 'Trigger run on the named Testomat.io CI profile instead of executing locally')
|
|
116
118
|
.option('--remote-param <kv>', 'key=value pair forwarded to the CI profile config (repeat for multiple)', (value, prev) => prev.concat([value]), [])
|
|
119
|
+
.option('--warn', 'Exit 0 instead of 1 when the filter matches no tests (warn only)')
|
|
117
120
|
.action(async (command, opts) => {
|
|
118
121
|
if (opts.remote) {
|
|
119
122
|
if (opts.filterList) {
|
|
@@ -144,8 +147,8 @@ program
|
|
|
144
147
|
if (!tests || tests.length === 0) {
|
|
145
148
|
log_js_1.log.warn(picocolors_1.default.yellow('No tests found.'));
|
|
146
149
|
// Exit non-zero on --filter-list so scripts can detect "nothing to run"
|
|
147
|
-
// via $? and skip launching the runner.
|
|
148
|
-
if (opts.filterList)
|
|
150
|
+
// via $? and skip launching the runner. --warn downgrades it to 0.
|
|
151
|
+
if (opts.filterList && !opts.warn)
|
|
149
152
|
process.exit(1);
|
|
150
153
|
return;
|
|
151
154
|
}
|
package/package.json
CHANGED
package/src/bin/cli.js
CHANGED
|
@@ -54,6 +54,7 @@ program
|
|
|
54
54
|
.option('--kind <type>', 'Specify run type: automated, manual, or mixed')
|
|
55
55
|
.option('--filter <filter>', 'Scope the prepared run to tests matching the filter (no execution)')
|
|
56
56
|
.option('--format <format>', 'Machine-readable output: print only the run id to stdout (e.g. --format id)')
|
|
57
|
+
.option('--warn', 'Exit 0 instead of 1 when the filter matches no tests (warn only)')
|
|
57
58
|
.action(async opts => {
|
|
58
59
|
cleanLatestRunId();
|
|
59
60
|
|
|
@@ -69,7 +70,8 @@ program
|
|
|
69
70
|
const tests = await client.prepareRun({ pipe, pipeOptions: optsArray.join(':') });
|
|
70
71
|
if (!tests || tests.length === 0) {
|
|
71
72
|
log.warn(pc.yellow('No tests found for the filter. Run not created.'));
|
|
72
|
-
|
|
73
|
+
// --warn treats an empty match as a normal outcome (e.g. a PR touching no mapped files)
|
|
74
|
+
process.exit(opts.warn ? 0 : 1);
|
|
73
75
|
}
|
|
74
76
|
createRunParams.configuration = {
|
|
75
77
|
tests: tests.filter(id => id.startsWith('T')).map(id => id.slice(1)),
|
|
@@ -127,6 +129,7 @@ program
|
|
|
127
129
|
(value, prev) => prev.concat([value]),
|
|
128
130
|
[],
|
|
129
131
|
)
|
|
132
|
+
.option('--warn', 'Exit 0 instead of 1 when the filter matches no tests (warn only)')
|
|
130
133
|
.action(async (command, opts) => {
|
|
131
134
|
if (opts.remote) {
|
|
132
135
|
if (opts.filterList) {
|
|
@@ -162,8 +165,8 @@ program
|
|
|
162
165
|
if (!tests || tests.length === 0) {
|
|
163
166
|
log.warn( pc.yellow('No tests found.'));
|
|
164
167
|
// Exit non-zero on --filter-list so scripts can detect "nothing to run"
|
|
165
|
-
// via $? and skip launching the runner.
|
|
166
|
-
if (opts.filterList) process.exit(1);
|
|
168
|
+
// via $? and skip launching the runner. --warn downgrades it to 0.
|
|
169
|
+
if (opts.filterList && !opts.warn) process.exit(1);
|
|
167
170
|
return;
|
|
168
171
|
}
|
|
169
172
|
|