Skip to content

Commit 733b53c

Browse files
committed
adding tests to config and workflow
1 parent b318986 commit 733b53c

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.github/workflows/run tests.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Test non-llm components
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Verify Code Quality"]
6+
types:
7+
- completed
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
tests:
15+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 30
18+
strategy:
19+
matrix:
20+
python-version: ['3.10', '3.11', '3.12'] # Need to add 3.13 once we resolve outlines issues.
21+
env:
22+
GITHUB_ACTIONS: 1
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Install uv and set the python version
27+
uses: astral-sh/setup-uv@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
enable-cache: true
31+
- name: Install dependencies
32+
run: uv sync --frozen --all-extras --group dev
33+
- name: Install Ollama
34+
run: curl -fsSL https://ollama.com/install.sh | sh
35+
- name: Pull Llama 3.2:1b model
36+
run: ollama pull llama3.2:1b
37+
- name: Start serving the model
38+
run: nohup ollama serve &
39+
40+
- name: Run Tests
41+
run: uv run -m pytest -v test

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,8 @@ skip = 'requirements.txt,uv.lock'
161161
[tool.mypy]
162162
disable_error_code = ["empty-body", "import-untyped"]
163163
python_version = "3.10"
164+
165+
[tool.pytest.ini_options]
166+
markers = [
167+
"llm: Marks the test as needing an exact output from an LLM (deselect with '-m \" not llm\"'); this depends on the session.backend.model_id"
168+
]

0 commit comments

Comments
 (0)