mirror of
https://github.com/Canner/WrenAI.git
synced 2026-08-28 15:52:53 +08:00
fix(wren): run full unit suite in CI and fix upgrade tests for schema_version 5 (#2388)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -66,7 +66,11 @@ jobs:
|
||||
uv sync --locked
|
||||
uv pip install --reinstall --no-index --find-links ../wren-core-py/target/wheels/ wren-core-py
|
||||
- name: Run unit tests
|
||||
run: uv run --no-sync pytest tests/unit/ -v -m unit
|
||||
# Run the whole tests/unit/ tree rather than filtering on `-m unit`:
|
||||
# the marker is opt-in, so any unmarked file (e.g. test_context_cli.py)
|
||||
# was silently skipped. Exclude test_memory.py — it needs the `memory`
|
||||
# extra and runs in the dedicated `memory tests` job below.
|
||||
run: uv run --no-sync pytest tests/unit/ -v --ignore=tests/unit/test_memory.py
|
||||
|
||||
test-connector:
|
||||
name: ${{ matrix.datasource }} tests
|
||||
|
||||
@@ -467,12 +467,14 @@ def _make_v1_project(tmp_path: Path) -> Path:
|
||||
|
||||
|
||||
def test_upgrade_cli_default_to_latest(tmp_path):
|
||||
from wren.context import _LATEST_SCHEMA_VERSION # noqa: PLC0415
|
||||
|
||||
_make_valid_project(tmp_path)
|
||||
result = runner.invoke(app, ["context", "upgrade", "--path", str(tmp_path)])
|
||||
assert result.exit_code == 0, result.output
|
||||
assert "Upgrade complete" in result.output
|
||||
config = yaml.safe_load((tmp_path / "wren_project.yml").read_text())
|
||||
assert config["schema_version"] == 4
|
||||
assert config["schema_version"] == _LATEST_SCHEMA_VERSION == 5
|
||||
|
||||
|
||||
def test_upgrade_cli_dry_run(tmp_path):
|
||||
@@ -491,7 +493,7 @@ def test_upgrade_cli_dry_run(tmp_path):
|
||||
|
||||
def test_upgrade_cli_already_current(tmp_path):
|
||||
(tmp_path / "wren_project.yml").write_text(
|
||||
"schema_version: 4\nname: test\ndata_source: postgres\n"
|
||||
"schema_version: 5\nname: test\ndata_source: postgres\n"
|
||||
)
|
||||
result = runner.invoke(app, ["context", "upgrade", "--path", str(tmp_path)])
|
||||
assert result.exit_code == 0
|
||||
|
||||
Reference in New Issue
Block a user