Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions src/conductor/cli/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,13 @@ def run(
workspace_instructions=workspace_instructions,
cli_instructions=raw_instructions,
)
console.print(f"[bold cyan]Dashboard:[/bold cyan] {launch.url}")
console.print(f"[dim]Child stderr log: {launch.stderr_log}[/dim]")
console.print(
"[dim]Workflow running in background. Dashboard auto-shuts down after "
"workflow completes and all clients disconnect.[/dim]"
)
if is_verbose():
console.print(f"[bold cyan]Dashboard:[/bold cyan] {launch.url}")
console.print(f"[dim]Child stderr log: {launch.stderr_log}[/dim]")
console.print(
"[dim]Workflow running in background. Dashboard auto-shuts down after "
"workflow completes and all clients disconnect.[/dim]"
)
except Exception as e:
print_error(e)
raise typer.Exit(code=1) from None
Expand Down Expand Up @@ -844,12 +845,13 @@ def resume(
web_port=web_port,
metadata=cli_metadata,
)
console.print(f"[bold cyan]Dashboard:[/bold cyan] {launch.url}")
console.print(f"[dim]Child stderr log: {launch.stderr_log}[/dim]")
console.print(
"[dim]Resumed workflow running in background. Dashboard auto-shuts down after "
"workflow completes and all clients disconnect.[/dim]"
)
if is_verbose():
console.print(f"[bold cyan]Dashboard:[/bold cyan] {launch.url}")
console.print(f"[dim]Child stderr log: {launch.stderr_log}[/dim]")
console.print(
"[dim]Resumed workflow running in background. Dashboard auto-shuts down "
"after workflow completes and all clients disconnect.[/dim]"
)
except Exception as e:
print_error(e)
raise typer.Exit(code=1) from None
Expand Down
22 changes: 22 additions & 0 deletions tests/test_cli/test_resume_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,28 @@ def test_resume_web_bg_invokes_launch_background_resume(self, tmp_path: Path) ->
assert kwargs["web_port"] == 9092
assert kwargs["metadata"] == {"tracker": "ado"}

def test_silent_resume_web_bg_suppresses_dashboard_output(self, tmp_path: Path) -> None:
"""Test --silent suppresses resume --web-bg parent-process dashboard output."""
from conductor.cli.bg_runner import BackgroundLaunch

wf_path = _write_workflow(tmp_path)

with patch("conductor.cli.bg_runner.launch_background_resume") as mock_launch:
mock_launch.return_value = BackgroundLaunch(
url="http://127.0.0.1:9092",
stderr_log=tmp_path / "stub-cafe1234.bg.stderr.log",
stdout_log=tmp_path / "stub-cafe1234.bg.stdout.log",
run_id="cafe1234",
)
result = runner.invoke(app, ["--silent", "resume", str(wf_path), "--web-bg"])

assert result.exit_code == 0
assert mock_launch.called
assert "http://127.0.0.1:9092" not in result.output
assert "Dashboard" not in result.output
assert "Resumed workflow running in background" not in result.output
assert "Child stderr log" not in result.output

def test_resume_web_bg_with_from_checkpoint(self, tmp_path: Path) -> None:
"""Test --web-bg forwards --from checkpoint path."""
from conductor.cli.bg_runner import BackgroundLaunch
Expand Down
24 changes: 24 additions & 0 deletions tests/test_cli/test_web_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,30 @@ def test_web_bg_flag_passed(self, workflow_file: Path) -> None:
assert mock_launch.called
_, kwargs = mock_launch.call_args
assert kwargs["workflow_path"] == workflow_file
assert "http://127.0.0.1:9999" in result.output

def test_silent_web_bg_suppresses_dashboard_output(self, workflow_file: Path) -> None:
"""Test --silent suppresses --web-bg parent-process dashboard output."""
from pathlib import Path as _Path

from conductor.cli.bg_runner import BackgroundLaunch

with patch("conductor.cli.bg_runner.launch_background") as mock_launch:
mock_launch.return_value = BackgroundLaunch(
url="http://127.0.0.1:9999",
stderr_log=_Path("/tmp/conductor-test-deadbeef.bg.stderr.log"),
stdout_log=_Path("/tmp/conductor-test-deadbeef.bg.stdout.log"),
run_id="deadbeef",
)

result = runner.invoke(app, ["--silent", "run", str(workflow_file), "--web-bg"])

assert result.exit_code == 0
assert mock_launch.called
assert "http://127.0.0.1:9999" not in result.output
assert "Dashboard" not in result.output
assert "Workflow running in background" not in result.output
assert "Child stderr log" not in result.output

def test_web_flags_default_values(self, workflow_file: Path) -> None:
"""Test that web flags default to False/0 when not specified."""
Expand Down
Loading