Add private Vevo2 voice studio mode

This commit is contained in:
Mikei386
2026-09-09 13:38:00 +02:00
parent 535bd751b5
commit 68d02f32bd
15 changed files with 592 additions and 28 deletions
+9
View File
@@ -52,6 +52,15 @@ class DashboardModeTests(unittest.TestCase):
self.assertEqual(json.loads(request.data), {"mode": "separation"})
self.assertEqual(request.get_header("Authorization"), "Bearer test-key")
def test_voice_mode_is_forwarded_to_router(self):
with patch.object(self.dashboard.urllib.request, "urlopen", return_value=_Response()) as urlopen:
status, body = self.dashboard.change_mode("voice")
self.assertEqual(status, 202)
self.assertEqual(body, {"status": "accepted"})
request = urlopen.call_args.args[0]
self.assertEqual(json.loads(request.data), {"mode": "voice"})
def test_unknown_mode_is_rejected_without_router_request(self):
with patch.object(self.dashboard.urllib.request, "urlopen") as urlopen:
status, body = self.dashboard.change_mode("unknown")
+36
View File
@@ -46,7 +46,43 @@ def separator_item(state="exited"):
"Labels": {controller.SEPARATOR_LABEL_KEY: "bs-roformer"}}
def voice_item(state="exited"):
return {"Id": "id-voice", "State": state,
"Labels": {controller.VOICE_LABEL_KEY: "vevo2"}}
class ProfileControllerTests(unittest.TestCase):
def test_voice_start_exclusively_stops_gpu_workers(self):
profiles = {name: item(name) for name in controller.ALLOWED}
profiles["medium"] = item("medium", "running")
calls = []
def request(method, path):
calls.append((method, path))
return 204, b""
with patch.object(controller, "VOICE_WORKER", "vevo2"), \
patch.object(controller, "MUSIC_WORKER", "acestep"), \
patch.object(controller, "SEPARATOR_WORKER", "bs-roformer"), \
patch.object(controller, "containers", return_value=profiles), \
patch.object(controller, "voice_container", return_value=voice_item()), \
patch.object(controller, "music_container", return_value=music_item("running")), \
patch.object(controller, "separator_container", return_value=separator_item("running")), \
patch.object(controller, "image_containers", return_value=[image_item("running")]), \
patch.object(controller, "tts_container", return_value=tts_item()), \
patch.object(controller, "docker_request", side_effect=request):
result = controller.set_voice_worker(True)
self.assertEqual(result, {"voice_worker": "vevo2", "state": "running"})
self.assertEqual(calls, [
("POST", "/containers/id-medium/stop?t=120"),
("POST", "/containers/id-flux/stop?t=20"),
("POST", "/containers/id-tts/stop?t=30"),
("POST", "/containers/id-music/stop?t=30"),
("POST", "/containers/id-separator/stop?t=30"),
("POST", "/containers/id-voice/start"),
])
def test_separator_start_exclusively_stops_gpu_workers(self):
profiles = {name: item(name) for name in controller.ALLOWED}
profiles["large"] = item("large", "running")