mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 08:58:36 +00:00
issues: the bug report template says how to get a log
Reports arrive saying they have no log:
Could not find a log file. I checked the expected log directory from the documentation,
but no log file was generated. (#3122's Output)
That is right: the D3D12 runtime writes nothing under %LOCALAPPDATA%\Leonida\logs until `-Log`
is passed, and the template asked only for "the last lines the console printed". So the Output
field now names the switch, the file and the first lines worth reading in it:
For the D3D12 runtime add -Log to play-nvidia.ps1 or play-d3d12.ps1 - the file is
%LOCALAPPDATA%\Leonida\logs\play-*.log, and without -Log nothing is written there; its
last 30 lines name the card (host wave lanes), the shader cache (shader preparation) and
the error.
`python -I tests/test_docs_issue_template.py`: 2 tests, OK. The second is the control - an
empty template lists all three hints, so the first test cannot pass on a template that lost
them. `python -m unittest discover -s tests -p "test_docs_*.py"`: 57 tests, OK.
Written with an AI assistant.
This commit is contained in:
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -57,7 +57,7 @@ body:
|
||||
id: output
|
||||
attributes:
|
||||
label: Output
|
||||
description: The last lines the console printed, from the stage that failed down to the error.
|
||||
description: The last lines the console printed, from the stage that failed down to the error. For the D3D12 runtime add -Log to play-nvidia.ps1 or play-d3d12.ps1 - the file is %LOCALAPPDATA%\Leonida\logs\play-*.log, and without -Log nothing is written there; its last 30 lines name the card (host wave lanes), the shader cache (shader preparation) and the error.
|
||||
render: text
|
||||
validations:
|
||||
required: true
|
||||
|
||||
34
tests/test_docs_issue_template.py
Normal file
34
tests/test_docs_issue_template.py
Normal file
@ -0,0 +1,34 @@
|
||||
"""The bug report template says how to get a D3D12 log.
|
||||
|
||||
python -I tests/test_docs_issue_template.py
|
||||
|
||||
Reports arrive with "Could not find a log file. I checked the expected log directory from the
|
||||
documentation, but no log file was generated" (#3122's own output), because the runtime writes
|
||||
nothing there until `-Log` is passed. The template asks for "the last lines the console
|
||||
printed"; without the switch there are none to paste, so it now names the switch, the file and
|
||||
the first lines worth reading. This reads the template only. No game files.
|
||||
"""
|
||||
import os
|
||||
import unittest
|
||||
|
||||
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
TEMPLATE = os.path.join(".github", "ISSUE_TEMPLATE", "bug_report.yml")
|
||||
HINTS = ("-Log", "%LOCALAPPDATA%\\Leonida\\logs", "play-nvidia.ps1")
|
||||
|
||||
|
||||
def missing_hints(template):
|
||||
"""The hints a report needs that `template` does not carry."""
|
||||
return [hint for hint in HINTS if hint not in template]
|
||||
|
||||
|
||||
class BugReportTemplateTest(unittest.TestCase):
|
||||
def test_the_output_field_says_how_to_get_a_log(self):
|
||||
with open(os.path.join(ROOT, TEMPLATE), encoding="utf-8") as f:
|
||||
self.assertEqual(missing_hints(f.read()), [])
|
||||
|
||||
def test_a_template_without_the_hints_is_caught(self):
|
||||
self.assertEqual(len(missing_hints("label: Output\ndescription: the last lines\n")), len(HINTS))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user