Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

ci: run the pytest suites, which no lane was executing

PerryLinkbc2a12982740
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ce48ff4f..8e019ada 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -71,8 +71,11 @@ jobs:
python -m pip install --upgrade pip
# CPU-only torch keeps the job under a minute instead of pulling CUDA wheels
pip install torch --index-url https://download.pytorch.org/whl/cpu
- # Install with the mcp extra so laya[mcp] resolution and the laya.mcp layer are both exercised
- pip install -e ".[mcp]"
+ # Install with the mcp extra so laya[mcp] resolution and the laya.mcp layer are both exercised,
+ # and the serve extra so the HTTP surface is installed rather than skipped.
+ pip install -e ".[mcp,serve]"
+ # The pytest-style suites need the runner; nothing else in this job uses it.
+ pip install pytest
- name: Import check
run: python -c "import laya; print(laya.__version__); print(sorted(laya.__all__))"
@@ -114,6 +117,23 @@ jobs:
- name: Email cleaning tests
run: python tests/test_email.py
+ # These four are pytest suites, and `python tests/<name>.py` does not run them: it defines
+ # the test functions and exits 0, having asserted nothing. They were counted by the suite
+ # list above without ever executing, which is how the HTTP surface came to have no coverage
+ # in CI at all (#374).
+ #
+ # test_onnx.py and test_fast.py are deliberately not here: both are skip-guarded on an extra
+ # this job does not install, so they would pass trivially, and their real execution belongs
+ # in a lane that installs `onnx` or has a GPU.
+ - name: Pytest suites (serve, batch, system-one, audit regressions, truncation)
+ run: |
+ python -m pytest tests/test_serve.py \
+ tests/test_router_batch.py \
+ tests/test_system_one_lang.py \
+ tests/test_audit_regressions.py \
+ tests/test_truncation_direction.py \
+ -q
+
# Every workflow in this repo ran on ubuntu-latest only, so a test that fails off Linux was
# invisible until a user hit it -- which is what happened to tests/test_download.py (#140).
#
@@ -132,11 +152,14 @@ jobs:
# The +cpu index used on Linux is Linux/macOS only. On Windows the default PyPI wheel is
# already CPU-only, so installing torch plainly is both correct and what a user gets.
+ # The serve extra and pytest are here for the same reason as the Linux job: the HTTP
+ # surface is otherwise skipped and the pytest suites otherwise do not run at all.
- name: Install
run: |
python -m pip install --upgrade pip
pip install torch
- pip install -e .
+ pip install -e ".[serve]"
+ pip install pytest
shell: bash
# bash on this runner so the quoting rules match the Linux job; the default shell on a
@@ -177,6 +200,19 @@ jobs:
python tests/test_hooks_api.py
shell: bash
+ # Same five pytest suites as the Linux job. They are named explicitly rather than added to
+ # the loop above, because the loop runs each file as a script and that is exactly what does
+ # not execute a pytest suite (#374).
+ - name: Pytest suites (serve, batch, system-one, audit regressions, truncation)
+ run: |
+ python -m pytest tests/test_serve.py \
+ tests/test_router_batch.py \
+ tests/test_system_one_lang.py \
+ tests/test_audit_regressions.py \
+ tests/test_truncation_direction.py \
+ -q
+ shell: bash
+
- name: Email cleaning tests
run: python tests/test_email.py
shell: bash