[PR #1878] [CLOSED] fix module complete: integration tests never ran and empty notebooks silently passed #33431

Closed
opened 2026-07-13 12:04:04 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1878
Author: @Shashank-Tripathi-07
Created: 6/16/2026
Status: Closed

Base: mainHead: fix/module-complete-integration-tests-never-run


📝 Commits (3)

  • 1da2e97 fix integration tests never running and empty notebooks silently passing
  • 96b1075 fix(module): empty notebook blocks tito module complete with false unit test failure
  • 48577b2 fix(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_tests looked for test_progressive_integration.py in each module's test directory. That file does not exist anywhere. The actual files follow the pattern test_NN_<name>_progressive.py (e.g. test_01_tensor_progressive.py, test_06_autograd_progressive.py). Because the file was never found, step 3 in tito module complete always returned passed=0 failed=0 silently, meaning no student has ever had their exported implementation validated by integration tests.

Fixed by adding _find_integration_test_file which looks for test_NN_*_progressive.py first (matching the module number prefix), then falls back to any test_*_progressive.py in the module directory.

Bug 2: empty notebooks silently passed unit tests

_parse_test_output entered a branch where tests stayed [] when a process exited 0 with no stdout and no stderr. complete_module then saw failed == 0 and proceeded to export. A student whose notebook is empty, has all code commented out, or whose if __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 01 now runs tests/01_tensor/test_01_tensor_progressive.py in step 3
  • A module with an empty notebook exits 1 at step 1 instead of silently passing
  • Modules with no progressive test file still skip gracefully with a dim warning
  • Normal passing notebooks are unchanged

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1878 **Author:** [@Shashank-Tripathi-07](https://github.com/Shashank-Tripathi-07) **Created:** 6/16/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/module-complete-integration-tests-never-run` --- ### 📝 Commits (3) - [`1da2e97`](https://github.com/harvard-edge/cs249r_book/commit/1da2e978c042ff34b2582b182b3bc0a028a2275e) fix integration tests never running and empty notebooks silently passing - [`96b1075`](https://github.com/harvard-edge/cs249r_book/commit/96b1075a0785b7ee73190fa8d2b7bfab31dcb735) fix(module): empty notebook blocks tito module complete with false unit test failure - [`48577b2`](https://github.com/harvard-edge/cs249r_book/commit/48577b26e586591b1689e036ba50dd40463b254e) fix(module): replace src unit test step with actual notebook syntax check ### 📊 Changes **1 file changed** (+75 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `tinytorch/tito/commands/module/workflow.py` (+75 -20) </details> ### 📄 Description ## Two bugs, one PR ### Bug 1: integration tests never ran for any module `_run_integration_tests` looked for `test_progressive_integration.py` in each module's test directory. That file does not exist anywhere. The actual files follow the pattern `test_NN_<name>_progressive.py` (e.g. `test_01_tensor_progressive.py`, `test_06_autograd_progressive.py`). Because the file was never found, step 3 in `tito module complete` always returned `passed=0 failed=0` silently, meaning no student has ever had their exported implementation validated by integration tests. Fixed by adding `_find_integration_test_file` which looks for `test_NN_*_progressive.py` first (matching the module number prefix), then falls back to any `test_*_progressive.py` in the module directory. ### Bug 2: empty notebooks silently passed unit tests `_parse_test_output` entered a branch where `tests` stayed `[]` when a process exited 0 with no stdout and no stderr. `complete_module` then saw `failed == 0` and proceeded to export. A student whose notebook is empty, has all code commented out, or whose `if __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 01` now runs `tests/01_tensor/test_01_tensor_progressive.py` in step 3 - [ ] A module with an empty notebook exits 1 at step 1 instead of silently passing - [ ] Modules with no progressive test file still skip gracefully with a dim warning - [ ] Normal passing notebooks are unchanged --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-07-13 12:04:04 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#33431