Skip to content

changes_widget_end_to_end whole-screen bullet scan fails when ambient credentials render the auth inventory dot #1669

Description

@alecuba16

Summary

tui::app::tests::changes_widget_end_to_end_on_real_git_repo ends with a whole-screen assertion:

assert!(!frame2.contains('●'), "{frame2}");

The intent is "no agent-edit dot without agent edits", but ● is also the header auth inventory's Available-state dot (auth_dot_char in ui_header.rs renders ● openrouter when OpenRouter credentials exist). The scan is over the entire frame, so the test fails on any machine whose ambient env makes has_openrouter_credentials() true, e.g. a JCODE_OPENROUTER_ALLOW_NO_AUTH gateway profile or a saved key.

Repro

JCODE_OPENROUTER_ALLOW_NO_AUTH=1 cargo test -p jcode-tui --lib -- --test-threads=1 \
  tui::app::auth::tests changes_widget_end_to_end_on_real_git_repo

Fails on current master (verified at 2df1f77): the auth tests write compat credentials into the shared test home, the changes widget's second frame then renders ● openrouter in the header, and the whole-screen scan trips. Each test passes alone; the pair fails. CI never sees it because the CI env has no credentials.

Fix

Scope the no-dot scan to the Changes widget's file rows, same direction as #1556 for other whole-screen scans:

let changes_rows: Vec<&str> = frame2.lines()
    .filter(|l| ["src/lib.rs", "new.rs", "logo.bin", "new_name.rs", "gone.txt"]
        .iter().any(|f| l.contains(f)))
    .collect();
assert!(changes_rows.iter().all(|l| !l.contains('●')), "{frame2}");

Verified green locally with ambient credentials set.

Related: #978 (ambient env breaking tests on machines with provider profiles).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions