Skip to content

feat(test): recursive test discovery + subfolder selection#1218

Open
briacbln wants to merge 1 commit into
getnao:mainfrom
briacbln:feat/recursive-test-discovery
Open

feat(test): recursive test discovery + subfolder selection#1218
briacbln wants to merge 1 commit into
getnao:mainfrom
briacbln:feat/recursive-test-discovery

Conversation

@briacbln

@briacbln briacbln commented Jul 20, 2026

Copy link
Copy Markdown

Closes #935

What

  • discover_tests recurses into tests/ subfolders via rglob (was top-level glob, silently skipping nested files)
  • filter_test_cases gains an optional tests_dir param, letting -s/--select scope to a whole subfolder (e.g. nao test -s contracts runs all of tests/contracts/) in addition to the existing name/stem selection
  • tests/outputs/ is excluded from discovery

Why

With tests organized under tests/contracts/, tests/segments/, etc., nao test reported "Found 1 test(s)" with no warning — nested files were silently ignored.

Compatibility

  • Two-arg filter_test_cases calls unchanged (tests_dir defaults to None)
  • Flat tests/ layouts behave exactly as before
  • All existing tests pass; added coverage for recursive discovery, folder selection, and the outputs/ exclusion

Design note

Folder match takes precedence over name match in filter_test_cases. In practice folder and test names don't collide; happy to invert or raise on ambiguity if preferred.

Review in cubic

@github-actions

Copy link
Copy Markdown
Contributor

This PR was auto-closed. Only contributors approved with lgtm can open PRs. Open an issue first.

Maintainers review auto-closed issues daily. Issues that do not meet the quality bar in CONTRIBUTING.md will not be reopened or receive a reply.

If a maintainer replies lgtmi, your future issues will stay open. If a maintainer replies lgtm, your future issues and PRs will stay open.

See CONTRIBUTING.md.

@github-actions github-actions Bot closed this Jul 20, 2026
@Bl3f Bl3f reopened this Jul 20, 2026
@briacbln
briacbln force-pushed the feat/recursive-test-discovery branch 2 times, most recently from eb92855 to 356d0bc Compare July 21, 2026 06:08
Closes getnao#935. discover_tests now recurses into tests/ subfolders (was
top-level only, silently skipping nested files). filter_test_cases
accepts an optional tests_dir to select a whole subfolder via -s/--select
(e.g. `nao test -s contracts`). Backward compatible: two-arg calls and
flat layouts unchanged. Excludes tests/outputs/ from discovery.

Signed-off-by: briacbln <briac.belin@gmail.com>
@briacbln
briacbln force-pushed the feat/recursive-test-discovery branch from 356d0bc to 2514298 Compare July 21, 2026 10:24

@Bl3f Bl3f left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, ty for this first contribution, welcome to the nao community!

@Bl3f

Bl3f commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

(tho you have Ruff failing)

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.

[feature] Support subfolders in tests/ with selective test execution

2 participants