Skip to content

Conversation

@tavaresgmg
Copy link

Description

Relocated cli_stream integration tests from codex-core to codex-cli.

Motivation

Tests in codex-core were failing in clean environments because they relied on the codex binary being present (via cargo_bin("codex")), but cargo test -p codex-core does not automatically build the codex-cli binary.

Moving these tests to codex-cli ensures the binary is built as part of the test lifecycle, resolving CI/local dev failures and "binary not found" panics.

Changes

  • Moved codex-rs/core/tests/suite/cli_stream.rs to codex-rs/cli/tests/cli_stream.rs.
  • Updated codex-rs/cli/Cargo.toml with necessary dev-dependencies (wiremock, uuid, etc.).
  • Adjusted fixture paths in the test file to be relative to the new location.

Verification

  • Ran cargo test -p codex-cli --test cli_stream successfully.
  • Verified binary resolution works correctly in the new location.

guilhermetavaresmimo and others added 4 commits January 15, 2026 14:53
Moved find_codex_home from codex-core (and duplicated in rmcp-client) to a new shared utility crate codex-utils-home. This resolves a TODO regarding code duplication and dependency structure.
Moved integration tests that depend on the codex binary from codex-core to codex-cli. This fixes test failures in clean environments where the binary was not yet built.
@etraut-openai
Copy link
Collaborator

@codex review

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9fda7200bb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

fn cli_responses_fixture() -> std::path::PathBuf {
#[expect(clippy::expect_used)]
find_resource!("tests/cli_responses_fixture.sse").expect("failed to resolve fixture path")
find_resource!("../core/tests/cli_responses_fixture.sse").expect("failed to resolve fixture path")
Copy link
Contributor

Choose a reason for hiding this comment

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

P2 Badge Add the fixture to Bazel test runfiles

In Cargo this relative path works, but under Bazel find_resource! resolves from RUNFILES_DIR + BAZEL_PACKAGE. The codex_rust_crate macro only adds tests/** as data for integration tests, and codex-rs/cli/BUILD.bazel doesn’t add extra test data, so ../core/tests/cli_responses_fixture.sse won’t be present in runfiles. When RUNFILES_DIR is set, the test will fail trying to read a non-existent file. Consider copying the fixture into codex-rs/cli/tests or adding the core fixture file to the CLI test’s data list.

Useful? React with 👍 / 👎.

@etraut-openai
Copy link
Collaborator

@tavaresgmg, please see the code review comment from Codex.

@etraut-openai etraut-openai added the needs-response Additional information is requested label Jan 16, 2026
@etraut-openai
Copy link
Collaborator

Closing because of lack of response from contributor

@etraut-openai etraut-openai removed the needs-response Additional information is requested label Jan 20, 2026
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.

3 participants