Skip to content

fix: testmodule: find the scenario file under each name twister reads - #12

Merged
tobiaskaestner merged 1 commit into
mainfrom
tkaestner/testmodule-tests-yaml
Oct 2, 2026
Merged

tobiaskaestner merged 1 commit into
mainfrom
tkaestner/testmodule-tests-yaml

Conversation

@tobiaskaestner

Copy link
Copy Markdown
Contributor

Summary

The scenario table of .. testmodule:: read only <module>/testcase.yaml. Newer Zephyr trees name this file tests.yaml. So on such a tree, every test module logged "could not read …testcase.yaml", and the table was missing.

This PR takes the first of testcase.yaml, tests.yaml and sample.yaml that exists. These are the names that twister reads, in twister's order (scripts/pylib/twister/twisterlib/testplan.py). Projects on an older Zephyr keep working.

  • rst_builders.find_scenario_yaml() finds the file. When no file exists, the warning names each file it tried.
  • .. testmodule:: records all three names as inputs. A scenario file that is added or renamed later also re-reads the document.
  • The two manual pages that named testcase.yaml now name all three.

Test

  • Unit suite: 403 passed (399 before). The new tests cover these cases:
    • only tests.yaml exists;
    • only sample.yaml exists;
    • all three exist, and testcase.yaml wins;
    • no file exists, and the warning names the files.
  • Clean build of the Zephyr safety document set (Zephyr with tests.yaml), main compared with this branch:
    • "could not read …testcase.yaml": 435 → 0;
    • test specification pages with a scenario table: 0 → 188;
    • Sphinx warnings, doc-check, testspec-check and satisfies-check: no change;
    • the test specification needs keep the same 1207 ids. Only lineno changes, because of the new tables.

🤖 Generated with Claude Code

The scenario table read only <module>/testcase.yaml. Newer Zephyr trees
name the file tests.yaml, so every test module warned that it could not
read testcase.yaml, and the table was missing.

Take the first of testcase.yaml, tests.yaml and sample.yaml that exists,
in twister's order (twisterlib/testplan.py). Older trees keep working.
Each name is an input of the document. When no file exists, the warning
names the files it tried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tobias Kaestner <tobias.kaestner@inovex.de>
@tobiaskaestner
tobiaskaestner merged commit 7f1b9d5 into main Oct 2, 2026
2 checks passed
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.

1 participant