Skip to content

Commit

Permalink
unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
paulzierep committed Nov 6, 2024
1 parent e51d06e commit fe8ab32
Show file tree
Hide file tree
Showing 8 changed files with 1,630 additions and 110 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/lint.yaml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/lint_and_unittest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Code best practice and unittesting

on:
pull_request:
branches:
- main
paths:
- 'bin/**' # This will trigger the workflow only if files in the 'bin' folder are modified.

concurrency:
group: lint-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install tox
run: python -m pip install 'tox>=1.8.0'
- name: Lint
run: tox -e lint

unittest:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.11']
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: python -m pip install -r requirements.txt
- name: Run unittests
run: |
PYTHONPATH=bin python -m unittest discover -s bin/tests
7 changes: 7 additions & 0 deletions sources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ When the tests succeed a maintainer will merge the dev branch into main. Feel fr

The reason we are not running the tests directly on the pull request branch is, that this does not allow to access the GitHub secrets, that are required to run the tests.

# Run the unit tests locally

```
cd codex/sources
PYTHONPATH=bin python -m unittest discover -s bin/tests
```

### Tools

To make a test run of the tool to check its functionalities follow [Usage](#Usage) to set-up the environnement and the API key, then run
Expand Down
Loading

0 comments on commit fe8ab32

Please sign in to comment.