Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasLYang committed Sep 10, 2024
1 parent 9d9c7d3 commit 9695c8a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
14 changes: 7 additions & 7 deletions crates/turborepo-lib/src/run/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ impl Run {
}

pub fn start_ui(&self) -> UIResult<UISender> {
// Print prelude here as this needs to happen before the UI is started
if self.should_print_prelude {
self.print_run_prelude();
}

match self.opts.run_opts.ui_mode {
UIMode::Tui => self
.start_terminal_ui()
Expand All @@ -222,7 +227,7 @@ impl Run {
.map(|res| res.map(|(sender, handle)| (UISender::Wui(sender), handle))),
}
}
pub fn start_web_ui(&self) -> WuiResult {
fn start_web_ui(&self) -> WuiResult {
let (tx, rx) = tokio::sync::mpsc::unbounded_channel();

let handle = tokio::spawn(turborepo_ui::wui::server::start_server(rx));
Expand All @@ -231,12 +236,7 @@ impl Run {
}

#[allow(clippy::type_complexity)]
pub fn start_terminal_ui(&self) -> TuiResult {
// Print prelude here as this needs to happen before the UI is started
if self.should_print_prelude {
self.print_run_prelude();
}

fn start_terminal_ui(&self) -> TuiResult {
if !self.should_start_ui()? {
return Ok(None);
}
Expand Down
2 changes: 1 addition & 1 deletion turborepo-tests/integration/tests/no-args.t
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Make sure exit code is 2 when no args are passed
--heap <HEAP>
Specify a file to save a pprof heap profile
--ui <UI>
Specify whether to use the streaming UI or TUI [possible values: tui, stream]
Specify whether to use the streaming UI or TUI [possible values: tui, stream, web]
--login <LOGIN>
Override the login endpoint
--no-color
Expand Down
11 changes: 6 additions & 5 deletions turborepo-tests/integration/tests/turbo-help.t
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Test help flag
--heap <HEAP>
Specify a file to save a pprof heap profile
--ui <UI>
Specify whether to use the streaming UI or TUI [possible values: tui, stream]
Specify whether to use the streaming UI or TUI [possible values: tui, stream, web]
--login <LOGIN>
Override the login endpoint
--no-color
Expand Down Expand Up @@ -171,6 +171,7 @@ Test help flag
Possible values:
- tui: Use the terminal user interface
- stream: Use the standard output stream
- web: Use the web user interface (experimental)

--login <LOGIN>
Override the login endpoint
Expand Down Expand Up @@ -344,7 +345,7 @@ Test help flag for link command
--heap <HEAP>
Specify a file to save a pprof heap profile
--ui <UI>
Specify whether to use the streaming UI or TUI [possible values: tui, stream]
Specify whether to use the streaming UI or TUI [possible values: tui, stream, web]
--login <LOGIN>
Override the login endpoint
--no-color
Expand Down Expand Up @@ -392,7 +393,7 @@ Test help flag for unlink command
--heap <HEAP>
Specify a file to save a pprof heap profile
--ui <UI>
Specify whether to use the streaming UI or TUI [possible values: tui, stream]
Specify whether to use the streaming UI or TUI [possible values: tui, stream, web]
--login <LOGIN>
Override the login endpoint
--no-color
Expand Down Expand Up @@ -442,7 +443,7 @@ Test help flag for login command
--heap <HEAP>
Specify a file to save a pprof heap profile
--ui <UI>
Specify whether to use the streaming UI or TUI [possible values: tui, stream]
Specify whether to use the streaming UI or TUI [possible values: tui, stream, web]
--login <LOGIN>
Override the login endpoint
--no-color
Expand Down Expand Up @@ -490,7 +491,7 @@ Test help flag for logout command
--heap <HEAP>
Specify a file to save a pprof heap profile
--ui <UI>
Specify whether to use the streaming UI or TUI [possible values: tui, stream]
Specify whether to use the streaming UI or TUI [possible values: tui, stream, web]
--login <LOGIN>
Override the login endpoint
--no-color
Expand Down

0 comments on commit 9695c8a

Please sign in to comment.