Skip to content
Closed
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
5 changes: 4 additions & 1 deletion concore_cli/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,12 @@ def build_workflow(
console.print("[green]✓[/green] Build completed")
except subprocess.CalledProcessError as e:
progress.stop()
console.print("[yellow]Build failed[/yellow]")
console.print("[red]Build failed:[/red]")
if e.stdout:
console.print(e.stdout)
if e.stderr:
console.print(e.stderr)
raise

run_command = "docker compose up" if compose else "./run"
if exec_type == "windows":
Expand Down
33 changes: 33 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,39 @@ def test_build_command_shared_source_specialization_merges_edge_params(self):
self.assertIn("PORT_NAME_B_C", content)
self.assertIn("PORT_B_C", content)

def test_build_command_auto_build_failure_exits_nonzero(self):
real_run = subprocess.run

def fake_run(cmd, *args, **kwargs):
if Path(str(cmd[0])).name in ("build", "build.bat"):
raise subprocess.CalledProcessError(1, cmd, output="", stderr="boom")
return real_run(cmd, *args, **kwargs)

with self.runner.isolated_filesystem(temp_dir=self.temp_dir):
result = self.runner.invoke(cli, ["init", "test-project"])
self.assertEqual(result.exit_code, 0)

with patch.object(subprocess, "run", side_effect=fake_run):
result = self.runner.invoke(
cli,
[
"build",
"test-project/workflow.graphml",
"--source",
"test-project/src",
"--output",
"out",
"--type",
"posix",
"--auto-build",
],
)

self.assertNotEqual(result.exit_code, 0)
self.assertIn("boom", result.output)
self.assertIn("Build failed", result.output)
self.assertNotIn("Workflow ready", result.output)

def test_build_command_existing_output(self):
with self.runner.isolated_filesystem(temp_dir=self.temp_dir):
result = self.runner.invoke(cli, ["init", "test-project"])
Expand Down
Loading