Skip to content

Commit a34b804

Browse files
committed
Improve the unit test flow
Signed-off-by: SimFG <[email protected]>
1 parent 7db6237 commit a34b804

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

.github/workflows/unit_test_main.yaml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,40 @@ jobs:
6868
run: |
6969
python3 -m spacy download en_core_web_sm
7070
71-
- name: Unit Tests
71+
- name: Normal Unit Tests
7272
timeout-minutes: 30
7373
shell: bash
7474
working-directory: tests
7575
run: |
7676
export IS_CI=true
7777
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
78-
python3 -m pytest ./
78+
python3 -m pytest -k "not embedding and not processor" ./
79+
80+
- name: Embedding Unit Tests
81+
timeout-minutes: 30
82+
shell: bash
83+
working-directory: tests
84+
run: |
85+
export IS_CI=true
86+
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
87+
python3 -m pytest ./unit_tests/embedding/
88+
89+
- name: Processor Unit Tests
90+
timeout-minutes: 30
91+
shell: bash
92+
working-directory: tests
93+
run: |
94+
export IS_CI=true
95+
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
96+
python3 -m pytest ./unit_tests/processor/
7997
8098
- name: Generate coverage report
8199
run: |
82100
rm -rf ./coverage.xml
83101
coverage erase
84-
coverage run --source=gptcache -m pytest ./tests
102+
coverage run --source=gptcache -m pytest -k "not embedding and not processor" ./tests
103+
coverage run --source=gptcache -m pytest ./tests/unit_tests/embedding/
104+
coverage run --source=gptcache -m pytest ./tests/unit_tests/processor/
85105
coverage xml
86106
87107
- name: Upload coverage to Codecov

tests/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ pexpect
2121
spacy
2222
safetensors
2323
typing_extensions<4.6.0
24+
stability-sdk
25+
grpcio==1.53.0
2426
protobuf==3.20.0

0 commit comments

Comments
 (0)