Skip to content

test: print the summary when a module does not load - #18

Merged
mcanouil merged 4 commits into
mainfrom
test/suite-summary-on-load-failure
Oct 29, 2026
Merged

mcanouil merged 4 commits into
mainfrom
test/suite-summary-on-load-failure

Conversation

@mcanouil

Copy link
Copy Markdown
Owner

The test suite could end without its summary line.
When a module failed to load, the loading section recorded the failure and carried on.
The first later section that used the missing module raised an error, and the run ended with no N checks, M failed line.

The suite now stops after loading when any module failed its load check.
It prints the usual summary line through one exit path and exits 1.
A module that loads but returns something other than a table now says what it returned.

I checked this by breaking paths.lua in a clean clone.
Before the change the run ended with exit 84 and no summary, and now it prints 11 checks, 1 failed and exits 1.
The healthy suite still gives 238 checks, 0 failed.
tests/ is not shipped, so this needs no release.

The loading section recorded a failed load and went on, then the first section that used the missing module raised and ended the run with no summary. The suite now stops after loading when a module failed, and prints the summary line through one exit path.
A module that loads and returns something other than a table failed the check with no detail and a stop line that said it did not load. Both now say what happened.
Not every later section indexes a loaded module, so the comment now says the stop is a choice and why.
The suite later replaces os.exit with a counting stub, so the helper now holds the real function from the start.
@mcanouil mcanouil added the Type: Refactor 🔥 Issues related to refactoring, restructuring, or cleaning up label Oct 29, 2026
@mcanouil mcanouil self-assigned this Oct 29, 2026
@mcanouil
mcanouil marked this pull request as ready for review October 29, 2026 11:31
@mcanouil
mcanouil merged commit 79eae7f into main Oct 29, 2026
2 checks passed
@mcanouil
mcanouil deleted the test/suite-summary-on-load-failure branch October 29, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Refactor 🔥 Issues related to refactoring, restructuring, or cleaning up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant