Skip to content

test(core): move prompt debug coverage to integration suite#18916

Merged
bolinfest merged 1 commit intomainfrom
pr18916
Apr 22, 2026
Merged

test(core): move prompt debug coverage to integration suite#18916
bolinfest merged 1 commit intomainfrom
pr18916

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 22, 2026

Why

build_prompt_input now initializes ExecServerRuntimePaths, which requires a configured Codex executable path. The previous inline unit test in core/src/prompt_debug.rs built a bare test_config() and then failed before it could assert anything useful:

Codex executable path is not configured

This coverage is also integration-shaped: it drives the public build_prompt_input entry point through config, thread, and session setup rather than testing a small internal helper in isolation.

Bazel CI did not catch this earlier because the affected test was behind the same wrapped Rust unit-test path fixed by #18913. Before that launcher/sharding fix, the outer workspace_root_test changed the working directory for Insta compatibility while the inner rules_rust sharding wrapper still expected its runfiles working directory. In practice, Bazel could report success without executing the Rust test cases in that shard. Once #18913 makes the wrapper run the Rust test binary directly and shard with libtest arguments, this stale unit test actually runs and exposes the missing codex_self_exe setup.

What Changed

  • Moved build_prompt_input_includes_context_and_user_message out of core/src/prompt_debug.rs.
  • Added core/tests/suite/prompt_debug_tests.rs and registered it from core/tests/suite/mod.rs.
  • Builds the test config with ConfigBuilder and provides codex_self_exe using the current test executable, matching the runtime-path invariant required by prompt debug setup.
  • Preserves the existing assertions that the generated prompt input includes both the debug user message and project-specific user instructions.

Verification

  • cargo test -p codex-core --test all prompt_debug_tests::build_prompt_input_includes_context_and_user_message
  • bazel test //codex-rs/core:core-all-test --test_arg=prompt_debug_tests::build_prompt_input_includes_context_and_user_message --test_output=errors

Stack created with Sapling. Best reviewed with ReviewStack.

@bolinfest bolinfest requested a review from a team as a code owner April 22, 2026 00:43
@bolinfest bolinfest changed the title fix build_prompt_input_includes_context_and_user_message test(core): move prompt debug coverage to integration suite Apr 22, 2026
Copy link
Copy Markdown
Contributor

@starr-openai starr-openai left a comment

Choose a reason for hiding this comment

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

thanks!

@bolinfest bolinfest enabled auto-merge (squash) April 22, 2026 00:56
@bolinfest bolinfest merged commit e18fe7a into main Apr 22, 2026
25 checks passed
@bolinfest bolinfest deleted the pr18916 branch April 22, 2026 01:08
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants