mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-17 08:28:07 -05:00
[PR #1878] fix module complete: integration tests never ran and empty notebooks silently passed #27339
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1878
Author: @Shashank-Tripathi-07
Created: 6/16/2026
Status: 🔄 Open
Base:
main← Head:fix/module-complete-integration-tests-never-run📝 Commits (3)
1da2e97fix integration tests never running and empty notebooks silently passing96b1075fix(module): empty notebook blocks tito module complete with false unit test failure48577b2fix(module): replace src unit test step with actual notebook syntax check📊 Changes
1 file changed (+75 additions, -20 deletions)
View changed files
📝
tinytorch/tito/commands/module/workflow.py(+75 -20)📄 Description
Two bugs, one PR
Bug 1: integration tests never ran for any module
_run_integration_testslooked fortest_progressive_integration.pyin each module's test directory. That file does not exist anywhere. The actual files follow the patterntest_NN_<name>_progressive.py(e.g.test_01_tensor_progressive.py,test_06_autograd_progressive.py). Because the file was never found, step 3 intito module completealways returnedpassed=0 failed=0silently, meaning no student has ever had their exported implementation validated by integration tests.Fixed by adding
_find_integration_test_filewhich looks fortest_NN_*_progressive.pyfirst (matching the module number prefix), then falls back to anytest_*_progressive.pyin the module directory.Bug 2: empty notebooks silently passed unit tests
_parse_test_outputentered a branch wheretestsstayed[]when a process exited 0 with no stdout and no stderr.complete_modulethen sawfailed == 0and proceeded to export. A student whose notebook is empty, has all code commented out, or whoseif __name__ == '__main__'block is missing would produce exactly this: Python exits 0 with no output.Fixed by adding a failure entry when returncode is 0 but there is no output at all, with a message pointing the student toward the missing test output.
Test plan
tito module complete 01now runstests/01_tensor/test_01_tensor_progressive.pyin step 3🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.