-
Notifications
You must be signed in to change notification settings - Fork 156
[DRAFT] Unit tests #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,5 @@ | ||||||||||||||||||||||
| name: Code Check | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| on: | ||||||||||||||||||||||
| push: | ||||||||||||||||||||||
| branches: [ main ] | ||||||||||||||||||||||
|
|
@@ -7,19 +8,27 @@ on: | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||
| check: | ||||||||||||||||||||||
| runs-on: ubuntu-20.04 | ||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| steps: | ||||||||||||||||||||||
| - uses: actions/checkout@v3 | ||||||||||||||||||||||
| - uses: actions/setup-python@v4 | ||||||||||||||||||||||
| - name: ruff | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| pip install ruff | ||||||||||||||||||||||
| ruff check . | ||||||||||||||||||||||
| - name: black | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| pip install black | ||||||||||||||||||||||
| black --check . | ||||||||||||||||||||||
| - name: interrogate | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||||
| uses: actions/setup-python@v4 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| python-version: '3.9.16' | ||||||||||||||||||||||
| cache: 'pip' | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| pip install interrogate | ||||||||||||||||||||||
| interrogate app/services -vv | ||||||||||||||||||||||
| python -m pip install --upgrade pip | ||||||||||||||||||||||
| pip install ruff black interrogate | ||||||||||||||||||||||
|
Comment on lines
+22
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Pin dependency versions for reproducibility. Installing dependencies without version constraints can lead to inconsistent behavior across different environments and times. run: |
python -m pip install --upgrade pip
- pip install ruff black interrogate
+ pip install ruff==0.1.9 black==23.12.1 interrogate==1.5.0📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Check code style with Ruff | ||||||||||||||||||||||
| run: ruff check . | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Check formatting with Black | ||||||||||||||||||||||
| run: black --check . | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Check docstring coverage with Interrogate | ||||||||||||||||||||||
| run: interrogate app/services -vv -f 100 | ||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Tests | ||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| tests: | ||
| runs-on: ubuntu-20.04 | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Update GitHub Actions to their latest versions. The following actions have newer versions available:
Apply this diff to update the actions: - - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- - uses: actions/setup-python@v4
+ - uses: actions/setup-python@v5
- uses: actions/cache@v3
+ uses: actions/cache@v4Also applies to: 14-14, 26-26 🧰 Tools🪛 actionlint (1.7.4)12-12: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) |
||
|
|
||
| - uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: "3.9.16" | ||
|
|
||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
| with: | ||
| version: 1.5.1 | ||
| virtualenvs-create: true | ||
| virtualenvs-in-project: true | ||
|
|
||
| - name: Load cached dependencies | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: .venv | ||
| key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
|
|
||
| - name: Install dependencies | ||
| run: poetry install --no-interaction --with tests | ||
|
|
||
| - name: Run tests | ||
| run: poetry run pytest | ||
Large diffs are not rendered by default.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Update GitHub Actions to their latest versions.
The actions being used are outdated according to static analysis.
Apply this diff to update the actions:
📝 Committable suggestion
🧰 Tools
🪛 actionlint (1.7.4)
14-14: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
17-17: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)