Skip to content

Commit

Permalink
refactor: wireless flow test is complete, during this process debuggi…
Browse files Browse the repository at this point in the history
…ng and refactoring is done in different parts of code as the issues were found - closes #52

feat(core): make file handlers in logging `RotatingFileHandler`s
feat(tests): add `ChooseMenuItemByIconEvent`, `ChooseMenuItemByIndexEvent`, `ChooseMenuItemByLabelEvent` helper events to be used in tests
feat(tests): a `setup.sh` in `tests` directory or any of its parent directories is sourced before running tests
feat(tests): add `wait_for_menu_item` and `wait_for_empty_menu` fixtures
  • Loading branch information
sassanh committed Jun 25, 2024
1 parent 106ecb5 commit c09ab3f
Show file tree
Hide file tree
Showing 134 changed files with 2,567 additions and 3,660 deletions.
125 changes: 102 additions & 23 deletions .github/workflows/integration_delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,91 @@ jobs:
sudo apt-get update -y
sudo apt-get install -y portaudio19-dev
- name: Load Cached Poetry
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true

- name: Check Cached Poetry
id: cached-poetry
uses: actions/cache@v4
uses: actions/cache/restore@v4
with:
lookup-only: true
path: |
~/.cache
~/.local
key: poetry-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_VERSION}}
key:
poetry-ubuntu-latest-python${{ env.PYTHON_VERSION
}}-${{hashFiles('poetry.lock') }}

- uses: actions/setup-python@v5
name: Setup Python
- name: Install dependencies
if: steps.cached-poetry.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --extras=dev --with dev

- name: Save Cached Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64
path: |
~/.cache
~/.local
key:
poetry-ubuntu-latest-python${{ env.PYTHON_VERSION
}}-${{hashFiles('poetry.lock') }}

- name: Install Poetry
uses: snok/install-poetry@v1
ubo-pod-dependencies:
name: Install Ubo Pod Dependencies
runs-on: ubo-pod
outputs:
python-version: ${{ steps.get-python-version.outputs.PYTHON_VERSION }}
steps:
- uses: actions/checkout@v4
name: Checkout

- name: Extract Python Version
id: get-python-version
run: |
echo "PYTHON_VERSION=$(python --version | cut -d' ' -f2)" >> $GITHUB_OUTPUT
echo "PYTHON_VERSION=$(python --version | cut -d' ' -f2)"
- name: Check Cached Poetry
id: cached-poetry
uses: actions/cache/restore@v4
with:
virtualenvs-create: true
lookup-only: true
path: |
~/.cache
~/.local
key:
poetry-ubo-pod-python${{
steps.get-python-version.outputs.PYTHON_VERSION }}-${{
hashFiles('poetry.lock') }}

- name: Install dependencies
run: poetry install --extras=dev --with dev
if: steps.cached-poetry.outputs.cache-hit != 'true'
run: |
poetry env remove 3.11
poetry config virtualenvs.options.system-site-packages true --local
poetry env use 3.11
poetry install --no-root --no-interaction --extras=dev --with dev
- name: Save Cached Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
~/.cache
~/.local
key:
poetry-ubo-pod-python${{
steps.get-python-version.outputs.PYTHON_VERSION }}-${{
hashFiles('poetry.lock') }}

type-check:
name: Type Check
Expand All @@ -66,13 +129,16 @@ jobs:
path: |
~/.cache
~/.local
key: poetry-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_VERSION}}
key:
poetry-ubuntu-latest-python${{ env.PYTHON_VERSION
}}-${{hashFiles('poetry.lock') }}

- name: Create stub files
run: poetry run pyright --createstub kivy

- name: Type Check
run: poetry run poe typecheck
run: |
poetry run poe typecheck
lint:
name: Lint
Expand All @@ -96,7 +162,9 @@ jobs:
path: |
~/.cache
~/.local
key: poetry-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_VERSION}}
key:
poetry-ubuntu-latest-python${{ env.PYTHON_VERSION
}}-${{hashFiles('poetry.lock') }}

- name: Lint
run: poetry run poe lint
Expand All @@ -105,12 +173,17 @@ jobs:
name: Test
needs:
- dependencies
runs-on: ubuntu-latest
- ubo-pod-dependencies
strategy:
matrix:
runner: ['ubo-pod', 'ubuntu-latest']
runs-on: ${{ matrix.runner }}
environment:
name: test
url: https://app.codecov.io/gh/${{ github.repository }}/
steps:
- name: System Dependencies
if: matrix.runner != 'ubo-pod'
run: |
sudo apt-get update -y
sudo apt-get install -y libegl1 libgl1 libmtdev1 libzbar0
Expand All @@ -119,49 +192,53 @@ jobs:
name: Checkout

- name: Setup Python
if: matrix.runner != 'ubo-pod'
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64

- name: Load Cached Poetry
uses: actions/cache/restore@v4
id: cached-poetry
uses: actions/cache/restore@v4
with:
path: |
~/.cache
~/.local
key: poetry-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_VERSION}}
key:
poetry-${{ matrix.runner }}-python${{ matrix.runner == 'ubo-pod' &&
needs.dependencies.outputs.python-version || env.PYTHON_VERSION
}}-${{hashFiles('poetry.lock') }}

- name: Run Tests
run: |
POETRY_VIRTUALENVS_OPTIONS_SYSTEM_SITE_PACKAGES=true poetry run poe test --make-screenshots --cov-report=xml --cov-report=html -n auto --log-level=DEBUG
poetry run poe test --make-screenshots --cov-report=xml --cov-report=html --log-level=DEBUG -n ${{ matrix.runner == 'ubo-pod' && '1' || 'auto' }}
- name: Collect Window Screenshots
uses: actions/upload-artifact@v4
if: always()
with:
name: screenshots
name: screenshots-${{ matrix.runner }}
path: tests/**/results/**/*.png

- name: Collect Store Snapshots
uses: actions/upload-artifact@v4
if: always()
with:
name: snapshots
name: snapshots-${{ matrix.runner }}
path: tests/**/results/**/*.jsonc

- name: Collect HTML Coverage Report
uses: actions/upload-artifact@v4
with:
name: coverage-report
name: coverage-report-${{ matrix.runner }}
path: htmlcov

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: integration
flags: ${{ matrix.runner }}
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

Expand Down Expand Up @@ -192,7 +269,9 @@ jobs:
path: |
~/.cache
~/.local
key: poetry-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_VERSION}}
key:
poetry-ubuntu-latest-python${{ env.PYTHON_VERSION
}}-${{hashFiles('poetry.lock') }}

- name: Extract Version
id: extract-version
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ venv.bak/

# logs
*.log
*.log.[0-9]*

# headless-kivy-pi
headless_kivy_pi_buffer.raw
Expand Down
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# ChangeLog

## Version 0.14.4

-
## Version 0.15.0

- refactor: wireless flow test is complete, during this process debugging and refactoring
is done in different parts of code as the issues were found - closes #52
- feat(core): make file handlers in logging `RotatingFileHandler`s
- feat(tests): add `ChooseMenuItemByIconEvent`, `ChooseMenuItemByIndexEvent`, `ChooseMenuItemByLabelEvent`
helper events to be used in tests
- feat(tests): a `setup.sh` in `tests` directory or any of its parent directories
is sourced before running tests
- feat(tests): add `wait_for_menu_item` and `wait_for_empty_menu` fixtures

## Version 0.14.3

Expand Down
Loading

0 comments on commit c09ab3f

Please sign in to comment.