Skip to content

extractTest.py: do not walk above the tests directory - #18426

Open
NearCai wants to merge 3 commits into
eclipse-sumo:mainfrom
NearCai:pr/extracttest-fix
Open

NearCai wants to merge 3 commits into
eclipse-sumo:mainfrom
NearCai:pr/extracttest-fix

Conversation

@NearCai

@NearCai NearCai commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #18384.

The recursive walk in extractTest.py only stopped at SUMO_HOME/tests (or the filesystem root). When extracting a test that is not located below that directory it walked upwards and picked up unrelated files such as SUMO_HOME/data.

The walk now stops at SUMO_HOME/tests for tests inside the tests tree. For external tests it stops at the closest ancestor containing a testsuite.* file, or at the test directory itself when no suite exists. This keeps inherited options.* and config.* files working for external test suites without including unrelated sibling directories.

Local verification: extracting an external suite case inherited the suite's --begin 0 option; extracting a standalone external case did not include sibling directories; a synthetic suite inside SUMO_HOME/tests still inherited its options.

Signed-off-by: dkm <2094657017@qq.com>
Copilot AI balanced review requested due to automatic review settings October 25, 2026 09:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@behrisch

behrisch commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

but this will break the extraction of tests which do not live in the current SUMO_HOME, doesn't it?

Walk up to the closest directory containing a testsuite instead of
stopping immediately when the test is not below SUMO_HOME/tests. This
keeps inherited options and configs for external tests while still
avoiding unrelated files such as SUMO_HOME/data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

extractTest.py includes sumo/data folder when extracting a test not under SUMO_HOME

3 participants