diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml index c133224..2ef93db 100644 --- a/.github/workflows/python-lint.yml +++ b/.github/workflows/python-lint.yml @@ -2,11 +2,6 @@ name: Python Linting on: pull_request: - branches: - - develop - push: - branches: - - develop jobs: run-linters: @@ -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: @@ -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') }} @@ -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 diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 7c9d550..c68bc82 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -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 @@ -45,4 +45,5 @@ jobs: name: coverage-report path: | coverage.xml + report.xml htmlcov/ diff --git a/.github/workflows/upload-test-results.yml b/.github/workflows/upload-test-results.yml new file mode 100644 index 0000000..f9ce2e7 --- /dev/null +++ b/.github/workflows/upload-test-results.yml @@ -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 \ No newline at end of file diff --git a/scripts/th_cli_install.sh b/scripts/th_cli_install.sh index c8568a7..30d0d0b 100755 --- a/scripts/th_cli_install.sh +++ b/scripts/th_cli_install.sh @@ -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..." diff --git a/tests/test_run/camera/test_two_way_talk_handler.py b/tests/test_run/camera/test_two_way_talk_handler.py index 2b610e5..d7009e3 100644 --- a/tests/test_run/camera/test_two_way_talk_handler.py +++ b/tests/test_run/camera/test_two_way_talk_handler.py @@ -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 # --------------------------------------------------------------------------- diff --git a/th_cli/commands/run_tests.py b/th_cli/commands/run_tests.py index 1ba7405..918ac7c 100644 --- a/th_cli/commands/run_tests.py +++ b/th_cli/commands/run_tests.py @@ -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