Skip to content

Commit acf66de

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

File tree

5 files changed

+952
-27
lines changed

5 files changed

+952
-27
lines changed

.github/workflows/test.yml

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