mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-06-30 20:58:11 +00:00
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Vulnerability Scan / pip-audit (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Remove redundant startup logs from `crewai run` and make the legacy flow command warning actionable. - Stop printing `Running the Flow` and `Running the Crew` before project execution. - Stop printing the redundant `Flow started with ID: ...` line while preserving flow lifecycle event emission. - Replace Click's generic `kickoff` deprecation warning with a clearer message that tells users to use `crewai run`.
36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
from click.testing import CliRunner
|
|
from pytest import MonkeyPatch
|
|
import tomli
|
|
|
|
from crewai_cli.cli import crewai
|
|
from crewai_cli.create_flow import create_flow
|
|
|
|
|
|
def test_create_flow_declarative_project_can_run(
|
|
tmp_path: Path, monkeypatch: MonkeyPatch
|
|
):
|
|
monkeypatch.chdir(tmp_path)
|
|
create_flow("Research Flow", declarative=True)
|
|
|
|
project_root = tmp_path / "research_flow"
|
|
assert project_root.is_dir()
|
|
|
|
pyproject = tomli.loads(
|
|
(project_root / "pyproject.toml").read_text(encoding="utf-8")
|
|
)
|
|
assert pyproject["project"]["name"] == "research_flow"
|
|
assert pyproject["project"]["requires-python"]
|
|
assert pyproject["project"]["dependencies"]
|
|
assert (project_root / pyproject["tool"]["crewai"]["definition"]).is_file()
|
|
|
|
monkeypatch.chdir(project_root)
|
|
result = CliRunner().invoke(crewai, ["run"], env={"UV_RUN_RECURSION_DEPTH": "1"})
|
|
|
|
assert result.exit_code == 0
|
|
assert "Running the Flow" not in result.output
|
|
assert "AI agents" in result.output
|