Skip to content

Commit 56b68ca

Browse files
authored
Update python tests structure (#220)
* Add unit tests * Update python tests structure * Update clang-format * Revert pre-commit deps versions * Fix pytheon version in ut
1 parent 2d87b2d commit 56b68ca

File tree

5 files changed

+21
-6
lines changed

5 files changed

+21
-6
lines changed

.github/workflows/pre_commit.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,16 @@ jobs:
3333
run: pip install 'model_api/python/.[full]'
3434
- name: Run pre-commit checks
3535
run: pre-commit run --all-files
36+
Unit-Tests:
37+
runs-on: ubuntu-22.04
38+
steps:
39+
- name: CHECKOUT REPOSITORY
40+
uses: actions/checkout@v4
41+
- name: Set up Python
42+
uses: actions/setup-python@v5
43+
with:
44+
python-version: "3.9"
45+
- name: Install dependencies
46+
run: pip install 'model_api/python/.[tests,ovms]'
47+
- name: Run python unit tests
48+
run: pytest tests/python/unit

.github/workflows/test_precommit.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1010
cancel-in-progress: true
1111
jobs:
12-
Python-Precommit:
13-
runs-on: ubuntu-latest
12+
Python-Functional-Tests:
13+
runs-on: ubuntu-22.04
1414
steps:
15-
- uses: actions/checkout@v3
16-
- uses: actions/setup-python@v4
15+
- name: CHECKOUT REPOSITORY
16+
uses: actions/checkout@v4
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
1719
with:
1820
python-version: 3.9
1921
cache: pip
@@ -25,15 +27,15 @@ jobs:
2527
run: |
2628
source venv/bin/activate
2729
python -m pip install --upgrade pip
28-
pip install model_api/python/[tests] --extra-index-url https://download.pytorch.org/whl/cpu
30+
pip install model_api/python/[tests,ovms] --extra-index-url https://download.pytorch.org/whl/cpu
2931
- name: Prepare test data
3032
run: |
3133
source venv/bin/activate
3234
python tests/cpp/precommit/prepare_data.py -d data -p tests/cpp/precommit/public_scope.json
3335
- name: Run test
3436
run: |
3537
source venv/bin/activate
36-
pytest tests/python/precommit
38+
pytest tests/python/funtional
3739
CPP-Code-Quality:
3840
name: CPP-Code-Quality
3941
runs-on: ubuntu-latest
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)