Conversation
Signed-off-by: arch <arch@archlinux.local>
There was a problem hiding this comment.
Approved by @castrojo for Hive auto-merge on green CI.
hanthor
left a comment
There was a problem hiding this comment.
import os was deleted but never replaced — this fails the Lint gate
In tests/vanilla-gnome/features/environment.py the diff removes the function-local import:
try:
- import os
- if os.path.exists("/tmp/results/atspi_tree.txt"):
+ results_dir = resolve_results_dir(context)
+ if os.path.exists(os.path.join(results_dir, "atspi_tree.txt")):but no module-level import os is added. The only thing that could bind os in that module is from qecore.common_steps import *.
Merging this branch onto main and running the exact command from pr-validate.yml:
$ ruff check tests/ scripts/ --select E,F,W --ignore E501
F405 `os` may be undefined, or defined from star imports
--> tests/vanilla-gnome/features/environment.py:195:12
F405 ... :195:27
F405 ... :203:9
F405 ... :204:14
Found 4 errors.
On main the same command reports All checks passed!, so these four are introduced by this PR and Lint & syntax will fail.
At runtime it is worse than a lint nit: if qecore.common_steps does not re-export os, after_all raises NameError, and the surrounding except Exception: pass swallows it — atspi_tree.txt would silently stop being written with no failure anywhere.
Fix: add import os to the module-level imports of tests/vanilla-gnome/features/environment.py.
Minor
The new import is inserted between import sys and import traceback:
import sys
from tests.shared.results_dir import resolve_results_dir
import tracebackThat puts a first-party import inside the stdlib block. It belongs with the other from tests.shared... imports below.
Note on CI status
This PR currently shows no check runs at all (total_count: 0) — the fork's workflows appear never to have been approved, so nothing has actually validated it. The three other files in the diff look correct to me; it is only tests/vanilla-gnome that is broken.
Generated by Claude Code
|
Closing as a duplicate of #825, which implements the same change without a regression. #791, #823 and #825 all route the AT-SPI tree dump through The blocker here is the one @hanthor already identified, and it still stands: Secondary: the new unit test patches #825 carries the same production change with both imports intact, plus tests that exercise the real resolver. Track it there. |
Replace hardcoded
/tmp/resultspaths with theresolve_results_dirhelper intests/shared/gnome_shell_steps.pyandtests/smoke/features/environment.py(and its duplicate intests/vanilla-gnome/features/environment.py).This completes Step 2 of the recommendation in issue #779.
— hive: backend=goose