cockpit.js: add new cockpit.exec() API#23251
Conversation
We build qunit and pkg builds in parallel and weren't properly cleaning up the "other" task when one of them failed. Cancel both on error and collect both sides using `Promise.allSettled()` (which never raises).
Assisted-by: Claude Opus 4.6 <noreply@anthropic.com>
Assisted-by: Claude Opus 4.6 <noreply@anthropic.com>
cockpituous
left a comment
There was a problem hiding this comment.
There are more than 10 code coverage comments, see the full report here.
cockpituous
left a comment
There was a problem hiding this comment.
There are more than 10 code coverage comments, see the full report here.
cockpituous
left a comment
There was a problem hiding this comment.
There are more than 10 code coverage comments, see the full report here.
| }); | ||
|
|
||
| const now = parseInt(await cockpit.spawn(["date", "+%s"]), 10); | ||
| const now = parseInt(await cockpit.exec("date", [], ["+%s"]), 10); |
There was a problem hiding this comment.
This added line is not executed by any test. Details
| this.date_spawn = cockpit.exec("date", | ||
| [`--date=${new Intl.DateTimeFormat('en-us').format(this.state.dateObject)} ${this.state.time}`], | ||
| ["+%s"], { err: "message" }); |
There was a problem hiding this comment.
These 3 added lines are not executed by any test. Details
| cockpit.is_not_flag = function is_not_flag(s) { | ||
| const c = s.charCodeAt(0); | ||
| return c >= 0x20 && c <= 0x7e && c !== 0x2d; |
There was a problem hiding this comment.
These 3 added lines are not executed by any test. Details
| const timeout = window.setTimeout(() => { | ||
| failure = _("Prompting via ssh-add timed out"); | ||
| proc.close("terminated"); | ||
| }, 10 * 1000); |
There was a problem hiding this comment.
These 4 added lines are not executed by any test. Details
|
|
||
| if (key.name && !key.agent_only) | ||
| await cockpit.spawn(["ssh-add", "-d", key.name], options); | ||
| await cockpit.exec("ssh-add", ["-d"], [key.name], { pty: true, err: "message", directory: this.path }); |
There was a problem hiding this comment.
This added line is not executed by any test. Details
|
|
||
| if (options.directory) | ||
| cmd.push("--directory=" + options.directory); | ||
| opts.push(`--directory=${options.directory}`); |
There was a problem hiding this comment.
This added line is not executed by any test. Details
| opts.push(`--directory=${options.directory}`); | ||
| if (options.boot) | ||
| cmd.push("--boot=" + options.boot); | ||
| opts.push(`--boot=${options.boot}`); |
There was a problem hiding this comment.
This added line is not executed by any test. Details
| opts.push(`--boot=${options.boot}`); | ||
| else if (options.boot !== undefined) | ||
| cmd.push("--boot"); | ||
| opts.push("--boot"); |
There was a problem hiding this comment.
This added line is not executed by any test. Details
| opts.push(`--cursor=${options.cursor}`); | ||
| if (options.after) | ||
| cmd.push("--after=" + options.after); | ||
| opts.push(`--after=${options.after}`); |
There was a problem hiding this comment.
This added line is not executed by any test. Details
| opts.push(`--priority=${options.priority}`); | ||
| if (options.grep) | ||
| cmd.push("--grep=" + options.grep); | ||
| opts.push(`--grep=${options.grep}`); |
There was a problem hiding this comment.
This added line is not executed by any test. Details
No description provided.