Issue #2: create basic test suite #4

Merged
marmaduke merged 2 commits from issue/2-create-basic-test-suite into ins-local 2026-09-25 14:51:51 +02:00
Owner

Summary

Adds the pytest infrastructure and a basic test suite for the Python test modules.

Changes

  • pytest.ini — project-level pytest configuration (test paths, markers for GPU/integration/slow)
  • conftest.py — root conftest ensuring the project root is on sys.path so tools packages are importable from any invocation directory
  • requirements-test.txt — pinned test dependencies (torch CPU, numpy, safetensors, pytest)
  • tests/streaming_http/test_sse.py — 25 unit tests for the incremental SSE decoder covering: basic events, fragmentation across chunks, CRLF/CR normalization, UTF-8 multi-byte sequences, invalid input, and EOF dispatch
  • tests/streaming_http/test_http_client.py — 12 tests for StreamingHttpClient URL validation, HttpExchangeResult defaults, and timing-model integration with SSE events
  • tests/artifact/test_numeric.py — 35 tests for the numeric format registry (format lookups, E2M1/E4M3FN decode correctness, word validation predicates)
  • CI workflow — updated to include tests/streaming_http in the pytest base suite

How to test

pip install -r requirements-test.txt
pip install torch --index-url https://download.pytorch.org/whl/cpu
python -m pytest tests/streaming_http tests/artifact/test_numeric.py -v

The full base suite (also run in CI):

python -m pytest tests/artifact tests/convert tests/streaming_http tests/test_bench_matrix.py tests/test_serve_corpus.py
## Summary Adds the pytest infrastructure and a basic test suite for the Python test modules. ## Changes - **pytest.ini** — project-level pytest configuration (test paths, markers for GPU/integration/slow) - **conftest.py** — root conftest ensuring the project root is on sys.path so tools packages are importable from any invocation directory - **requirements-test.txt** — pinned test dependencies (torch CPU, numpy, safetensors, pytest) - **tests/streaming_http/test_sse.py** — 25 unit tests for the incremental SSE decoder covering: basic events, fragmentation across chunks, CRLF/CR normalization, UTF-8 multi-byte sequences, invalid input, and EOF dispatch - **tests/streaming_http/test_http_client.py** — 12 tests for StreamingHttpClient URL validation, HttpExchangeResult defaults, and timing-model integration with SSE events - **tests/artifact/test_numeric.py** — 35 tests for the numeric format registry (format lookups, E2M1/E4M3FN decode correctness, word validation predicates) - **CI workflow** — updated to include tests/streaming_http in the pytest base suite ## How to test ```bash pip install -r requirements-test.txt pip install torch --index-url https://download.pytorch.org/whl/cpu python -m pytest tests/streaming_http tests/artifact/test_numeric.py -v ``` The full base suite (also run in CI): ```bash python -m pytest tests/artifact tests/convert tests/streaming_http tests/test_bench_matrix.py tests/test_serve_corpus.py ```
issue/1: add CI workflow with custom Docker image for pytest base suite
Some checks failed
ci / pytest-base (pull_request) Failing after 4s
1e7bd3a0c4
- Add Dockerfile.test: Python 3.11 image with CPU-only torch, numpy,
  safetensors, and pytest for running the pytest base test suite
  (artifact, convert, bench_matrix, serve_corpus) in CI.
- Add .github/workflows/ci.yml: single workflow that builds the
  custom image and runs the pytest base suite on push/PR to main.
issue/1: fix CI failure
Some checks failed
ci / pytest-base (pull_request) Failing after 5s
5cb9c54a00
issue/1: fix CI failure
All checks were successful
ci / pytest-base (pull_request) Successful in 2m1s
438a9ce1c9
issue/2: add basic pytest test suite
Some checks failed
ci / pytest-base (pull_request) Failing after 3m2s
74bd9fccbb
Add pytest infrastructure and new test modules for the Python test suite:

- pytest.ini: project-level pytest configuration (test paths, markers)
- conftest.py: root conftest that adds the project root to sys.path
- requirements-test.txt: pinned test dependencies
- tests/streaming_http/test_sse.py: 25 tests for the incremental SSE
  decoder (fragmentation, CRLF normalization, UTF-8, EOF behavior)
- tests/streaming_http/test_http_client.py: 12 tests for the streaming
  HTTP client (URL validation, exchange result defaults, timing model)
- tests/artifact/test_numeric.py: 35 tests for the numeric format
  registry and E2M1/E4M3FN codec helpers

Update the CI workflow to include the new streaming_http test path.
issue/2: fix CI failure
All checks were successful
ci / pytest-base (pull_request) Successful in 1m59s
7cee9a0954
marmaduke merged commit edded43625 into ins-local 2026-09-25 14:51:51 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marmaduke/ninfer-4090!4
No description provided.