Skip to content

Commit

Permalink
Better Padatious/Padacioso Test Specificaiton (#47)
Browse files Browse the repository at this point in the history
* Add support for testing Padatious AND Padacioso for both OVOS and Neon

* Update test workflow to checkout proper branch

* Update padatious vs padacioso config handling

* Update ovos-core dependencies

* Make padacioso tests skippable (like padatious)

* Fix typo in ovos dependencies

* Reorg init to handle config patching under OVOS

* Reorg init to handle config patching under OVOS
Increase default timeout

* Remove config patching and update IntentService config directly

* Update checkout to default branch
  • Loading branch information
NeonDaniel authored May 10, 2023
1 parent 2162020 commit e39f29b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/skill_test_intents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ on:
default: test/test_intents.yaml
timeout:
type: number
default: 10
default: 15
test_padatious:
type: boolean
default: False
test_padacioso:
type: boolean
default: True
jobs:
test_intents_ovos:
runs-on: ${{inputs.runner}}
Expand All @@ -37,9 +43,17 @@ jobs:
sudo apt update
sudo apt install -y gcc libfann-dev swig libssl-dev portaudio19-dev git libpulse-dev
pip install --upgrade pip
pip install pytest mock ovos-core[skills] action/skill/
- name: Test Skill Intents
pip install pytest mock ovos-core[skills,skills_lgpl] action/skill/
- name: Test Skill Intents Padacioso
if: ${{ inputs.test_padacioso }}
run: |
export INTENT_ENGINE="padacioso"
export INTENT_TEST_FILE="action/skill/${{inputs.intent_file}}"
pytest action/github/test/test_skill_intents.py
- name: Test Skill Intents Padatious
if: ${{ inputs.test_padatious }}
run: |
export INTENT_ENGINE="padatious"
export INTENT_TEST_FILE="action/skill/${{inputs.intent_file}}"
pytest action/github/test/test_skill_intents.py
test_intents_neon:
Expand Down Expand Up @@ -68,7 +82,15 @@ jobs:
sudo apt install -y gcc libfann-dev swig libssl-dev portaudio19-dev git libpulse-dev
pip install --upgrade pip
pip install pytest mock git+https://github.com/NeonGeckoCom/NeonCore#egg=neon_core action/skill/
- name: Test Skill Intents
- name: Test Skill Intents Padacioso
if: ${{ inputs.test_padacioso }}
run: |
export INTENT_ENGINE="padacioso"
export INTENT_TEST_FILE="action/skill/${{inputs.intent_file}}"
pytest action/github/test/test_skill_intents.py
- name: Test Skill Intents Padatious
if: ${{ inputs.test_padatious }}
run: |
export INTENT_ENGINE="padatious"
export INTENT_TEST_FILE="action/skill/${{inputs.intent_file}}"
pytest action/github/test/test_skill_intents.py
6 changes: 4 additions & 2 deletions test/test_skill_intents.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@

from os import getenv
from mock import Mock, patch
from ovos_utils.messagebus import FakeBus
from mycroft_bus_client import Message
from ovos_utils.messagebus import FakeBus
from ovos_plugin_manager.skills import load_skill_plugins
from ovos_utils.log import LOG

from mycroft.skills.intent_services.padatious_service import PadatiousMatcher

regex_only = getenv("INTENT_ENGINE") == "padacioso"
LOG.level = logging.DEBUG


Expand Down Expand Up @@ -76,6 +76,8 @@ class TestSkillIntentMatching(unittest.TestCase):
from mycroft.skills.intent_service import IntentService
bus = FakeBus()
intent_service = IntentService(bus)
intent_service.padatious_service.padatious_config['regex_only'] = regex_only
assert intent_service.padatious_service.is_regex_only == regex_only
test_skill_id = 'test_skill.test'
last_message = None

Expand Down

0 comments on commit e39f29b

Please sign in to comment.