Skip to content

Commit

Permalink
deprecate!:mycroft
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Sep 18, 2024
1 parent 5bc091c commit 6b83a9e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 165 deletions.
82 changes: 0 additions & 82 deletions test/end2end/session/test_ocp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1182,85 +1182,3 @@ def wait_for_n_messages(n):
for idx, m in enumerate(messages):
self.assertEqual(m.msg_type, expected_messages[idx])


class TestLegacyCPSPipeline(TestCase):

def setUp(self):
self.skill_id = "skill-fake-fm-legacy.openvoiceos"
self.core = get_minicroft(self.skill_id)
self.core.intent_service.ocp.config = {"legacy_cps": True}

def tearDown(self) -> None:
self.core.stop()

def test_legacy_cps(self):
self.assertIsNotNone(self.core.intent_service.ocp)

messages = []

def new_msg(msg):
nonlocal messages
m = Message.deserialize(msg)
if m.msg_type in ["ovos.skills.settings_changed", "gui.status.request"]:
return # skip these, only happen in 1st run
messages.append(m)
print(len(messages), msg)

def wait_for_n_messages(n):
nonlocal messages
t = time.time()
while len(messages) < n:
sleep(0.1)
if time.time() - t > 10:
raise RuntimeError("did not get the number of expected messages under 10 seconds")

self.core.bus.on("message", new_msg)

sess = Session("test-session",
pipeline=[
"ocp_legacy"
])
utt = Message("recognizer_loop:utterance",
{"utterances": ["play rammstein"]},
{"session": sess.serialize(), # explicit
})
self.core.bus.emit(utt)

# confirm all expected messages are sent
expected_messages = [
"recognizer_loop:utterance",
"intent.service.skills.activated",
"ovos.common_play.activate",
"ocp:legacy_cps",
# legacy cps api
"play:query",
"play:query.response", # searching
"play:query.response", # report results
"play:start", # skill selected
"mycroft.audio.service.track_info", # check is legacy audio service is playing
# global stop signal
"mycroft.stop",
"common_query.openvoiceos.stop",
"common_query.openvoiceos.stop.response",
"ovos.common_play.stop",
"ovos.common_play.stop.response",
"skill-fake-fm-legacy.openvoiceos.stop",
"skill-fake-fm-legacy.openvoiceos.stop.response",
"mycroft.audio.service.track_info", # check is legacy audio service is playing
# activate skill
"intent.service.skills.activate",
"intent.service.skills.activated",
f"{self.skill_id}.activate",
# skill callback code
"mycroft.audio.service.play",
"ovos.utterance.handled" # handle_utterance returned (intent service)
]
wait_for_n_messages(len(expected_messages))

#self.assertEqual(len(expected_messages), len(messages))

for idx, m in enumerate(messages):
self.assertEqual(m.msg_type, expected_messages[idx])

play = messages[-2]
self.assertEqual(play.data["tracks"], ["https://fake.mp3"])
36 changes: 0 additions & 36 deletions test/end2end/skill-fake-fm-legacy/__init__.py

This file was deleted.

46 changes: 0 additions & 46 deletions test/end2end/skill-fake-fm-legacy/setup.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from adapt.intent import IntentBuilder

from ovos_workshop.skills.common_query_skill import CommonQuerySkill, CQSMatchLevel
from mycroft.skills.core import intent_handler
from ovos_workshop.decorators import intent_handler


class FakeWikiSkill(CommonQuerySkill):
Expand Down

0 comments on commit 6b83a9e

Please sign in to comment.