test: stabilize native identity and settings fixtures

Keep the owned GUI test executable attached to its CMD or PowerShell parent, control the font layout fixture independently of host preferences, and gate the exit-prompt UI test on GPUI test support.
This commit is contained in:
kuddev committed 2026-09-21 19:53:06 +08:00
1 parent 8564334d66
commit 927a2c425d
3 files changed
+20 -9

No files matched your search

@@ -612,9 +612,12 @@ mod interaction_tests {
) {
cx.update(|cx| {
gpui_component::init(cx);
cx.set_global(crate::gpui_shell::config::Settings::load(
nebula_settings::ThemeName::Nord,
));
let mut settings =
crate::gpui_shell::config::Settings::load(nebula_settings::ThemeName::Nord);
// This layout fixture controls its font chain; installed/user
// preferences must not decide its expected field contents.
settings.font_family = REQUIRED_FONT_FAMILY.to_owned();
cx.set_global(settings);
});
let mut pane = None;
let (_, cx) = cx.add_window_view(|window, cx| {
@@ -642,7 +645,11 @@ mod interaction_tests {
);
assert_eq!(
pane.read_with(cx, |pane, cx| pane.font_family_cjk_input.read(cx).value().to_string()),
REQUIRED_FONT_FAMILY
pane.read_with(cx, |pane, _| pane
.runtime
.font_family_cjk
.clone()
.unwrap_or_else(|| REQUIRED_FONT_FAMILY.to_owned()))
);
let bounds =
cx.debug_bounds("font-picker-chevron").expect("font field exposes a dropdown arrow");
@@ -205,7 +205,7 @@ pub(super) async fn wait_for_session_ids(
}
}
#[cfg(test)]
#[cfg(all(test, feature = "gpui-test-support"))]
mod tests {
use super::*;
use gpui::TestAppContext;
@@ -57,14 +57,18 @@ impl Fixture {
"-NoProfile",
"-NonInteractive",
"-Command",
&format!("& $env:PEBREL_TEST_ROLLOUT_EXE --exact {HOLDER} --nocapture"),
&format!("& $env:PEBREL_TEST_ROLLOUT_EXE --exact {HOLDER} --nocapture | Out-Null"),
]);
command
} else {
let mut command = Command::new("cmd.exe");
command
.args(["/d", "/s", "/c"])
.raw_arg(format!("\"\"{}\" --exact {HOLDER} --nocapture\"", executable.display()));
// The product test binary is a GUI executable. Unlike real Codex,
// CMD will not wait for it implicitly, so keep this shell alive
// explicitly until the owned stand-in exits.
command.args(["/d", "/s", "/c"]).raw_arg(format!(
"start \"\" /b /wait \"{}\" --exact {HOLDER} --nocapture",
executable.display()
));
command
};
command