Skip to content

Add a goosed over HTTP integration test, and test the developer tool PATH#7178

Merged
jamadeo merged 41 commits intomainfrom
goosed-http-integration-tests
Feb 13, 2026
Merged

Add a goosed over HTTP integration test, and test the developer tool PATH#7178
jamadeo merged 41 commits intomainfrom
goosed-http-integration-tests

Conversation

@jamadeo
Copy link
Collaborator

@jamadeo jamadeo commented Feb 12, 2026

A test that starts goosed an issues HTTP requests to it using the generated typescript SDK

The prompt was

I want to set up a new test suite. It will test the 'goosed' binary in the rust project, but it will do so via the client API in ui/desktop. Can you set this up for me? I'd imagine it would be a new run target in package.json, and I'll write tests in typescript that issue requets directly to a running goosed process

Copilot AI review requested due to automatic review settings February 12, 2026 14:56

// ... tests
});
```
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

there's a bunch of unnecessary content in the README, I'll clean that up

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR scaffolds integration tests for the goosed binary, enabling HTTP requests via the auto-generated TypeScript API client. The test suite spawns a real goosed process, waits for it to be ready, and issues requests to verify the server works correctly end-to-end.

Changes:

  • Created a new Vitest integration config for tests that spawn real processes
  • Implemented test setup utilities for spawning and managing goosed processes
  • Added initial integration tests covering status, configuration, and provider endpoints
  • Added comprehensive README documentation for writing integration tests
  • Added npm scripts for running integration tests

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ui/desktop/vitest.integration.config.ts Separate Vitest config for integration tests using Node environment with 30s timeouts
ui/desktop/tests/integration/setup.ts Test utilities for spawning goosed, managing process lifecycle, and creating authenticated API clients
ui/desktop/tests/integration/goosed.test.ts Initial integration tests covering status, config, and provider endpoints
ui/desktop/tests/integration/README.md Documentation for writing integration tests, including setup instructions and examples
ui/desktop/package.json Added npm scripts for running integration tests in different modes

Copy link
Collaborator

@DOsinga DOsinga left a comment

Choose a reason for hiding this comment

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

great. I think we can delete the README since it is more about the goose plan and then setup.ts could use more of main.ts, but other than that, this is very good

@@ -0,0 +1,178 @@
/**
Copy link
Collaborator

Choose a reason for hiding this comment

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

this could re-use a lot from main (and by way of that, also test it), like starting goosed etc

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

goose made a little bit of a mess of this on first try, but I think it's in a good place now. Now the only bits specific to the test setup are the temp root and config creation, everything else is used from goosed.ts

let portCounter = 13100;

function getNextPort(): number {
return portCounter++;
Copy link
Collaborator

Choose a reason for hiding this comment

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

in main I think we actually find a free port?

Copilot AI review requested due to automatic review settings February 12, 2026 16:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 8 comments.

Comments suppressed due to low confidence (1)

ui/desktop/src/utils/tests/parameterSubstitution.test.ts:5

  • The outer describe('providerUtils', ...) no longer matches the module under test (now parameterSubtitution/substituteParameters); updating the describe label will make failures easier to interpret.

Comment on lines 38 to 43
const possiblePaths = [
path.join(process.cwd(), 'src', 'bin', 'goosed'),
path.join(process.cwd(), 'bin', 'goosed'),
path.join(process.cwd(), '..', '..', 'target', 'debug', 'goosed'),
path.join(process.cwd(), '..', '..', 'target', 'release', 'goosed'),
];
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

findGoosedBinary() only checks for goosed (no extension), so it will fail on Windows where the binary is typically goosed.exe; consider appending .exe when process.platform === 'win32' (or checking both variants for each candidate path).

Copilot uses AI. Check for mistakes.
Comment on lines 142 to 148
goosedProcess.kill('SIGTERM');

// Force kill after timeout
setTimeout(() => {
if (!goosedProcess.killed) {
goosedProcess.kill('SIGKILL');
}
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

goosedProcess.kill('SIGTERM')/SIGKILL are not supported consistently on Windows and can cause cleanup to hang; consider using a platform-specific termination strategy (e.g., kill() without a signal on Windows, or taskkill) similar to ui/desktop/src/goosed.ts.

Copilot uses AI. Check for mistakes.
@jamadeo jamadeo changed the title Scaffold a goosed integration test Add a goosed over HTTP integration test, and test the developer tool PATH Feb 12, 2026
Copilot AI review requested due to automatic review settings February 12, 2026 17:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Copilot AI review requested due to automatic review settings February 12, 2026 19:26
PATH: string;
GOOSE_PORT: string;
GOOSE_SERVER__SECRET_KEY?: string;
// Configuration for external goosed server

Check failure

Code scanning / Semgrep OSS

Command Injection via child_process Error

Command Injection via child_process
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.

Comment on lines 66 to 69
const goosedProcess = spawn(goosedPath, ['agent'], {
env: { ...process.env, ...env },
stdio: ['pipe', 'pipe', 'pipe'],
});
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

spawn(goosedPath, ...) will crash if goosedPath is null; handle the not-found case explicitly (e.g., throw with a helpful message listing searched paths / the override env var).

Copilot uses AI. Check for mistakes.
if (isWindows && goosedProcess.unref) {
goosedProcess.unref();
}
const goosedProcess = spawn(goosedPath, [], spawnOptions);
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

goosed requires the agent subcommand (see crates/goose-server/src/main.rs), but this spawns it with no args, so it will exit immediately with a usage error; pass ['agent'] here to actually start the HTTP server.

Suggested change
const goosedProcess = spawn(goosedPath, [], spawnOptions);
const goosedProcess = spawn(goosedPath, ['agent'], spawnOptions);

Copilot uses AI. Check for mistakes.
}

try {
await status({ client });
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

status({ client }) won’t throw on non-2xx responses unless throwOnError: true is set, so this can report the server as “ready” even if /status is returning an error payload; pass throwOnError: true (or explicitly check response.ok) inside the polling loop.

Suggested change
await status({ client });
await status({ client, throwOnError: true });

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings February 13, 2026 15:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Copilot AI review requested due to automatic review settings February 13, 2026 16:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.

Comment on lines +496 to +499
app.on('will-quit', async () => {
log.info('App quitting, terminating goosed server');
await goosedResult.cleanup();
});
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The app.on('will-quit') handler is registered inside createChat, which can be called multiple times (once per window). This will register multiple cleanup handlers that all try to kill the same goosed process. Consider tracking goosed processes globally and cleaning them up once, or deregistering old handlers when new ones are added.

Copilot uses AI. Check for mistakes.
Comment on lines 97 to 102
const serverReady = await checkServerStatus(client, errorLog);
if (!serverReady) {
baseCleanup();
console.error('Server stderr:', errorLog.join('\n'));
throw new Error('Failed to start goosed');
}
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

If checkServerStatus fails at line 97, baseCleanup is called at line 99 but tempDir is not removed. This leaves temporary directories behind on test failures. Consider wrapping the cleanup in a try-finally or calling the full cleanup function instead of just baseCleanup.

Copilot uses AI. Check for mistakes.
@jamadeo jamadeo added this pull request to the merge queue Feb 13, 2026
Merged via the queue into main with commit 5ba5b98 Feb 13, 2026
19 checks passed
@jamadeo jamadeo deleted the goosed-http-integration-tests branch February 13, 2026 19:51
katzdave added a commit that referenced this pull request Feb 13, 2026
…ntext

* 'main' of github.com:block/goose:
  Move platform extensions into their own folder (#7210)
  fix: ignore deprecated skills extension (#7139)
  Add a goosed over HTTP integration test, and test the developer tool PATH (#7178)
michaelneale added a commit that referenced this pull request Feb 16, 2026
* origin/main: (42 commits)
  fix: use dynamic port for Tetrate auth callback server (#7228)
  docs: removing LLM Usage admonitions (#7227)
  feat(otel): respect standard OTel env vars for exporter selection (#7144)
  fix: fork session (#7219)
  Bump version numbers for 1.24.0 release (#7214)
  Move platform extensions into their own folder (#7210)
  fix: ignore deprecated skills extension (#7139)
  Add a goosed over HTTP integration test, and test the developer tool PATH (#7178)
  feat: add onFallbackRequest handler to McpAppRenderer (#7208)
  feat: add streaming support for Claude Code CLI provider (#6833)
  fix: The detected filetype is PLAIN_TEXT, but the provided filetype was HTML (#6885)
  Add prompts (#7212)
  Add testing instructions for speech to text (#7185)
  Diagnostic files copying (#7209)
  fix: allow concurrent tool execution within the same MCP extension (#7202)
  fix: handle missing arguments in MCP tool calls to prevent GUI crash (#7143)
  Filter Apps page to only show standalone Goose Apps (#6811)
  opt: use static for Regex (#7205)
  nit: show dir in title, and less... jank (#7138)
  feat(gemini-cli): use stream-json output and re-use session (#7118)
  ...
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