mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-04 13:07:32 +00:00
fix(ci): accept high-refresh startup logs
This commit is contained in:
1 parent
23b2b1dc3e
commit
fb2949ab9f
2 files changed
+33
-7
No files matched your search
+16
-7
@@ -10,20 +10,29 @@ NO_DISPLAY = re.compile(r"skipped,.*no display", re.IGNORECASE)
|
||||
NO_VULKAN_DEVICE = re.compile(r"skipped,.*no usable Vulkan device", re.IGNORECASE)
|
||||
|
||||
HIGH_REFRESH_LIMITATION = re.compile(r"current display does not provide 120 Hz", re.IGNORECASE)
|
||||
HIGH_REFRESH_STARTUP_LOGS = (
|
||||
re.compile(r"Surface capabilities drawable=\d+x\d+ min=\d+x\d+ max=\d+x\d+ minImages=\d+ maxImages=\d+ usage=0x[0-9a-f]+", re.IGNORECASE),
|
||||
re.compile(r"\[src/VulkanDevice\.cpp:\d+ VulkanDevice\] Swapchain created swapchain=0x[0-9a-f]+ extent=\d+x\d+ images=\d+", re.IGNORECASE),
|
||||
re.compile(r"\[shader-disk-cache\] .+ \(source version [0-9a-f]+, format \d+\)", re.IGNORECASE),
|
||||
)
|
||||
SKIP_RETURN_CODE = re.compile(r"SKIP_RETURN_CODE=\d+")
|
||||
|
||||
WINDOWS_PREFIX = "agc"
|
||||
|
||||
|
||||
def high_refresh_limitation(output):
|
||||
reasons = []
|
||||
found_limitation = False
|
||||
for line in output.splitlines():
|
||||
reason = line.strip()
|
||||
if reason.lower().startswith("skipped,"):
|
||||
reason = reason[len("skipped,"):].strip()
|
||||
if reason:
|
||||
reasons.append(reason)
|
||||
return bool(reasons) and all(HIGH_REFRESH_LIMITATION.fullmatch(reason) for reason in reasons)
|
||||
message = line.strip()
|
||||
if not message:
|
||||
continue
|
||||
if message.lower().startswith("skipped,"):
|
||||
message = message[len("skipped,"):].strip()
|
||||
if HIGH_REFRESH_LIMITATION.fullmatch(message):
|
||||
found_limitation = True
|
||||
elif not any(pattern.fullmatch(message) for pattern in HIGH_REFRESH_STARTUP_LOGS):
|
||||
return False
|
||||
return found_limitation
|
||||
|
||||
|
||||
def skips(path):
|
||||
|
||||
@@ -57,6 +57,23 @@ class CheckSkipsTests(unittest.TestCase):
|
||||
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|
||||
self.assertIn("1 test(s) skipped, all expected", result.stdout)
|
||||
|
||||
def test_high_refresh_skip_allows_known_vulkan_startup_logs(self):
|
||||
report = '''<skipped message="current display does not provide 120 Hz"/><system-out>Surface capabilities drawable=1152x648 min=1152x648 max=1152x648 minImages=3 maxImages=0 usage=0x8009f
|
||||
[src/VulkanDevice.cpp:1972 VulkanDevice] Swapchain created swapchain=0x12345678 extent=1152x648 images=3
|
||||
[shader-disk-cache] /tmp/build/tests/shader_cache/4bc6b6d4632b7637 (source version 4bc6b6d4632b7637, format 36)
|
||||
skipped, current display does not provide 120 Hz
|
||||
</system-out>'''
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
junit = Path(directory) / "junit.xml"
|
||||
junit.write_text(f'<testsuite><testcase name="guest_video_out_high_frame_rate">{report}</testcase></testsuite>', encoding="utf-8")
|
||||
for job in ("linux", "windows"):
|
||||
with self.subTest(job=job):
|
||||
result = subprocess.run(
|
||||
[sys.executable, "-I", str(TOOL), str(junit), "--job", job],
|
||||
capture_output=True, text=True)
|
||||
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|
||||
self.assertIn("1 test(s) skipped, all expected", result.stdout)
|
||||
|
||||
def test_high_refresh_reason_cannot_hide_additional_diagnostics(self):
|
||||
reason = "current display does not provide 120 Hz"
|
||||
known = f"skipped, {reason}"
|
||||
|
||||
Reference in new issue
Block a user