190 build попытка 2

This commit is contained in:
2026-10-21 13:29:36 +03:00
parent bb4b6ad68d
commit 787f880c0e
23 changed files with 3 additions and 1553 deletions

View File

@@ -125,7 +125,6 @@ def test_copy_profile_creates_target_specific_mapping_and_keeps_source(tmp_path:
with database.session() as session:
profiles = list(session.scalars(select(VmixMappingProfile).order_by(VmixMappingProfile.id)))
<<<<<<< HEAD
visible = [profile for profile in profiles if not profile.name.startswith("__AUTO_MAPPING__")]
assert len(visible) == 2
assert visible[0].id == source_id and visible[0].active is True
@@ -145,13 +144,6 @@ def test_copy_profile_creates_target_specific_mapping_and_keeps_source(tmp_path:
assert len(published) == 1
assert published[0].vmix_input_title == "SCORE BUG"
assert published[0].vmix_field == "HomeScore.Text"
=======
assert len(profiles) == 2
assert profiles[0].id == source_id and profiles[0].active is True
assert profiles[0].project_fingerprint == "a" * 64
assert profiles[1].active is True
assert profiles[1].project_fingerprint == "b" * 64
>>>>>>> e4bedb1264fca8a6bc8a41f0ca1ff67b176c6651
def test_portable_transfer_backend_remains_available_for_compatibility() -> None:

View File

@@ -2,16 +2,11 @@ from __future__ import annotations
import asyncio
import json
<<<<<<< HEAD
import shutil
import subprocess
from pathlib import Path
import pytest
=======
from pathlib import Path
>>>>>>> e4bedb1264fca8a6bc8a41f0ca1ff67b176c6651
from sqlalchemy import select
from hockey_data.agent_bridge import VmixAgentHub
@@ -29,19 +24,14 @@ def test_mapping_config_list_is_compact_and_has_copy_action() -> None:
assert 'data-map-copy-profile="${item.id}"' in JS
assert 'title="Копировать конфиг"' in JS
assert '>⧉</button>' in JS
<<<<<<< HEAD
assert '${isCurrent ? "✓" : (isUsed ? "↻" : "▶")}' in JS
assert "Обновить мой Agent с v" in JS
assert "${escapeHtml(item.name)}" in JS and "${escapeHtml(item.created_by)}" in JS
=======
assert '${isUsed ? "✓" : "▶"}' in JS
>>>>>>> e4bedb1264fca8a6bc8a41f0ca1ff67b176c6651
assert 'hockey-map-profile-actions' in CSS
assert 'hockey-map-profile-icon' in CSS
assert 'width:28px;height:28px' in CSS
assert '/profiles/${profileId}/duplicate' in JS
assert 'Копия «${created.name}» создана' in JS
<<<<<<< HEAD
node = shutil.which("node")
if node is None:
pytest.skip("Node is required for the actual Mapping row renderer check")
@@ -69,8 +59,6 @@ for(const html of [current,update]){
'''
checked = subprocess.run([node, "-e", script], input=JS, text=True, capture_output=True, timeout=10)
assert checked.returncode == 0, checked.stderr
=======
>>>>>>> e4bedb1264fca8a6bc8a41f0ca1ff67b176c6651
def test_duplicate_creates_independent_inactive_profile_with_all_links(tmp_path: Path) -> None:

View File

@@ -1,8 +1,4 @@
<<<<<<< HEAD
"""Exercise actual acknowledged Mapping delivery with protocol-shaped replies."""
=======
"""Exercise the BUILD113 transport that replaced the failing BUILD97 mocks."""
>>>>>>> e4bedb1264fca8a6bc8a41f0ca1ff67b176c6651
import asyncio
from datetime import datetime
@@ -22,7 +18,6 @@ def transport(tmp_path, fail_at=None):
s.add(VmixAssignment(device_id=device.id, assignment_key="assignment", wfl_user_id="owner",
game_external_id="g", active=True))
class Socket:
<<<<<<< HEAD
def __init__(self, device_id):
self.device_id = device_id
self.frames = []
@@ -37,15 +32,10 @@ def transport(tmp_path, fail_at=None):
"ok": True, "reason": "",
})
=======
def __init__(self):
self.frames = []
>>>>>>> e4bedb1264fca8a6bc8a41f0ca1ff67b176c6651
async def send_json(self, message):
if fail_at is not None and len(self.frames) == fail_at:
raise ConnectionError("fake disconnected socket")
self.frames.append(message)
<<<<<<< HEAD
if message.get("type") == "vmix.command":
self.max_pending = max(self.max_pending, sum(
pending[0] == self.device_id for pending in hub._pending_commands.values()))
@@ -53,9 +43,6 @@ def transport(tmp_path, fail_at=None):
if self.auto_ack:
await self.acknowledge(message)
own, other = Socket("GFX-OWNER"), Socket("GFX-VIEWER")
=======
own, other = Socket(), Socket()
>>>>>>> e4bedb1264fca8a6bc8a41f0ca1ff67b176c6651
hub = VmixAgentHub(db)
hub._live["GFX-OWNER"] = LiveAgent(own, datetime.utcnow())
hub._live["GFX-VIEWER"] = LiveAgent(other, datetime.utcnow())
@@ -72,22 +59,14 @@ def send(hub, rows):
match_id="g", entries=rows, use_batch=True))
<<<<<<< HEAD
def test_372_mapping_fields_are_acknowledged_ordered_and_isolated(tmp_path):
=======
def test_372_mapping_fields_are_ordered_and_isolated_without_ack(tmp_path):
>>>>>>> e4bedb1264fca8a6bc8a41f0ca1ff67b176c6651
hub, own, other = transport(tmp_path)
rows = entries(372)
result = send(hub, rows)
assert result["commands_sent"] == 372 and result["input_groups"] == 12
assert all(item["ok"] for item in result["results"])
<<<<<<< HEAD
assert result["ack_waited"] is True and result["transport"] == "sequential_ack"
assert own.max_pending == 1 and result["retries"] == 0
=======
assert result["ack_waited"] is False and result["transport"] == "sequential_no_ack"
>>>>>>> e4bedb1264fca8a6bc8a41f0ca1ff67b176c6651
assert own.frames[0]["type"] == "match.assign"
assert [f["command"] for f in own.frames[1:]] == [r["command"] for r in rows]
assert all(f["type"] == "vmix.command" and f["match_id"] == "g" and f["assignment_id"] == "assignment"
@@ -101,7 +80,6 @@ def test_disconnect_stops_remaining_mapping_and_reports_failure(tmp_path):
result = send(hub, entries(35))
assert result["commands_sent"] == 3
assert [row["ok"] for row in result["results"]] == [True] * 3 + [False] * 32
<<<<<<< HEAD
assert 0 <= result["retries"] <= 3
assert len(own.frames) == 4 and other.frames == []
@@ -131,9 +109,6 @@ def test_another_agent_completes_while_first_agent_ack_is_pending(tmp_path):
assert own.frames[-1]["match_id"] == "g"
asyncio.run(scenario())
=======
assert result["retries"] == 0 and len(own.frames) == 4 and other.frames == []
>>>>>>> e4bedb1264fca8a6bc8a41f0ca1ff67b176c6651
def test_unconfirmed_assignment_does_not_send_mapping(tmp_path):