Skip to content

Commit 2de1e68

Browse files
committed
Increase scope of embedding cli tests
1 parent c1c3d99 commit 2de1e68

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

.github/workflows/embeddings.yml renamed to .github/workflows/embedding.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,25 @@ name: Embedding CLI
44
on:
55
workflow_dispatch:
66
push:
7-
branches:
8-
- feature/*
9-
- master
7+
branches: [master, feature/**]
108
paths:
11-
- '.github/workflows/embeddings.yml'
12-
- 'examples/embedding/**'
13-
- 'examples/tests/**'
9+
- '.github/workflows/embedding.yml'
10+
- 'examples/**'
11+
- 'src/**'
12+
- 'ggml/**'
13+
- 'include/**'
14+
- '**/CMakeLists.txt'
15+
- 'tests/e2e/embedding/**'
1416
pull_request:
1517
types: [opened, synchronize, reopened]
1618
paths:
17-
- '.github/workflows/embeddings.yml'
18-
- 'examples/embedding/**'
19-
- 'examples/tests/**'
19+
- '.github/workflows/embedding.yml'
20+
- 'examples/**'
21+
- 'src/**'
22+
- 'ggml/**'
23+
- 'include/**'
24+
- '**/CMakeLists.txt'
25+
- 'tests/e2e/embedding/**'
2026

2127
jobs:
2228
embedding-cli-tests:
@@ -56,4 +62,4 @@ jobs:
5662
5763
- name: Run embedding tests
5864
run: |
59-
pytest -v examples/tests
65+
pytest -v tests/e2e/embedding

examples/tests/__init__.py

Whitespace-only changes.

examples/tests/test_embedding.py renamed to tests/e2e/embedding/test_embedding_cli.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
import os, json, subprocess, hashlib
1+
import json
2+
import hashlib
3+
import os
4+
import pytest
5+
import subprocess
26
from pathlib import Path
37
import numpy as np
4-
import pytest
58

69
# ---------------------------------------------------------------------------
710
# Configuration constants
811
# ---------------------------------------------------------------------------
912

1013
EPS = 1e-3
11-
REPO_ROOT = Path(__file__).resolve().parents[2]
14+
REPO_ROOT = Path(__file__).resolve().parents[3]
1215
EXE = REPO_ROOT / ("build/bin/llama-embedding.exe" if os.name == "nt" else "build/bin/llama-embedding")
1316
DEFAULT_ENV = {**os.environ, "LLAMA_CACHE": os.environ.get("LLAMA_CACHE", "tmp")}
1417
SEED = "42"
@@ -96,6 +99,7 @@ def embedding_hash(vec: np.ndarray) -> str:
9699
# Register custom mark so pytest doesn't warn about it
97100
pytestmark = pytest.mark.filterwarnings("ignore::pytest.PytestUnknownMarkWarning")
98101

102+
99103
@pytest.mark.slow
100104
@pytest.mark.parametrize("fmt", ["raw", "json"])
101105
@pytest.mark.parametrize("text", ["hello world", "hi 🌎", "line1\nline2\nline3"])

0 commit comments

Comments
 (0)