Skip to content

Test Puzzletron Fire import behavior - #2184

Merged
j-rausch merged 1 commit into
feature/puzzletron_v2from
jrausch/puzzletron-import-boundary-test
Aug 12, 2026
Merged

Test Puzzletron Fire import behavior#2184
j-rausch merged 1 commit into
feature/puzzletron_v2from
jrausch/puzzletron-import-boundary-test

Conversation

@j-rausch

@j-rausch j-rausch commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Type of change: new tests

Consolidates Puzzletron optional-dependency import coverage into one focused module. It replaces source-text inspection of the dataset preparation entry point with a fresh-interpreter behavior test that verifies regular imports do not require Fire and CLI execution dispatches to process_and_save_dataset.

This preserves the existing five-case import-boundary contract while removing redundant test surface.

Testing

Existing Puzzletron unit CI covers the consolidated import-boundary test. The behavioral case also detects injected top-level Fire imports and missing CLI dispatch.

The full local Puzzletron suite was not run because its pinned NeMo AutoModel dependency was unavailable; the dedicated CI session installs that dependency.

Summary by CodeRabbit

  • Tests
    • Expanded import-boundary regression coverage for dataset modules and command-line execution.
    • Added checks ensuring lightweight imports avoid unnecessary initialization and preserve configuration isolation.
    • Added coverage for missing optional modules and expected model-loading errors.
    • Removed redundant tests superseded by the broader regression suite.

Signed-off-by: Johannes Rausch <jrausch@nvidia.com>
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: da697104-32d6-4bff-8fda-783afdde096d

📥 Commits

Reviewing files that changed from the base of the PR and between 5da9a05 and 4339672.

📒 Files selected for processing (2)
  • tests/unit/torch/puzzletron/test_import_boundary.py
  • tests/unit/torch/puzzletron/test_prepare_dataset_imports.py
💤 Files with no reviewable changes (1)
  • tests/unit/torch/puzzletron/test_prepare_dataset_imports.py

📝 Walkthrough

Walkthrough

The pull request generalizes Puzzletron import-boundary subprocess tests and adds coverage that fire loads only during CLI execution. It removes the dedicated prepare_dataset import test and preserves checks for lightweight imports, isolation, torch initialization, and missing AutoModel errors.

Changes

Puzzletron import-boundary regression coverage

Layer / File(s) Summary
Generalized import-boundary probes
tests/unit/torch/puzzletron/test_import_boundary.py, tests/unit/torch/puzzletron/test_prepare_dataset_imports.py
The tests use a configurable fresh-interpreter helper, preserve optional AutoModel error checks, and retain import isolation assertions. The dedicated prepare_dataset test file was removed.
CLI-only Fire execution
tests/unit/torch/puzzletron/test_import_boundary.py
A subprocess test verifies that prepare_dataset imports without fire and invokes fire.Fire only when executed as __main__.

Estimated code review effort: 2 (Simple) | ~10 minutes

Mergeability Score: ⚪ Minimal · up to 43396

This localized test-only change consolidates import-boundary coverage without altering product behavior; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the PR's main change: testing Puzzletron's Fire import behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Security Anti-Patterns ✅ Passed HEAD changes only two tests; no modelopt package or examples Python files changed, and the added-line scan found no prohibited security patterns.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jrausch/puzzletron-import-boundary-test

Comment @coderabbitai help to get the list of available commands.

@j-rausch
j-rausch merged commit 6f1da0f into feature/puzzletron_v2 Aug 12, 2026
42 checks passed
@j-rausch
j-rausch deleted the jrausch/puzzletron-import-boundary-test branch August 12, 2026 23:36
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.15%. Comparing base (5da9a05) to head (4339672).
⚠️ Report is 2 commits behind head on feature/puzzletron_v2.

Additional details and impacted files
@@                  Coverage Diff                   @@
##           feature/puzzletron_v2    #2184   +/-   ##
======================================================
  Coverage                  53.15%   53.15%           
======================================================
  Files                        704      704           
  Lines                      91506    91506           
======================================================
  Hits                       48640    48640           
  Misses                     42866    42866           
Flag Coverage Δ
puzzletron 31.42% <ø> (ø)
unit 29.54% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-12 23:37 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant