Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: Python Linting

on:
pull_request:
branches:
- develop
push:
branches:
- develop

jobs:
run-linters:
Expand All @@ -15,16 +10,13 @@ jobs:

steps:
- name: Check out Git repository
uses: actions/checkout@v3
uses: actions/checkout@v7

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v6
with:
python-version: "3.10"

- name: Install Python dependencies
run: pip install black flake8 mypy pydantic types-requests

- name: Install Poetry
uses: snok/install-poetry@v1
with:
Expand All @@ -34,7 +26,7 @@ jobs:

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
uses: actions/cache@v6
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
Expand All @@ -44,7 +36,7 @@ jobs:
run: poetry install --no-interaction --no-root

- name: Run linters
uses: wearerequired/lint-action@v1
uses: wearerequired/lint-action@v2
with:
github_token: ${{ secrets.github_token }}
# Enable linters
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: poetry install --no-interaction --no-root

- name: Run tests
run: ./scripts/run_pytest.sh
run: ./scripts/run_pytest.sh --junitxml=report.xml

- name: Upload coverage report
uses: actions/upload-artifact@v4
Expand All @@ -45,4 +45,5 @@ jobs:
name: coverage-report
path: |
coverage.xml
report.xml
htmlcov/
20 changes: 20 additions & 0 deletions .github/workflows/upload-test-results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Test Report'
on:
workflow_run:
workflows: ['Python Tests']
types:
- completed
permissions:
contents: read
actions: read
checks: write
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v3
with:
artifact: coverage-report
name: Python Tests
path: 'report.xml'
reporter: python-xunit
2 changes: 1 addition & 1 deletion scripts/th_cli_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if ! command -v poetry &> /dev/null; then
exit 1
fi
poetry self update
poetry --project="$PROJECT_ROOT" install
poetry --project="$PROJECT_ROOT" install --without dev

# Build the package
echo "Building package..."
Expand Down
1 change: 0 additions & 1 deletion tests/test_run/camera/test_two_way_talk_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import pytest

import th_cli.test_run.camera.two_way_talk_handler as _module
from th_cli.test_run.camera.two_way_talk_handler import TwoWayTalkHandler, TwoWayTalkHTTPHandler

# ---------------------------------------------------------------------------
Expand Down
9 changes: 8 additions & 1 deletion th_cli/commands/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@
from th_cli.exceptions import CLIError, handle_api_error
from th_cli.test_run.camera.two_way_talk_handler import TwoWayTalkHandler
from th_cli.test_run.websocket import TestRunSocket
from th_cli.utils import DEFAULT_CLI_PROJECT_NAME, build_test_selection, convert_nested_to_dict, load_json_config, merge_configs, read_pics_config
from th_cli.utils import (
DEFAULT_CLI_PROJECT_NAME,
build_test_selection,
convert_nested_to_dict,
load_json_config,
merge_configs,
read_pics_config,
)
from th_cli.validation import validate_directory_path, validate_file_path, validate_test_ids

# Constants
Expand Down
Loading