Skip to content

Commit 476e523

Browse files
fix: resolve appliance PTY binary from gate environment
1 parent 26f3726 commit 476e523

3 files changed

Lines changed: 15 additions & 16 deletions

File tree

‎crates/plasm-server-pty-tests/tests/tui_pty_quit_smoke.rs‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ use std::time::Duration;
1414
use testty::session::PtySession;
1515

1616
use appliance_boot_support::{
17-
appliance_pty_spawn_env, bin_path, make_appliance_data_root, pick_free_tcp_port, repo_root,
18-
schema_path,
17+
appliance_pty_spawn_env, make_appliance_data_root, pick_free_tcp_port, repo_root, schema_path,
1918
};
2019

2120
const STABLE_FRAME: Duration = Duration::from_secs(2);
2221
const SCREEN_WAIT: Duration = Duration::from_secs(300);
2322
const EXIT_WAIT: Duration = Duration::from_secs(30);
2423

24+
fn bin_path() -> std::path::PathBuf {
25+
std::env::var_os("CARGO_BIN_EXE_plasm_server")
26+
.expect("appliance PTY gate must supply the built plasm-server binary")
27+
.into()
28+
}
29+
2530
#[test]
2631
fn tui_pty_quit_smoke() {
2732
let listen_port = pick_free_tcp_port();
@@ -52,15 +57,9 @@ fn tui_pty_quit_smoke() {
5257
diag_log.display()
5358
);
5459

55-
let mut session = PtySession::spawn_with_size(
56-
&bin_path(),
57-
120,
58-
40,
59-
&args,
60-
&env_pairs,
61-
Some(&repo_root()),
62-
)
63-
.unwrap_or_else(|e| panic!("spawn plasm-server in PTY: {e}"));
60+
let mut session =
61+
PtySession::spawn_with_size(&bin_path(), 120, 40, &args, &env_pairs, Some(&repo_root()))
62+
.unwrap_or_else(|e| panic!("spawn plasm-server in PTY: {e}"));
6463

6564
session
6665
.wait_for_stable_frame(STABLE_FRAME, SCREEN_WAIT)

‎crates/plasm-server/tests/appliance_boot_support.rs‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,6 @@ pub fn schema_path() -> PathBuf {
209209
p
210210
}
211211

212-
pub fn bin_path() -> PathBuf {
213-
PathBuf::from(env!("CARGO_BIN_EXE_plasm-server"))
214-
}
215-
216212
pub fn embedded_pg_temp_parent() -> PathBuf {
217213
#[cfg(target_os = "macos")]
218214
{

‎crates/plasm-server/tests/appliance_headless_boot.rs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ use std::panic::AssertUnwindSafe;
88
use std::process::{Child, Command, Stdio};
99

1010
use appliance_boot_support::{
11-
apply_appliance_test_env, bin_path, make_appliance_data_root, pick_free_tcp_port,
11+
apply_appliance_test_env, make_appliance_data_root, pick_free_tcp_port,
1212
push_appliance_cli_args, repo_root, schema_path, wait_bootstrap_ready,
1313
};
1414

15+
fn bin_path() -> std::path::PathBuf {
16+
env!("CARGO_BIN_EXE_plasm-server").into()
17+
}
18+
1519
fn spawn_headless_appliance() -> (u16, tempfile::TempDir, std::path::PathBuf, Child) {
1620
let listen_port = pick_free_tcp_port();
1721
let schema = schema_path();

0 commit comments

Comments
 (0)