`uv run` exits 1 for a failed install, an import error and a crew that failed after kickoff alike, so the reason says only that the script failed; that run's kickoff spans tell them apart.
(project, usage, monkeypatch, pyproject, kind)
| 997 | [(CREW_PYPROJECT, "crew"), (FLOW_PYPROJECT, "flow")], |
| 998 | ) |
| 999 | def test_a_project_script_that_fails(project, usage, monkeypatch, pyproject, kind) -> None: |
| 1000 | """`uv run` exits 1 for a failed install, an import error and a crew that |
| 1001 | failed after kickoff alike, so the reason says only that the script failed; |
| 1002 | that run's kickoff spans tell them apart.""" |
| 1003 | write(project / "pyproject.toml", pyproject) |
| 1004 | fail_project_scripts(monkeypatch) |
| 1005 | |
| 1006 | result = crewai_run() |
| 1007 | |
| 1008 | # The script's own exit code, so CI and coding agents see the failure. |
| 1009 | assert result.exit_code == SCRIPT_EXIT_CODE |
| 1010 | assert f"An error occurred while running the {kind}" in result.output |
| 1011 | assert f"returned non-zero exit status {SCRIPT_EXIT_CODE}" in result.output |
| 1012 | assert f"{SECRET} failed" in result.output |
| 1013 | assert usage == [started(kind), stopped("script_failed")] |
| 1014 | assert_events_are_anonymous(usage) |
| 1015 | |
| 1016 | |
| 1017 | def test_an_interrupted_project_script_counts_no_stop(project, usage, monkeypatch) -> None: |
nothing calls this directly
no test coverage detected