Skip to content

Fix test discovery for ingots where lib.fe has no tests - #1304

Merged
sbillig merged 1 commit into
argotorg:masterfrom
cburgdorf:test_discovery
Feb 28, 2026
Merged

Fix test discovery for ingots where lib.fe has no tests#1304
sbillig merged 1 commit into
argotorg:masterfrom
cburgdorf:test_discovery

Conversation

@cburgdorf

Copy link
Copy Markdown
Collaborator

Summary

  • run_tests_ingot only checked the root module (lib.fe) for #[test] functions via has_test_functions(db, root_mod). If lib.fe contained no tests, the entire ingot was silently skipped with "No tests
    found" — even when other modules had tests.
  • Add ingot_has_test_functions that checks all modules in the ingot via Ingot::all_funcs, and use it in place of the root-module-only check.
  • Add a regression test with an ingot fixture whose lib.fe has no tests while a sibling module (helper.fe) does.

Reproduction

Create an ingot where lib.fe only exports helpers and all #[test] functions live in other modules:

src/lib.fe ← pub fn add(a: u256, b: u256) -> u256 { ... } (no tests)
src/helper.fe ← #[test] fn test_add() { ... }

$ fe test .
Warning: No tests found in .

After this fix, fe test correctly discovers and runs test_add.

Test plan

  • New test test_cli_test_ingot_discovers_tests_in_non_root_modules passes with fix, fails without
  • All existing fe_test / fe_test_runner tests pass (49/49)

`run_tests_ingot` checked only the root module (lib.fe) for #[test]
functions before deciding whether to run tests. If lib.fe had no tests,
the entire ingot was skipped with "No tests found" even when sibling
modules contained tests.

Replace `has_test_functions(db, root_mod)` with a new
`ingot_has_test_functions(db, ingot)` that checks all modules in the
ingot via `Ingot::all_funcs`.

Add a regression test with an ingot fixture whose lib.fe exports a
helper but has no tests, while a sibling module contains the only test.
@cburgdorf

Copy link
Copy Markdown
Collaborator Author

@codex review

@cburgdorf
cburgdorf requested a review from sbillig February 27, 2026 21:55
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sbillig
sbillig merged commit a2a8f65 into argotorg:master Feb 28, 2026
5 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.

2 participants