Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Padatious/Padacioso Test Specificaiton #47

Merged
merged 10 commits into from
May 10, 2023
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