You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Title a plain script's synthetic test "session" #283
_send_default_suite names both the suite and its single test after
the entry file, so the tree reads web_form_minimal.py nested inside web_form_minimal.py. Visible in the dashboard screenshot used in the one-pager.
Acceptance criteria
A plain script shows the file as the suite and session
as the test. pytest runs are unaffected.
Building a pytest example that actually exercises the tree (examples/selenium/python-test/test_login_pytest.py, mixing a class-based group with a module-level test) surfaced two more defects in the same surface. The original XS fix is correct but only covers the plain-script case, which is the less common one — a real Python suite is pytest, and the tree was wrong there in two different ways.
Recording all of it here since it is one concern: the tree telling the truth about a Python run.
1. Done — the original._send_default_suite named the suite and its single test after the entry file, so the tree read login.py nested inside login.py. The file stays the suite and the test is now named session, matching how the pytest plugin names a real test (title is the test's own name, parent is the file, fullTitle joins the two). pytest runs are unaffected: _external_suites already suppresses the synthetic suite entirely.
2. Done — a pytest class was flattened. pytest has no describe/it; a class is the grouping construct. But report.location flattens it into the name, measured on a real run:
_SuiteRegistry grouped by file only, so class-based tests rendered as flat rows titled TestLogin.test_valid, while the equivalent mocha describe nests. The class is now split back out of the nodeid into a nested suite, the leaf drops the prefix pytest repeats, and state rolls up through the group to the file. Confirmed in the dashboard: TestLogin is its own node with two children, and the module-level test sits beside it.
3. Open — selecting a test breaks the Source tab. Two producers describe the same file two different ways:
producer
form
measured
call_source() — commands, and the keys of the sources map
absolute
/…/test_shape.py
pytest plugin, report.location[0] — the test's file and call_source
relative
test_shape.py
_capture_source keys sources by the command's absolute callSource, while every test entry carries a relative path. The app's resolveSourceFile tries an exact key then normalizeSourcePath, which only strips a trailing :line and does not reconcile relative against absolute. So with nothing selected the panel resolves through a command's absolute path and the source renders; select a specific test and it resolves through the test's relative path and reports "Source for test_login_pytest.py was not captured in this trace."
Invisible in a plain-script run, where the same absolute path is used throughout, which is why only the pytest example exposes it. The fix belongs in the plugin: resolve report.location[0] against pytest's rootdir so tests and commands agree on one form. Teaching the app to accept both would paper over two producers disagreeing, and would still leave the tree labelled with a path matching nothing else.
Related, not in scope here
The run always reports "passed"._send_default_suite is called with a hardcoded "passed" (instrumentation.py:356) and the adapter has no failure path, so a run that raises still shows a green 1/1. Independent of the tree's shape and needs its own issue.
The workbench renders a half-populated state while loading — the Actions list is fully populated while the summary and tree are still empty, then snap in. Separate surface (app, not the adapter) and not yet diagnosed.
Activity
vishnuv688 commentedon Aug 17, 2026
Scope expanded to the whole tree
Building a pytest example that actually exercises the tree (
examples/selenium/python-test/test_login_pytest.py, mixing a class-based group with a module-level test) surfaced two more defects in the same surface. The original XS fix is correct but only covers the plain-script case, which is the less common one — a real Python suite is pytest, and the tree was wrong there in two different ways.Recording all of it here since it is one concern: the tree telling the truth about a Python run.
1. Done — the original.
_send_default_suitenamed the suite and its single test after the entry file, so the tree readlogin.pynested insidelogin.py. The file stays the suite and the test is now namedsession, matching how the pytest plugin names a real test (titleis the test's own name,parentis the file,fullTitlejoins the two). pytest runs are unaffected:_external_suitesalready suppresses the synthetic suite entirely.2. Done — a pytest class was flattened. pytest has no
describe/it; a class is the grouping construct. Butreport.locationflattens it into the name, measured on a real run:_SuiteRegistrygrouped by file only, so class-based tests rendered as flat rows titledTestLogin.test_valid, while the equivalent mochadescribenests. The class is now split back out of the nodeid into a nested suite, the leaf drops the prefix pytest repeats, and state rolls up through the group to the file. Confirmed in the dashboard:TestLoginis its own node with two children, and the module-level test sits beside it.3. Open — selecting a test breaks the Source tab. Two producers describe the same file two different ways:
call_source()— commands, and the keys of thesourcesmap/…/test_shape.pyreport.location[0]— the test'sfileandcall_sourcetest_shape.py_capture_sourcekeyssourcesby the command's absolute callSource, while every test entry carries a relative path. The app'sresolveSourceFiletries an exact key thennormalizeSourcePath, which only strips a trailing:lineand does not reconcile relative against absolute. So with nothing selected the panel resolves through a command's absolute path and the source renders; select a specific test and it resolves through the test's relative path and reports "Source for test_login_pytest.py was not captured in this trace."Invisible in a plain-script run, where the same absolute path is used throughout, which is why only the pytest example exposes it. The fix belongs in the plugin: resolve
report.location[0]against pytest's rootdir so tests and commands agree on one form. Teaching the app to accept both would paper over two producers disagreeing, and would still leave the tree labelled with a path matching nothing else.Related, not in scope here
_send_default_suiteis called with a hardcoded"passed"(instrumentation.py:356) and the adapter has no failure path, so a run that raises still shows a green 1/1. Independent of the tree's shape and needs its own issue.