Skip to content

Commit f4a710e

Browse files
committed
Update python tests job
Signed-off-by: Anish Asthana <[email protected]>
1 parent 3527061 commit f4a710e

9 files changed

+48
-57
lines changed

Diff for: .github/build/Containerfile

+9-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ LABEL summary="Toolchain for running pre-commit hooks." \
55
io.k8s.display-name="Pre-Commit Toolchain"
66

77
USER root
8-
RUN dnf install nodejs
8+
RUN dnf install nodejs -y && \
9+
dnf clean all && \
10+
rm -rf /var/cache/dnf
11+
ADD https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/linux/oc.tar.gz $TMPDIR/
12+
RUN tar -C /usr/local/bin -xvf $TMPDIR/oc.tar.gz && \
13+
chmod +x /usr/local/bin/oc && \
14+
rm $TMPDIR/oc.tar.gz
915
USER $USERID
1016

11-
COPY requirements-dev.txt /tmp/requirements-dev.txt
12-
RUN python -m pip install -r /tmp/requirements-dev.txt
17+
COPY requirements.txt /tmp/requirements.txt
18+
RUN python -m pip install -r /tmp/requirements.txt
1319

1420
CMD bash

Diff for: .github/build/requirements-dev.txt

-6
This file was deleted.

Diff for: .github/build/requirements.txt

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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.6.0.dev0
6+
pre-commit
7+
poetry
8+
pytest
9+
pytest-mock
10+
coverage
11+
black==22.3.0
File renamed without changes.

Diff for: .github/workflows/python-app.yml

-38
This file was deleted.

Diff for: .github/workflows/unit-tests.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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.3
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Test with pytest and check coverage
18+
run: |
19+
coverage run -m --source=src pytest -v tests/unit_test.py
20+
coverage=$(coverage report -m | tail -1 | tail -c 4 | head -c 2)
21+
if (( $coverage < 90 )); then exit 1; else echo "Coverage passed, ${coverage}%"; fi

Diff for: README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ Can be installed via `pip`: `pip install codeflare-sdk`
1818
### Prerequisites
1919

2020
We recommend using Python 3.9 for development.
21-
Install development specific dependencies:
22-
`$ pip install -r requirements-dev.txt`
23-
24-
Additional dependencies can be found in `requirements.txt`: `$ pip install -r requirements.txt`
21+
Install dependencies: `$ pip install -r requirements.txt`
2522

2623
### Pre-commit
2724

Diff for: requirements-dev.txt

-6
This file was deleted.

Diff for: requirements.txt

+6
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@ rich==12.5.1
33
ray[default]==2.1.0
44
kubernetes==26.1.0
55
codeflare-torchx==0.6.0.dev0
6+
pre-commit
7+
poetry
8+
pytest
9+
pytest-mock
10+
coverage
11+
black==22.3.0

0 commit comments

Comments
 (0)