Skip to content

Commit

Permalink
Implemented shorter GUI tests for headless CI/CD
Browse files Browse the repository at this point in the history
- Reduced the number of Python versions to test
- Added the MacOS 14 (ARM64) platform
  • Loading branch information
vyrjana committed Mar 19, 2024
1 parent dc8d911 commit 27e4a8e
Show file tree
Hide file tree
Showing 3 changed files with 400 additions and 6 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.9', '3.10', '3.11', '3.12']
os: ['ubuntu-latest', 'macos-latest', 'windows-latest', 'macos-14']
python-version: ['3.11']

steps:
- uses: actions/checkout@v4
Expand All @@ -38,7 +38,14 @@ jobs:
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run headless GUI tests
uses: coactions/setup-xvfb@v1
with:
working-directory: ./tests
timeout-minutes: 10
run: python -c "from deareis.program import main; from test_gui import setup_headless_tests; setup_headless_tests(); main()"

- name: Run API tests
working-directory: ./tests
timeout-minutes: 30
timeout-minutes: 10
run: python -m unittest discover . -v
7 changes: 6 additions & 1 deletion tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@

if [ "$#" -ne 1 ]; then
echo "Incorrect number of arguments provided! One of the following arguments is allowed at a time:"
echo "- all: Run all tests."
echo "- all: Run all (non-headless) tests."
echo "- api: Run API-related tests."
echo "- gui: Run GUI-related tests."
echo "- headless: Run headless GUI-related tests."
exit
fi
if [ "$1" == "headless" ]; then
python3 -c "from deareis.program import main; from test_gui import setup_headless_tests; setup_headless_tests(); main()"
exit
fi
if ! [ "$1" == "gui" ]; then
Expand Down
Loading

0 comments on commit 27e4a8e

Please sign in to comment.