Skip to content

Commit

Permalink
Update python tests job
Browse files Browse the repository at this point in the history
Signed-off-by: Anish Asthana <[email protected]>
  • Loading branch information
anishasthana committed May 11, 2023
1 parent d1faddb commit 9f1bb2a
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 57 deletions.
8 changes: 5 additions & 3 deletions .github/build/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ LABEL summary="Toolchain for running pre-commit hooks." \
io.k8s.display-name="Pre-Commit Toolchain"

USER root
RUN dnf install nodejs
RUN dnf install nodejs -y && \
dnf clean all && \
rm -rf /var/cache/dnf
USER $USERID

COPY requirements-dev.txt /tmp/requirements-dev.txt
RUN python -m pip install -r /tmp/requirements-dev.txt
COPY requirements.txt /tmp/requirements.txt
RUN python -m pip install -r /tmp/requirements.txt

CMD bash
6 changes: 0 additions & 6 deletions .github/build/requirements-dev.txt

This file was deleted.

11 changes: 11 additions & 0 deletions .github/build/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
openshift-client==1.0.18
rich==12.5.1
ray[default]==2.1.0
kubernetes==26.1.0
codeflare-torchx==0.6.0.dev0
pre-commit
poetry
pytest
pytest-mock
coverage
black==22.3.0
File renamed without changes.
38 changes: 0 additions & 38 deletions .github/workflows/python-app.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Python Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
unit-tests:

runs-on: ubuntu-latest
container:
image: quay.io/project-codeflare/codeflare-sdk-precommit:v0.0.3
steps:
- uses: actions/checkout@v3
- name: Test with pytest and check coverage
run: |
coverage run -m --source=src pytest -v tests/unit_test.py
coverage=$(coverage report -m | tail -1 | tail -c 4 | head -c 2)
if (( $coverage < 90 )); then exit 1; else echo "Coverage passed, ${coverage}%"; fi
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ Can be installed via `pip`: `pip install codeflare-sdk`
### Prerequisites

We recommend using Python 3.9 for development.
Install development specific dependencies:
`$ pip install -r requirements-dev.txt`

Additional dependencies can be found in `requirements.txt`: `$ pip install -r requirements.txt`
Install dependencies: `$ pip install -r requirements.txt`

### Pre-commit

Expand Down
6 changes: 0 additions & 6 deletions requirements-dev.txt

This file was deleted.

6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ rich==12.5.1
ray[default]==2.1.0
kubernetes==26.1.0
codeflare-torchx==0.6.0.dev0
pre-commit
poetry
pytest
pytest-mock
coverage
black==22.3.0

0 comments on commit 9f1bb2a

Please sign in to comment.