Skip to content

Commit

Permalink
test script
Browse files Browse the repository at this point in the history
  • Loading branch information
paulvxx committed Feb 11, 2024
1 parent dad7c19 commit 286af05
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Python package

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

jobs:
build:
Expand All @@ -32,9 +32,6 @@ jobs:
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
export PYTHONPATH=./src:$PYTHONPATH
pytest ./test
- name: Run lint and tests
run: ./test.sh
shell: bash

20 changes: 19 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
#!/bin/bash
exit 127

# Exit script on error
set -e

# Lint with flake8
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

# Set PYTHONPATH for pytest
export PYTHONPATH=./src:$PYTHONPATH

echo -e "Running tests ..."

# Test with pytest
pytest ./test

echo -e "\rTests OK."

exit 0

0 comments on commit 286af05

Please sign in to comment.