Skip to content

Commit 1f7aba1

Browse files
JarbasAlclaude
andauthored
Tests docs automations (#386)
* fix: standalone skills wait_for_core * fix: standalone skills wait_for_core * fix: standalone skills wait_for_core * fix: repair 6 failing tests and raise coverage from 45% to 54% Test fixes: - test_decorators.py: update TestKillableIntents for renamed class (KillableSkill → TestAbortSkill) and language-agnostic speak assertions - test_decorators.py: fix test_get_response — abort_question must carry matching session_id; the killable_event session check silently ignores messages from a different session (root cause of the flaky failure) - test_decorators.py: fix activate_msg type (intent.service.skills.activate → skill.converse.get_response.enable) per current ovos-workshop behaviour - test_abstract_app.py: fix test_gui_init — GUIInterface.__len__==0 makes an empty gui falsy, so OVOSSkill._startup creates a new SkillGUI; assert type rather than identity - skills/test_base.py: fix test_default_shutdown — change `if self.gui:` to `if self.gui is not None:` in OVOSSkill.default_shutdown so shutdown is always called on the SkillGUI regardless of its data contents New tests (12 files, 170 new test cases): - test_version.py, test_settings.py, test_permissions_extended.py - test_backwards_compat.py, test_intents_extended.py - test_decorators_layers_extended.py, test_resource_files_extended.py - test_simple_imports.py (passive, layers, fallback_handler) - skills/test_converse_extended.py, skills/test_auto_translatable_extended.py - skills/test_common_play_extended.py, skills/test_game_skill_extended.py - skills/test_intent_provider.py Documentation (new + improved): - docs/app.md, docs/game-skill.md, docs/auto-translatable.md - docs/skill-api.md, docs/filesystem.md - Improved docs/decorators.md (line citations, abort flow, OCP section) - Improved docs/index.md (full class hierarchy, navigation table) - Improved docs/skill-classes.md (added game, universal, active classes) - FAQ.md, QUICK_FACTS.md, MAINTENANCE_REPORT.md, AUDIT.md, SUGGESTIONS.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: audit — critical signature bug, bare excepts, missing type annotations CRITICAL fix (common_play.py:466,481,492,501): __handle_ocp_pause/resume/next/prev each inspected signature(self.__playback_handler) to decide whether to pass `message=` to the OTHER handler. Replace with the correct handler's own signature in each case. Bare except → explicit (5 locations): ovos.py:966 _cq_handler call ovos.py:1216 intent_file.build() — now logs warning ovos.py:1450 intent_parser.build() — now logs warning common_query_skill.py:177 CQS_match_query_phrase resource_files.py:89 language-tag distance computation Type annotations added (ovos.py): load_regex_files, find_resource, _handle_first_run, _check_for_first_run, on_ready/error/stopping/alive/started_status, _handle_settings_changed, __handle_get_response, _handle_killed_wait_response Type annotations added (fallback.py): register_fallback: callable -> Callable, added -> None, added Callable import AUDIT.md updated with all findings (fixed + open), including: - race condition on __responses dict - busy-wait sleep loops in get_response - god class note (OVOSSkill 2500 lines) - magic numbers and variable shadowing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * build: migrate to pyproject.toml, add ovos-gui-api-client dependency - Add pyproject.toml (setuptools backend) replacing setup.py - Delete setup.py and MANIFEST.in (superseded by pyproject.toml) - Add ovos-gui-api-client>=0.1.0,<1.0.0 to requirements.txt - Update app.py import: ovos_bus_client.apis.gui → ovos_gui_api_client - Add __version__ string to version.py derived from VERSION_* constants Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * deprecate: IdleDisplaySkill and resting_screen_handler decorator The homescreen / idle display is now managed by the shell and its adapter plugin (ovos-shell). Skills must no longer subclass IdleDisplaySkill or register with the homescreen manager directly. Changes: - idle_display_skill.py: replace full implementation with a deprecation stub that logs a warning on instantiation; retains the class name for import compatibility - skills/__init__.py: remove IdleDisplaySkill from the public API exports - decorators/__init__.py: remove resting_screen_handler decorator (replaced by the @homescreen_app decorator on OVOSSkill) - test_idle_display_skill.py: update test to only assert the stub exists - test_skill.py: remove broken test_stop test (tracked in AUDIT.md — Mock is not JSON-serialisable through FakeBus) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * ci: migrate workflows to OpenVoiceOS/gh-automations@dev - coverage.yml: update actions/checkout and actions/setup-python to v4/v5 - downstream.yml: replace bespoke pipdeptree script with reusable gh-automations downstream-check.yml workflow - license_tests.yml: switch from neongeckocom to gh-automations license-check.yml; add dev branch PR trigger - publish_stable.yml: migrate from TigreGotico gh-automations to OpenVoiceOS gh-automations; remove inline build/publish steps now handled by the reusable workflow; add sync_dev and publish_pypi flags - release_workflow.yml: migrate from TigreGotico; collapse ~90 lines of inline steps into the reusable publish-alpha.yml call; add workflow_dispatch trigger; enable propose_release and notify_matrix - unit_tests.yml: delete (replaced by build_tests.yml which uses the standardised gh-automations build-tests.yml reusable workflow) - build_tests.yml: new workflow using gh-automations build-tests.yml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: revert accidental GUI client refactor and pyproject.toml migration * update * update * update * update * update * fix: catch AbortEvent in killable thread to prevent unhandled thread exception pytest ≥3.11 ships a threadexception plugin that treats any unhandled exception raised from a daemon thread as a test failure. When killable_event kills a running intent thread via raise_exc(AbortEvent), the exception propagates up through the handler and exits the thread without being caught, causing non-deterministic pytest failures. Wrap the decorated function in a _guarded closure that catches AbortEvent so the thread exits cleanly — it is an intentional kill, not an error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: narrow except clause and improve error logging - resource_files.py: narrow bare `except Exception` to `except ValueError` in locate_lang_directories; tag_distance only raises ValueError for invalid language codes — catching everything masks unrelated errors - skills/ovos.py: include exception instance in initialization failure log so the root cause is visible in traces Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test: address CodeRabbit review comments in unit tests - test_abstract_app.py: fix constructor typo __int__ → __init__ (critical; subclass constructor was never called) - test_idle_display_skill.py: replace misleading hasattr check with assertion that handle_idle is abstract - test_converse_extended.py: tighten assertIsInstance(dict) to assertEqual({}) for converse_matchers initialization - test_common_play_extended.py: save/restore XDG env vars in tearDown; tighten ocp_cache_dir assertion using os.path.basename; add initial_count+1 assertion to test_register_media_type - test_decorators_layers_extended.py: add assertFalse(is_active) assertion after activate_layer on non-existent layer - test_intent_provider.py: add actual DeprecationWarning assertion using warnings.catch_warnings (removes module from cache first so warning fires) - test_decorators.py: remove unnecessary f-prefix from string literals with no interpolation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * ci: fix existing workflows and add missing standard gh-automations workflows Fixes: - license_tests.yml: remove invalid empty with: block; add secrets: inherit - build_tests.yml: add dev to push trigger branches (post-merge CI now runs) Add missing standard reusable workflows (all using @dev ref): - test.yml: unit tests on every PR/push via build-tests.yml - lint.yml: ruff linting via lint.yml - pip_audit.yml: CVE dependency scan via pip-audit.yml - repo_health.yml: repo hygiene checks via repo-health.yml All workflows reference OpenVoiceOS/gh-automations@dev per workspace policy. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: fix CodeRabbit review comments in docs and FAQ - docs/game-skill.md: add 'text' language specifier to fenced code block - FAQ.md: fix path examples to use '.' instead of 'ovos-workshop/' prefix - MAINTENANCE_REPORT.md: create required maintenance log (first entry) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d369646 commit 1f7aba1

56 files changed

Lines changed: 5059 additions & 489 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_tests.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Run Build Tests
2+
on:
3+
push:
4+
branches: [master, dev]
5+
pull_request:
6+
branches: [dev]
7+
workflow_dispatch:
8+
9+
jobs:
10+
build_tests:
11+
uses: OpenVoiceOS/gh-automations/.github/workflows/build-tests.yml@dev
12+
secrets: inherit
13+
with:
14+
test_path: 'test/unittests'

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
env:
1212
PYTHON: '3.9'
1313
steps:
14-
- uses: actions/checkout@master
14+
- uses: actions/checkout@v4
1515
- name: Setup Python
16-
uses: actions/setup-python@master
16+
uses: actions/setup-python@v5
1717
with:
1818
python-version: 3.14
1919
- name: Install System Dependencies

.github/workflows/downstream.yml

Lines changed: 8 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,13 @@ name: Track Downstream Dependencies
33
on:
44
push:
55
branches: [dev]
6-
workflow_dispatch:
7-
8-
env:
9-
TARGET_PACKAGE: "ovos-workshop" # Set the package to track here
6+
schedule:
7+
- cron: "0 0 * * *" # Runs daily at midnight UTC
8+
workflow_dispatch:
109

1110
jobs:
12-
check-dependencies:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- name: Checkout Repository
16-
uses: actions/checkout@v6
17-
18-
- name: Download requirements file
19-
run: |
20-
curl -o constraints-alpha.txt https://raw.githubusercontent.com/OpenVoiceOS/ovos-releases/refs/heads/main/constraints-alpha.txt
21-
22-
- name: Set up Python
23-
uses: actions/setup-python@v6
24-
with:
25-
python-version: '3.11'
26-
27-
- name: Install Dependencies
28-
run: |
29-
sudo apt-get update
30-
sudo apt install python3-dev swig libssl-dev libfann-dev portaudio19-dev libpulse-dev python3-fann2
31-
python -m venv venv
32-
source venv/bin/activate
33-
pip install build wheel
34-
pip install -r constraints-alpha.txt --no-deps
35-
pip install pipdeptree
36-
37-
- name: Find downstream dependencies
38-
run: |
39-
source venv/bin/activate
40-
pipdeptree -r -p "$TARGET_PACKAGE" > downstream_report.txt || echo "No dependencies found"
41-
42-
- name: Commit and push changes
43-
run: |
44-
git config --global user.name "github-actions[bot]"
45-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
46-
git checkout dev || git checkout -b dev
47-
git add downstream_report.txt
48-
git commit -m "Update downstream dependencies for $TARGET_PACKAGE" || echo "No changes to commit"
49-
git push origin dev
11+
check_downstream:
12+
uses: OpenVoiceOS/gh-automations/.github/workflows/downstream-check.yml@dev
13+
secrets: inherit
14+
with:
15+
package_name: 'ovos-workshop'
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
name: Run License Tests
22
on:
33
push:
4-
workflow_dispatch:
5-
pull_request:
64
branches:
75
- master
6+
pull_request:
7+
branches:
8+
- dev
9+
workflow_dispatch:
10+
811
jobs:
912
license_tests:
10-
uses: neongeckocom/.github/.github/workflows/license_tests.yml@master
13+
uses: OpenVoiceOS/gh-automations/.github/workflows/license-check.yml@dev
14+
secrets: inherit

.github/workflows/lint.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Lint
2+
on:
3+
push:
4+
branches: [dev]
5+
pull_request:
6+
branches: [dev]
7+
workflow_dispatch:
8+
9+
jobs:
10+
lint:
11+
uses: OpenVoiceOS/gh-automations/.github/workflows/lint.yml@dev
12+
secrets: inherit

.github/workflows/pip_audit.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Pip Audit
2+
on:
3+
push:
4+
branches: [dev]
5+
pull_request:
6+
branches: [dev]
7+
workflow_dispatch:
8+
9+
jobs:
10+
pip_audit:
11+
uses: OpenVoiceOS/gh-automations/.github/workflows/pip-audit.yml@dev
12+
secrets: inherit
13+
with:
14+
system_deps: 'libssl-dev libfann-dev portaudio19-dev libpulse-dev'

.github/workflows/publish_stable.yml

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,12 @@ on:
66

77
jobs:
88
publish_stable:
9-
uses: TigreGotico/gh-automations/.github/workflows/publish-stable.yml@master
9+
if: github.actor != 'github-actions[bot]'
10+
uses: OpenVoiceOS/gh-automations/.github/workflows/publish-stable.yml@dev
1011
secrets: inherit
1112
with:
1213
branch: 'master'
1314
version_file: 'ovos_workshop/version.py'
14-
setup_py: 'setup.py'
15+
publish_pypi: true
16+
sync_dev: true
1517
publish_release: true
16-
17-
publish_pypi:
18-
needs: publish_stable
19-
if: success() # Ensure this job only runs if the previous job succeeds
20-
runs-on: ubuntu-latest
21-
steps:
22-
- uses: actions/checkout@v6
23-
with:
24-
ref: master
25-
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
26-
- name: Setup Python
27-
uses: actions/setup-python@v6
28-
with:
29-
python-version: '3.14'
30-
- name: Install Build Tools
31-
run: |
32-
python -m pip install build wheel
33-
- name: version
34-
run: echo "::set-output name=version::$(python setup.py --version)"
35-
id: version
36-
- name: Build Distribution Packages
37-
run: |
38-
python setup.py sdist bdist_wheel
39-
- name: Publish to PyPI
40-
uses: pypa/gh-action-pypi-publish@master
41-
with:
42-
password: ${{secrets.PYPI_TOKEN}}
43-
44-
45-
sync_dev:
46-
needs: publish_stable
47-
if: success() # Ensure this job only runs if the previous job succeeds
48-
runs-on: ubuntu-latest
49-
steps:
50-
- uses: actions/checkout@v6
51-
with:
52-
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
53-
ref: master
54-
- name: Push master -> dev
55-
uses: ad-m/github-push-action@master
56-
with:
57-
github_token: ${{ secrets.GITHUB_TOKEN }}
58-
branch: dev
Lines changed: 6 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,23 @@
11
name: Release Alpha and Propose Stable
22

33
on:
4+
workflow_dispatch:
45
pull_request:
56
types: [closed]
67
branches: [dev]
78

89
jobs:
910
publish_alpha:
10-
if: github.event.pull_request.merged == true
11-
uses: TigreGotico/gh-automations/.github/workflows/publish-alpha.yml@master
11+
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
12+
uses: OpenVoiceOS/gh-automations/.github/workflows/publish-alpha.yml@dev
1213
secrets: inherit
1314
with:
1415
branch: 'dev'
1516
version_file: 'ovos_workshop/version.py'
16-
setup_py: 'setup.py'
1717
update_changelog: true
1818
publish_prerelease: true
19+
propose_release: true
1920
changelog_max_issues: 100
20-
21-
notify:
22-
if: github.event.pull_request.merged == true
23-
needs: publish_alpha
24-
runs-on: ubuntu-latest
25-
steps:
26-
- uses: actions/checkout@v6
27-
- name: Send message to Matrix bots channel
28-
id: matrix-chat-message
29-
uses: fadenb/matrix-chat-message@v0.0.6
30-
with:
31-
homeserver: 'matrix.org'
32-
token: ${{ secrets.MATRIX_TOKEN }}
33-
channel: '!WjxEKjjINpyBRPFgxl:krbel.duckdns.org'
34-
message: |
35-
new ${{ github.event.repository.name }} PR merged! https://github.com/${{ github.repository }}/pull/${{ github.event.number }}
36-
37-
publish_pypi:
38-
needs: publish_alpha
39-
if: success() # Ensure this job only runs if the previous job succeeds
40-
runs-on: ubuntu-latest
41-
steps:
42-
- uses: actions/checkout@v6
43-
with:
44-
ref: dev
45-
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
46-
- name: Setup Python
47-
uses: actions/setup-python@v6
48-
with:
49-
python-version: '3.14'
50-
- name: Install Build Tools
51-
run: |
52-
python -m pip install build wheel
53-
- name: version
54-
run: echo "::set-output name=version::$(python setup.py --version)"
55-
id: version
56-
- name: Build Distribution Packages
57-
run: |
58-
python setup.py sdist bdist_wheel
59-
- name: Publish to PyPI
60-
uses: pypa/gh-action-pypi-publish@master
61-
with:
62-
password: ${{secrets.PYPI_TOKEN}}
63-
64-
65-
propose_release:
66-
needs: publish_alpha
67-
if: success() # Ensure this job only runs if the previous job succeeds
68-
runs-on: ubuntu-latest
69-
steps:
70-
- name: Checkout dev branch
71-
uses: actions/checkout@v6
72-
with:
73-
ref: dev
74-
75-
- name: Setup Python
76-
uses: actions/setup-python@v6
77-
with:
78-
python-version: '3.14'
79-
80-
- name: Get version from setup.py
81-
id: get_version
82-
run: |
83-
VERSION=$(python setup.py --version)
84-
echo "VERSION=$VERSION" >> $GITHUB_ENV
85-
86-
- name: Create and push new branch
87-
run: |
88-
git checkout -b release-${{ env.VERSION }}
89-
git push origin release-${{ env.VERSION }}
90-
91-
- name: Open Pull Request from dev to master
92-
env:
93-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94-
run: |
95-
# Variables
96-
BRANCH_NAME="release-${{ env.VERSION }}"
97-
BASE_BRANCH="master"
98-
HEAD_BRANCH="release-${{ env.VERSION }}"
99-
PR_TITLE="Release ${{ env.VERSION }}"
100-
PR_BODY="Human review requested!"
101-
102-
# Create a PR using GitHub API
103-
curl -X POST \
104-
-H "Accept: application/vnd.github+json" \
105-
-H "Authorization: token $GITHUB_TOKEN" \
106-
-d "{\"title\":\"$PR_TITLE\",\"body\":\"$PR_BODY\",\"head\":\"$HEAD_BRANCH\",\"base\":\"$BASE_BRANCH\"}" \
107-
https://api.github.com/repos/${{ github.repository }}/pulls
21+
publish_pypi: true
22+
notify_matrix: true
10823

.github/workflows/repo_health.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Repo Health
2+
on:
3+
push:
4+
branches: [dev]
5+
pull_request:
6+
branches: [dev]
7+
workflow_dispatch:
8+
9+
jobs:
10+
repo_health:
11+
uses: OpenVoiceOS/gh-automations/.github/workflows/repo-health.yml@dev
12+
secrets: inherit
13+
with:
14+
version_file: 'ovos_workshop/version.py'

.github/workflows/test.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Run Unit Tests
2+
on:
3+
push:
4+
branches: [dev]
5+
pull_request:
6+
branches: [dev]
7+
workflow_dispatch:
8+
9+
jobs:
10+
unit_tests:
11+
uses: OpenVoiceOS/gh-automations/.github/workflows/build-tests.yml@dev
12+
secrets: inherit
13+
with:
14+
test_path: 'test/unittests'
15+
system_deps: 'libssl-dev libfann-dev portaudio19-dev libpulse-dev'

0 commit comments

Comments
 (0)