mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-19 08:01:17 +00:00
ci: add Mock Tests job to satisfy required status check (#1904)
* ci: add Mock Tests job to satisfy required status check Split the unit-tests job into mock-tests (runs bun test) and unit-tests (verifies cloud bundles build). The repo ruleset requires "Mock Tests", "Unit Tests", and "Biome Lint" checks — the missing "Mock Tests" job was blocking all PR merges. Fixes #1901 Agent: issue-fixer Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * style: fix pre-existing Biome format issues in 9 files Auto-applied Biome formatter to src/ to resolve failing "Biome Lint" required status check. No logic changes — formatting only. Agent: issue-fixer Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
b2bddc4ba5
commit
9e54f0cf57
10 changed files with 140 additions and 21 deletions
20
.github/workflows/test.yml
vendored
20
.github/workflows/test.yml
vendored
|
|
@ -9,6 +9,23 @@ concurrency:
|
|||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
mock-tests:
|
||||
name: Mock Tests
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: Run mock tests
|
||||
run: bun test
|
||||
|
||||
unit-tests:
|
||||
name: Unit Tests
|
||||
runs-on: ubuntu-latest
|
||||
|
|
@ -23,9 +40,6 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: Run bun tests
|
||||
run: bun test
|
||||
|
||||
- name: Verify cloud bundles build
|
||||
run: bun run packages/cli/build-clouds.ts
|
||||
|
||||
|
|
|
|||
|
|
@ -1100,8 +1100,20 @@ export async function interactiveSession(cmd: string): Promise<number> {
|
|||
const escapedCmd = fullCmd.replace(/'/g, "'\\''");
|
||||
const keyOpts = getSshKeyOpts(await ensureSshKeys());
|
||||
const exitCode = await Bun.spawn(
|
||||
["ssh", ...SSH_INTERACTIVE_OPTS, ...keyOpts, `${SSH_USER}@${instanceIp}`, `bash -c '${escapedCmd}'`],
|
||||
{ stdio: ["inherit", "inherit", "inherit"] },
|
||||
[
|
||||
"ssh",
|
||||
...SSH_INTERACTIVE_OPTS,
|
||||
...keyOpts,
|
||||
`${SSH_USER}@${instanceIp}`,
|
||||
`bash -c '${escapedCmd}'`,
|
||||
],
|
||||
{
|
||||
stdio: [
|
||||
"inherit",
|
||||
"inherit",
|
||||
"inherit",
|
||||
],
|
||||
},
|
||||
).exited;
|
||||
|
||||
// Post-session summary
|
||||
|
|
|
|||
|
|
@ -2724,10 +2724,27 @@ export async function cmdLast(): Promise<void> {
|
|||
// ── Connect ────────────────────────────────────────────────────────────────────
|
||||
|
||||
/** Execute a shell command and resolve/reject on process close/error */
|
||||
async function runInteractiveCommand(cmd: string, args: string[], failureMsg: string, manualCmd: string): Promise<void> {
|
||||
async function runInteractiveCommand(
|
||||
cmd: string,
|
||||
args: string[],
|
||||
failureMsg: string,
|
||||
manualCmd: string,
|
||||
): Promise<void> {
|
||||
let proc: ReturnType<typeof Bun.spawn> | undefined;
|
||||
try {
|
||||
proc = Bun.spawn([cmd, ...args], { stdio: ["inherit", "inherit", "inherit"] });
|
||||
proc = Bun.spawn(
|
||||
[
|
||||
cmd,
|
||||
...args,
|
||||
],
|
||||
{
|
||||
stdio: [
|
||||
"inherit",
|
||||
"inherit",
|
||||
"inherit",
|
||||
],
|
||||
},
|
||||
);
|
||||
} catch (err) {
|
||||
p.log.error(`Failed to connect: ${getErrorMessage(err)}`);
|
||||
p.log.info(`Try manually: ${pc.cyan(manualCmd)}`);
|
||||
|
|
|
|||
|
|
@ -531,7 +531,13 @@ export async function interactiveSession(cmd: string): Promise<number> {
|
|||
fullCmd,
|
||||
];
|
||||
|
||||
const exitCode = await Bun.spawn(args, { stdio: ["inherit", "inherit", "inherit"] }).exited;
|
||||
const exitCode = await Bun.spawn(args, {
|
||||
stdio: [
|
||||
"inherit",
|
||||
"inherit",
|
||||
"inherit",
|
||||
],
|
||||
}).exited;
|
||||
|
||||
// Post-session summary
|
||||
process.stderr.write("\n");
|
||||
|
|
|
|||
|
|
@ -1065,8 +1065,20 @@ export async function interactiveSession(cmd: string, ip?: string): Promise<numb
|
|||
const keyOpts = getSshKeyOpts(await ensureSshKeys());
|
||||
|
||||
const exitCode = await Bun.spawn(
|
||||
["ssh", ...SSH_INTERACTIVE_OPTS, ...keyOpts, `root@${serverIp}`, fullCmd],
|
||||
{ stdio: ["inherit", "inherit", "inherit"] },
|
||||
[
|
||||
"ssh",
|
||||
...SSH_INTERACTIVE_OPTS,
|
||||
...keyOpts,
|
||||
`root@${serverIp}`,
|
||||
fullCmd,
|
||||
],
|
||||
{
|
||||
stdio: [
|
||||
"inherit",
|
||||
"inherit",
|
||||
"inherit",
|
||||
],
|
||||
},
|
||||
).exited;
|
||||
|
||||
// Post-session summary
|
||||
|
|
|
|||
|
|
@ -1019,8 +1019,24 @@ export async function interactiveSession(cmd: string): Promise<number> {
|
|||
const flyCmd = getCmd()!;
|
||||
|
||||
const exitCode = await Bun.spawn(
|
||||
[flyCmd, "ssh", "console", "-a", flyAppName, "--pty", "-C", `bash -c '${escapedCmd}'`],
|
||||
{ stdio: ["inherit", "inherit", "inherit"], env: process.env },
|
||||
[
|
||||
flyCmd,
|
||||
"ssh",
|
||||
"console",
|
||||
"-a",
|
||||
flyAppName,
|
||||
"--pty",
|
||||
"-C",
|
||||
`bash -c '${escapedCmd}'`,
|
||||
],
|
||||
{
|
||||
stdio: [
|
||||
"inherit",
|
||||
"inherit",
|
||||
"inherit",
|
||||
],
|
||||
env: process.env,
|
||||
},
|
||||
).exited;
|
||||
|
||||
// Post-session summary
|
||||
|
|
|
|||
|
|
@ -919,8 +919,21 @@ export async function interactiveSession(cmd: string): Promise<number> {
|
|||
const keyOpts = getSshKeyOpts(await ensureSshKeys());
|
||||
|
||||
const exitCode = await Bun.spawn(
|
||||
["ssh", ...SSH_INTERACTIVE_OPTS, ...keyOpts, `${username}@${gcpServerIp}`, `bash -c ${shellQuote(fullCmd)}`],
|
||||
{ stdio: ["inherit", "inherit", "inherit"], env: process.env },
|
||||
[
|
||||
"ssh",
|
||||
...SSH_INTERACTIVE_OPTS,
|
||||
...keyOpts,
|
||||
`${username}@${gcpServerIp}`,
|
||||
`bash -c ${shellQuote(fullCmd)}`,
|
||||
],
|
||||
{
|
||||
stdio: [
|
||||
"inherit",
|
||||
"inherit",
|
||||
"inherit",
|
||||
],
|
||||
env: process.env,
|
||||
},
|
||||
).exited;
|
||||
|
||||
// Post-session summary
|
||||
|
|
|
|||
|
|
@ -632,8 +632,20 @@ export async function interactiveSession(cmd: string, ip?: string): Promise<numb
|
|||
const keyOpts = getSshKeyOpts(await ensureSshKeys());
|
||||
|
||||
const exitCode = await Bun.spawn(
|
||||
["ssh", ...SSH_INTERACTIVE_OPTS, ...keyOpts, `root@${serverIp}`, fullCmd],
|
||||
{ stdio: ["inherit", "inherit", "inherit"] },
|
||||
[
|
||||
"ssh",
|
||||
...SSH_INTERACTIVE_OPTS,
|
||||
...keyOpts,
|
||||
`root@${serverIp}`,
|
||||
fullCmd,
|
||||
],
|
||||
{
|
||||
stdio: [
|
||||
"inherit",
|
||||
"inherit",
|
||||
"inherit",
|
||||
],
|
||||
},
|
||||
).exited;
|
||||
|
||||
// Post-session summary
|
||||
|
|
|
|||
|
|
@ -70,10 +70,21 @@ export function uploadFile(localPath: string, remotePath: string): void {
|
|||
|
||||
/** Launch an interactive shell session locally. */
|
||||
export async function interactiveSession(cmd: string): Promise<number> {
|
||||
return Bun.spawn(["bash", "-c", cmd], {
|
||||
stdio: ["inherit", "inherit", "inherit"],
|
||||
env: process.env,
|
||||
}).exited;
|
||||
return Bun.spawn(
|
||||
[
|
||||
"bash",
|
||||
"-c",
|
||||
cmd,
|
||||
],
|
||||
{
|
||||
stdio: [
|
||||
"inherit",
|
||||
"inherit",
|
||||
"inherit",
|
||||
],
|
||||
env: process.env,
|
||||
},
|
||||
).exited;
|
||||
}
|
||||
|
||||
// ─── Connection Tracking ─────────────────────────────────────────────────────
|
||||
|
|
|
|||
|
|
@ -584,7 +584,13 @@ export async function interactiveSession(cmd: string): Promise<number> {
|
|||
cmd,
|
||||
];
|
||||
|
||||
const exitCode = await Bun.spawn(args, { stdio: ["inherit", "inherit", "inherit"] }).exited;
|
||||
const exitCode = await Bun.spawn(args, {
|
||||
stdio: [
|
||||
"inherit",
|
||||
"inherit",
|
||||
"inherit",
|
||||
],
|
||||
}).exited;
|
||||
|
||||
// Post-session summary
|
||||
process.stderr.write("\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue