-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (65 loc) · 2.95 KB
/
Copy pathtest-functional.yml
File metadata and controls
74 lines (65 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Functional Tests
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test-all:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[confluence,test]"
- name: Lint with ruff
run: |
python -m pip install ruff
ruff check src/
- name: Check dependency licenses
run: |
python -m pip install pip-licenses
# fastembed: PyPI metadata says "Other/Proprietary" but actual license is Apache-2.0
# svglib: LGPL-3.0 transitive dep of llama-index-readers-confluence (acceptable for Python dynamic imports)
pip-licenses --partial-match \
--fail-on="GPL;AGPL;SSPL;EUPL;Proprietary" \
--allow-only="MIT;BSD;Apache;ISC;Python Software Foundation;PSF;Mozilla Public License;MPL;Unlicense;HPND;Historical Permission Notice;CC0;Zlib;Python-2.0;CNRI-Python;Academic Free License;0BSD" \
--ignore-packages fastembed svglib docx2txt py_rust_stemmers \
|| (echo "ERROR: Dependency with disallowed license detected" && exit 1)
- name: Check release-bundle licenses
run: |
python -m venv /tmp/license-check-venv
/tmp/license-check-venv/bin/pip install --quiet --upgrade pip
/tmp/license-check-venv/bin/pip install --quiet \
-r requirements.txt \
"llama-index-readers-confluence>=0.6.0,<1" \
-c scripts/manylinux_2_34-constraints.txt
/tmp/license-check-venv/bin/pip install --quiet pip-licenses
/tmp/license-check-venv/bin/pip-licenses --partial-match \
--fail-on="GPL;AGPL;SSPL;EUPL;Proprietary" \
--allow-only="MIT;BSD;Apache;ISC;Python Software Foundation;PSF;Mozilla Public License;MPL;Unlicense;HPND;Historical Permission Notice;CC0;Zlib;Python-2.0;CNRI-Python;Academic Free License;0BSD" \
--ignore-packages fastembed svglib docx2txt py_rust_stemmers \
|| (echo "ERROR: Release bundle contains dependency with disallowed license" && exit 1)
rm -rf /tmp/license-check-venv
- name: Download models for offline tests
env:
DATA_DIR: ./test_data_dummy
STORAGE_DIR: ./test_storage_dummy
run: |
python -m chunksilo.index --download-models
- name: Run all functional tests
env:
DATA_DIR: ./test_data_dummy
STORAGE_DIR: ./test_storage_dummy
run: |
# Run all tests except rag_metrics (which has its own workflow)
# This automatically discovers new test files
pytest test/ -v --ignore=test/test_rag_metrics.py --ignore=test/test_indexing_benchmark.py --cov=chunksilo --cov-report=term-missing