Skip to content

test(runtime): cover subprocess execution failures - #6854

Open
chenrui333 wants to merge 1 commit into
mainfrom
test/subprocess-failure-coverage
Open

test(runtime): cover subprocess execution failures#6854
chenrui333 wants to merge 1 commit into
mainfrom
test/subprocess-failure-coverage

Conversation

@chenrui333

Copy link
Copy Markdown
Member

What

Cover command output and typed errors on subprocess execution and startup failures.

Why

A regression could discard stderr or the exit cause while existing happy-path tests still passed.

Testing

Focused subprocess cases and the full models package pass with -race and coverage.

Copilot AI lite review requested due to automatic review settings September 7, 2026 06:46
@github-actions github-actions Bot added size/s go Pull requests that update Go code labels Sep 7, 2026

Copilot AI left a comment

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.

🟡 Changes recommended

The new test uses a non-existent errors.AsType helper and will not compile without switching to errors.As.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds regression coverage in the runtime command runner tests to ensure subprocess startup/exit failures preserve both combined output (stdout+stderr) and typed error causes, preventing regressions where stderr or exit information is lost.

Changes:

  • Add test coverage for non-zero exit handling (including preserving stdout/stderr output).
  • Add test coverage for command start failures (missing executable / missing working directory) and verify error context.
File summaries
File Description
server/core/runtime/models/shell_command_runner_test.go Adds tests for subprocess exit/start failure cases to validate output capture and error typing/context.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread server/core/runtime/models/shell_command_runner_test.go
@github-code-quality

github-code-quality Bot commented Sep 7, 2026

Copy link
Copy Markdown

Code Coverage Overview

Languages: Go

Go / code-coverage/go

The overall line coverage in commit 3a876bd in the test/subprocess-fail... branch is 73%. Line coverage data for the main branch is not yet available.

Show a line coverage summary of the most covered files.
File main test/subprocess-fail... 3a876bd +/-
server/events/v...ithub/client.go 88%
server/core/ter...aform_client.go 88%
server/controll...i_controller.go 83%
server/events/p...mand_builder.go 83%
server/events/v...itlab/client.go 80%
server/events/p...mmand_runner.go 76%
server/events/event_parser.go 76%
server/events/working_dir.go 73%
server/server.go 70%
server/controll...s_controller.go 64%

Updated September 08, 2026 00:02 UTC

@chenrui333
chenrui333 force-pushed the test/subprocess-failure-coverage branch from 0d824d1 to e593ce4 Compare September 7, 2026 09:16
Verify both command runners retain stdout, stderr, and typed exit errors. Cover missing executables and working directories with real subprocess boundaries and temporary paths.

Assisted-by: OpenAI
Signed-off-by: Rui Chen <rui@chenrui.dev>
@chenrui333
chenrui333 force-pushed the test/subprocess-failure-coverage branch from e593ce4 to 3a876bd Compare September 7, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants