Skip to content

Commit 92c10f0

Browse files
committed
tests: add CI
1 parent 2ae8547 commit 92c10f0

File tree

5 files changed

+950
-27
lines changed

5 files changed

+950
-27
lines changed

.github/workflows/test.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
paths-ignore:
9+
- '**/*.md'
10+
- '**/*.ipynb'
11+
pull_request:
12+
branches:
13+
- main
14+
- dev
15+
paths-ignore:
16+
- '**/*.md'
17+
- '**/*.ipynb'
18+
19+
jobs:
20+
test:
21+
name: Tests on ${{ matrix.os }} for ${{ matrix.python-version }}
22+
strategy:
23+
matrix:
24+
python-version: [3.9]
25+
os: [ubuntu-latest]
26+
runs-on: ${{ matrix.os }}
27+
timeout-minutes: 10
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Set up Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v3
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install -r requirements.txt
38+
pip install -r requirements-dev.txt
39+
- name: Lint with flake8
40+
run: |
41+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
42+
- name: Build and Test
43+
run: |
44+
python -m pytest -o log_cli=true -o log_cli_level="INFO" -v ./
45+
# - name: Check codecov file
46+
# id: check_files
47+
# uses: andstor/file-existence-action@v1
48+
# with:
49+
# files: './coverage.xml'
50+
# - name: Upload coverage from test to Codecov
51+
# uses: codecov/codecov-action@v2
52+
# with:
53+
# file: ./coverage.xml
54+
# token: ${{ secrets.CODECOV_TOKEN }}

nano_graphrag/graphrag.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,4 +266,9 @@ async def _insert_done(self):
266266
await asyncio.gather(*tasks)
267267

268268
async def _query_done(self):
269-
pass
269+
tasks = []
270+
for storage_inst in [self.llm_response_cache]:
271+
if storage_inst is None:
272+
continue
273+
tasks.append(cast(StorageNameSpace, storage_inst).index_done_callback())
274+
await asyncio.gather(*tasks)

requirements-dev.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sentence_transformers
2+
flake8
3+
pytest

0 commit comments

Comments
 (0)