Skip to content

cockpit.js: add new cockpit.exec() API#23251

Draft
allisonkarlitskaya wants to merge 3 commits into
cockpit-project:mainfrom
allisonkarlitskaya:exec
Draft

cockpit.js: add new cockpit.exec() API#23251
allisonkarlitskaya wants to merge 3 commits into
cockpit-project:mainfrom
allisonkarlitskaya:exec

Conversation

@allisonkarlitskaya
Copy link
Copy Markdown
Member

No description provided.

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>
Copy link
Copy Markdown
Contributor

@cockpituous cockpituous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are more than 10 code coverage comments, see the full report here.

Copy link
Copy Markdown
Contributor

@cockpituous cockpituous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are more than 10 code coverage comments, see the full report here.

Copy link
Copy Markdown
Contributor

@cockpituous cockpituous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test. Details

Comment on lines +110 to +112
this.date_spawn = cockpit.exec("date",
[`--date=${new Intl.DateTimeFormat('en-us').format(this.state.dateObject)} ${this.state.time}`],
["+%s"], { err: "message" });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 3 added lines are not executed by any test. Details

Comment thread pkg/lib/cockpit.js
Comment on lines +1234 to +1236
cockpit.is_not_flag = function is_not_flag(s) {
const c = s.charCodeAt(0);
return c >= 0x20 && c <= 0x7e && c !== 0x2d;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 3 added lines are not executed by any test. Details

Comment thread pkg/lib/credentials.ts
Comment on lines +276 to +279
const timeout = window.setTimeout(() => {
failure = _("Prompting via ssh-add timed out");
proc.close("terminated");
}, 10 * 1000);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 4 added lines are not executed by any test. Details

Comment thread pkg/lib/credentials.ts

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 });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test. Details

Comment thread pkg/lib/journal.js

if (options.directory)
cmd.push("--directory=" + options.directory);
opts.push(`--directory=${options.directory}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test. Details

Comment thread pkg/lib/journal.js
opts.push(`--directory=${options.directory}`);
if (options.boot)
cmd.push("--boot=" + options.boot);
opts.push(`--boot=${options.boot}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test. Details

Comment thread pkg/lib/journal.js
opts.push(`--boot=${options.boot}`);
else if (options.boot !== undefined)
cmd.push("--boot");
opts.push("--boot");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test. Details

Comment thread pkg/lib/journal.js
opts.push(`--cursor=${options.cursor}`);
if (options.after)
cmd.push("--after=" + options.after);
opts.push(`--after=${options.after}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test. Details

Comment thread pkg/lib/journal.js
opts.push(`--priority=${options.priority}`);
if (options.grep)
cmd.push("--grep=" + options.grep);
opts.push(`--grep=${options.grep}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test. Details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants