Fix test discovery for ingots where lib.fe has no tests - #1304
Merged
Conversation
`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
force-pushed
the
test_discovery
branch
from
February 27, 2026 21:54
fdec699 to
279ce91
Compare
Collaborator
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
run_tests_ingotonly checked the root module (lib.fe) for#[test]functions viahas_test_functions(db, root_mod). Iflib.fecontained no tests, the entire ingot was silently skipped with "No testsfound" — even when other modules had tests.
ingot_has_test_functionsthat checks all modules in the ingot viaIngot::all_funcs, and use it in place of the root-module-only check.lib.fehas no tests while a sibling module (helper.fe) does.Reproduction
Create an ingot where
lib.feonly 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 testcorrectly discovers and runstest_add.Test plan
test_cli_test_ingot_discovers_tests_in_non_root_modulespasses with fix, fails withoutfe_test/fe_test_runnertests pass (49/49)