Skip to content

Commit b2d8155

Browse files
aittalamclaude
andcommitted
Mark network-dependent download test with 'online'
Allows running the suite offline with -m "not online" while keeping the rest of the ssl tests selectable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 5cd224a commit b2d8155

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

tests/integration/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ Use `-m` to select test categories:
3737
| `thinking` | Thinking model tests (QwQ, DeepSeek-R1, etc.) |
3838
| `gpu` | GPU acceleration tests |
3939
| `cpu` | CPU-only tests |
40-
| `ssl` | HTTPS/TLS tests: serving with `--ssl-cert-file`, model download over HTTPS, untrusted-cert rejection. Needs `openssl` in PATH to generate a test certificate; the download test needs network access (huggingface.co) |
40+
| `ssl` | HTTPS/TLS tests: serving with `--ssl-cert-file`, model download over HTTPS, untrusted-cert rejection. Needs `openssl` in PATH to generate a test certificate |
41+
| `online` | Tests that need network access (currently the HTTPS model download). Skip with `-m "not online"` |
4142

4243
Examples:
4344

@@ -53,6 +54,9 @@ Examples:
5354

5455
# Run only the HTTPS/TLS tests (or skip them with -m "not ssl")
5556
./run_tests.sh --executable ./o/llamafile/llamafile --model model.gguf -m ssl
57+
58+
# Run the HTTPS/TLS tests without the network-dependent ones
59+
./run_tests.sh --executable ./o/llamafile/llamafile --model model.gguf -m "ssl and not online"
5660
```
5761

5862
## Options

tests/integration/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ markers = [
2626
"tui: tests TUI mode",
2727
"cli: tests CLI mode",
2828
"combined: tests combined (TUI+server) mode",
29-
"ssl: tests HTTPS/TLS support (serving and model download; the download test needs network access)",
29+
"ssl: tests HTTPS/TLS support (serving and model download)",
30+
"online: tests that need network access (deselect with '-m \"not online\"')",
3031
]

tests/integration/tests/test_ssl.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
over HTTPS (-hf/--model-url), and rejection of untrusted certificates.
66
77
Toggle with the ``ssl`` marker: ``-m ssl`` / ``-m "not ssl"``.
8-
``test_download_model_over_https`` needs network access (huggingface.co);
8+
``test_download_model_over_https`` needs network access (huggingface.co)
9+
and is additionally marked ``online`` (skip with ``-m "not online"``);
910
the other tests run fully offline.
1011
"""
1112

@@ -148,6 +149,7 @@ def test_https_server_rejects_plaintext(
148149
class TestHttpsDownload:
149150
"""Model downloads over HTTPS (the client side of TLS support)."""
150151

152+
@pytest.mark.online
151153
def test_download_model_over_https(
152154
self, executable, server_port, timeouts, tmp_path
153155
):

0 commit comments

Comments
 (0)