Commit Graph

13 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
46d633d3cd fix(ci): show full export error output for debugging
Increased error output from 100 to 500 chars and show both stdout
and stderr to help diagnose CI export failures.
2026-01-29 13:51:58 -05:00
Vijay Janapa Reddi
98c5415a5a fix: skip sync prompt in CI + increase milestone timeout
- Skip "sync to profile" prompt when not in interactive terminal
  (was hanging in CI waiting for input that never comes)
- Increase milestone timeout from 180s to 300s for heavy milestones
  (CNN and Transformer training can take 2-3 minutes on CI)
2026-01-28 11:54:23 -05:00
Vijay Janapa Reddi
a70c724a02 fix: export failure now blocks progress + add user journey test
Bug Fix:
- Export failures now return early in module complete, preventing
  progress from being updated when export fails. This fixes the issue
  where students could start Module 02 even though tensor.py was
  never exported.

New --user-journey test:
- Simulates exact student flow: module start --no-jupyter → module complete
- Runs milestones at natural unlock checkpoints (not all at end)
- Milestone checkpoints: after modules 03, 08, 09, 13, 19
- Explicit step-by-step output for easy CI debugging

New --no-jupyter flag:
- Added to 'tito module start' for CI/testing
- Creates notebook but skips opening Jupyter

Ref: https://github.com/harvard-edge/cs249r_book/discussions/1147
2026-01-28 09:28:15 -05:00
Vijay Janapa Reddi
223ce01d66 fix(tests): skip slow milestone tests in unit test runs
Unit tests now skip @pytest.mark.slow tests to avoid CI timeouts.
Milestone tests explicitly run all tests (including slow ones).

This ensures:
- Unit tests run quickly (~43s instead of timing out)
- Milestone tests still validate full milestone execution
- CI passes stages 1-5 reliably
2026-01-24 19:31:02 -05:00
Vijay Janapa Reddi
e19be54703 debug(tests): show import errors in CI output for debugging 2026-01-23 17:15:52 -05:00
Vijay Janapa Reddi
918f72e6a2 fix(tests): add PYTHONPATH to pytest subprocess for CI imports
The _run_pytest method was missing PYTHONPATH in the subprocess
environment, causing tinytorch imports to fail in CI where the
package isn't installed system-wide.
2026-01-23 17:11:21 -05:00
Vijay Janapa Reddi
c4c64ebc9a fix(ci): use dev export --all for package builds instead of module complete
- _build_package now uses 'tito dev export --all' which properly:
  1. Converts src/*.py to modules/*.ipynb (jupytext)
  2. Exports to tinytorch/core/ (nbdev_export)

- Fixes issue where 'module complete --all' didn't iterate through modules
- Added CI streaming output for better visibility during builds
- Each CI stage that needs the package will build it independently
2026-01-23 15:00:34 -05:00
Vijay Janapa Reddi
a44e76131b fix(ci): inline tests must export notebooks before module complete
The inline tests were calling 'module complete' directly, but the notebook
doesn't exist until 'dev export' creates it from src/.

Now the flow is:
1. tito dev export <module>  - Creates notebook from src/
2. tito module complete <module> - Runs tests and exports to core/

This matches the proper progressive build workflow.
2026-01-23 14:55:15 -05:00
Vijay Janapa Reddi
03417e2101 fix(ci): use 'module complete --all' to fully build package before tests
The previous approach used 'dev export --all' which only exports notebooks
but doesn't run inline tests or copy code to tinytorch/core/.

Now uses 'module complete --all' which:
1. Exports notebooks from src/ to modules/
2. Runs inline tests in each module
3. Copies tested code to tinytorch/core/

This ensures 'from tinytorch import Tensor' works in unit tests.
2026-01-23 14:52:09 -05:00
Vijay Janapa Reddi
e7fc890842 fix(ci): proper exit codes and error counting in test output
Critical fixes:
1. bin/tito now uses sys.exit(main()) to propagate exit codes
   - Previously the exit code was discarded, causing CI to pass even on failures

2. Collection errors are now counted and displayed
   - 'ERROR tests/...' lines (collection failures) are now tracked
   - Summary shows 'X errors, Y failed, Z passed' for clarity

Without these fixes, CI stages could show green even when tests failed.
2026-01-23 14:51:26 -05:00
Vijay Janapa Reddi
840eae5178 feat(ci): add verbose streaming output for all pytest-based tests
In CI mode, all test types (unit, CLI, integration, E2E, milestone) now show:
- Header with test type and path
- Per-test progress as they run (✓ PASSED / ✗ FAILED)
- Summary footer with counts

This makes CI logs much more informative - you can see exactly which tests
are running and their status in real-time.
2026-01-23 14:40:26 -05:00
Vijay Janapa Reddi
e1880011ff feat(ci): add verbose per-module output for inline tests
In CI mode, inline tests now show:
- Header with total module count
- Per-module progress: [1/20] Module 01: tensor... ✓ PASSED
- Error details if a module fails
- Summary footer with result

This makes CI logs much more informative for debugging.
2026-01-23 14:21:17 -05:00
Vijay Janapa Reddi
12af47b635 feat(cli): add unified tito dev test command
Introduces a comprehensive testing command with explicit test type flags:
- --inline: Progressive inline tests from src/ (nbgrader tests)
- --unit: Pytest unit tests
- --cli: CLI command tests
- --integration: Cross-module tests
- --e2e: End-to-end user journey tests
- --milestone: Historical milestone tests
- --all: Run all test types (except release)
- --release: Full destructive release validation
- --module N: Test specific module

Default behavior runs unit tests only.

This consolidates validate, provides clear test hierarchy, and
matches PyTorch's explicit, predictable interface philosophy.
2026-01-23 13:17:30 -05:00