@botiverse/testbed-cli 0.2.0 → 0.3.0

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.
Files changed (2) hide show
  1. package/lib/main.mjs +10 -2
  2. package/package.json +1 -1
package/lib/main.mjs CHANGED
@@ -32,6 +32,7 @@ export const USAGE = `testbed — cloud phones + the acceptance testbed in the R
32
32
 
33
33
  testbed cases acceptance case library
34
34
  testbed run <case-id...> [--app --ref --apk --apk-run --release --by]
35
+ testbed run --all [...] the whole case table in one run (release smoke)
35
36
  testbed runs
36
37
  testbed show <run-id>
37
38
 
@@ -266,8 +267,15 @@ export async function main(argv, opts) {
266
267
  const apkRun = takeFlag(args, "apk-run");
267
268
  const release = takeFlag(args, "release");
268
269
  const by = takeFlag(args, "by", env.USER || "testbed-cli");
269
- const caseIds = args.filter((a) => !a.startsWith("--"));
270
- if (!caseIds.length) throw new Error("usage: testbed run <case-id...> [--app slug] [--ref branch] [--apk url] [--apk-run ci-run-id] [--release id]");
270
+ const all = takeSwitch(args, "all");
271
+ let caseIds = args.filter((a) => !a.startsWith("--"));
272
+ if (all) {
273
+ if (caseIds.length) throw new Error("usage: --all takes no case ids");
274
+ const cat = await api("GET", "/cases");
275
+ caseIds = cat.cases.map((c) => c.id);
276
+ if (!caseIds.length) throw new Error("the case table is empty");
277
+ }
278
+ if (!caseIds.length) throw new Error("usage: testbed run <case-id...> | --all [--app slug] [--ref branch] [--apk url] [--apk-run ci-run-id] [--release id] [--by name]");
271
279
  const d = await api("POST", "/runs", { app_slug: app, case_ids: caseIds, apk_ref: apk, ref, apk_run_id: apkRun, hands_release_id: release, requested_by: by });
272
280
  emit(d, () => { out(`run ${d.run_id} — ${d.cases} case(s), ${d.dispatched} dispatched`); out(`${auth.apiBase}/runs/${d.run_id}`); });
273
281
  return exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botiverse/testbed-cli",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "CLI for testbed \u2014 cloud phones and the acceptance testbed in the Raft release loop",
5
5
  "license": "MIT",
6
6
  "type": "module",