Skip to content

Commit 280a5ec

Browse files
committed
Update python tests job
Signed-off-by: Anish Asthana <[email protected]>
1 parent 11c3b41 commit 280a5ec

File tree

5 files changed

+31
-38
lines changed

5 files changed

+31
-38
lines changed

.github/build/Containerfile

+2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ USER root
88
RUN dnf install nodejs
99
USER $USERID
1010

11+
COPY requirements.txt /tmp/requirements.txt
1112
COPY requirements-dev.txt /tmp/requirements-dev.txt
13+
RUN python -m pip install -r /tmp/requirements.txt
1214
RUN python -m pip install -r /tmp/requirements-dev.txt
1315

1416
CMD bash

.github/build/requirements.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
openshift-client==1.0.18
2+
rich==12.5.1
3+
ray[default]==2.1.0
4+
kubernetes==26.1.0
5+
codeflare-torchx==0.5.0.dev5
File renamed without changes.

.github/workflows/python-app.yml

-38
This file was deleted.

.github/workflows/unit-tests.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Python Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
unit-tests:
11+
12+
runs-on: ubuntu-latest
13+
container:
14+
image: quay.io/project-codeflare/codeflare-sdk-precommit:v0.0.2
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Install dependencies
18+
run: |
19+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
20+
- name: Test with pytest and check coverage
21+
run: |
22+
coverage run -m --source=src pytest -v tests/unit_test.py
23+
coverage=$(coverage report -m | tail -1 | tail -c 4 | head -c 2)
24+
if (( $coverage < 90 )); then exit 1; else echo "Coverage passed, ${coverage}%"; fi

0 commit comments

Comments
 (0)