Skip to content

Commit 6709bb1

Browse files
committed
fix(ci): pull LFS model in python job; enable dev-key flag in auth test
- python CI checked out the model.onnx LFS pointer (not the real file), causing onnxruntime INVALID_PROTOBUF; add lfs: true to checkout. - test_predict_json_accepts_dev_key now sets CLIMATEVISION_ALLOW_DEV_KEY=1 to match the gated cv_dev bypass.
1 parent 2e1dd81 commit 6709bb1

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v7
14+
with:
15+
lfs: true
1416

1517
- name: Set up Python
1618
uses: actions/setup-python@v5

tests/test_api.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,15 @@ def test_predict_json_rejects_missing_auth(client: TestClient) -> None:
2525
assert "API key required" in response.json()["detail"]
2626

2727

28-
def test_predict_json_accepts_dev_key(client: TestClient) -> None:
29-
"""POST /api/predict should accept the cv_dev development key."""
28+
def test_predict_json_accepts_dev_key(
29+
client: TestClient, monkeypatch: pytest.MonkeyPatch
30+
) -> None:
31+
"""POST /api/predict should accept the cv_dev development key.
32+
33+
The dev bypass is gated behind CLIMATEVISION_ALLOW_DEV_KEY, so enable it
34+
explicitly for this test (production leaves it unset/disabled).
35+
"""
36+
monkeypatch.setenv("CLIMATEVISION_ALLOW_DEV_KEY", "1")
3037
payload = {
3138
"bbox": [-60.0, -15.0, -45.0, -5.0],
3239
"start_date": "2023-01-01",

0 commit comments

Comments
 (0)