Skip to content

fix(ci): skip supertonic license/cpu tests when optional dep absent (unblocks releases) - #211

Merged
debpalash merged 1 commit into
mainfrom
fix/release-supertonic-test-skip
Jun 1, 2026
Merged

fix(ci): skip supertonic license/cpu tests when optional dep absent (unblocks releases)#211
debpalash merged 1 commit into
mainfrom
fix/release-supertonic-test-skip

Conversation

@debpalash

@debpalash debpalash commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Unblocks releases (the preview build died here)

Triggering the first preview build surfaced that release.yml can't get past its test gate: test_cpu_only_honest + test_license_gate fail because release installs deps with plain uv sync (no optional engines), so Supertonic3Backend.is_available() short-circuits with "supertonic package not installed" before reaching the license logic those tests assert on.

This blocked every release — preview and stable — not just the build that exposed it. (ci.yml passes because it uses uv sync --all-extras; the same 2 also fail on a local .venv without the extra.)

Fix: skip those two when supertonic isn't importable (it's an opt-in optional engine). They still run fully under ci.yml --all-extras; the absent-package path is already covered by test_optional_dep_missing.

Verified: tests/test_supertonic3.py8 passed, 5 skipped, 0 failed without supertonic installed.

Once this lands I'll re-trigger the preview build.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Improved test reliability by conditionally skipping tests when optional dependencies are not installed.

…bsent

release.yml installs deps with plain 'uv sync' (no optional engines), so
test_cpu_only_honest and test_license_gate failed there — is_available()
short-circuits with 'supertonic package not installed' before reaching the
license check those tests assert on. This blocked EVERY release (preview and
stable) at the test gate, not just the preview build that surfaced it.

Skip the two when 'supertonic' isn't importable (optional opt-in engine). They
still run fully under ci.yml's 'uv sync --all-extras'; the absent-package path
is covered independently by test_optional_dep_missing. Also fixes the same two
failing on a local '.venv' without the extra.

Verified: tests/test_supertonic3.py now 8 passed, 5 skipped, 0 failed without
supertonic installed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 1, 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: Pro Plus

Run ID: 6c8f1514-6c19-462d-99ad-cb7f5bd2c6b6

📥 Commits

Reviewing files that changed from the base of the PR and between 4772905 and 08eb0c1.

📒 Files selected for processing (1)
  • tests/test_supertonic3.py

📝 Walkthrough

Walkthrough

This PR adds conditional test skipping for two license-gate-related tests that depend on the optional supertonic package. The test suite now detects whether supertonic is installed at runtime and skips test_cpu_only_honest and test_license_gate when it is unavailable, improving test reliability in environments without the optional dependency.

Changes

Optional Supertonic Dependency Handling

Layer / File(s) Summary
Supertonic availability detection
tests/test_supertonic3.py
importlib.util is imported and _SUPERTONIC_INSTALLED flag is computed via importlib.util.find_spec("supertonic") to detect whether the optional dependency is discoverable at runtime.
Test skip conditions
tests/test_supertonic3.py
pytest.mark.skipif decorators are added to test_cpu_only_honest and test_license_gate, conditionally skipping them when supertonic is not installed.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description includes a clear problem statement, root cause analysis, and solution, but does not fully follow the provided template structure with explicit sections and checklist items. Fill out the formal template sections (Type, Testing, Checklist) to ensure consistency with repository standards and verify the checklist items are addressed.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: conditionally skipping two supertonic tests when the optional dependency is absent to unblock releases.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix/release-supertonic-test-skip

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@greptile-apps

greptile-apps Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a module-level _SUPERTONIC_INSTALLED flag (via importlib.util.find_spec) and gates test_cpu_only_honest and test_license_gate on it, so those tests skip gracefully when the supertonic optional extra is not installed (e.g., during release.yml which uses plain uv sync). The absent-package path remains covered by test_optional_dep_missing, and the full suite still runs under ci.yml --all-extras.

  • Adds _SUPERTONIC_INSTALLED = importlib.util.find_spec("supertonic") is not None at module level for a deterministic, collection-time skip signal.
  • Decorates test_cpu_only_honest and test_license_gate with @pytest.mark.skipif(not _SUPERTONIC_INSTALLED, ...) — matching the verified 8 passed / 5 skipped / 0 failed output without the package installed.

Confidence Score: 4/5

Safe to merge — the change is a targeted two-decorator addition that unblocks the release pipeline without removing any test coverage.

The fix is correct: importlib.util.find_spec at module load time is the right way to produce a stable, collection-time boolean for skipif. The absent-package scenario remains covered by test_optional_dep_missing, and the full suite still exercises the skipped tests under ci.yml --all-extras. The only gap is cosmetic — the new decorators are single-line while the existing smoke skip markers in the same file use multi-line style.

No files require special attention beyond the two style-only decorator formatting suggestions in tests/test_supertonic3.py.

Important Files Changed

Filename Overview
tests/test_supertonic3.py Adds _SUPERTONIC_INSTALLED guard and skipif decorators on two tests; logic is correct and consistent with the existing smoke-test skip pattern, but the new decorators use single-line style where the file elsewhere uses multi-line style for equivalent markers.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[pytest collects test_supertonic3.py] --> B["Module-level: _SUPERTONIC_INSTALLED = find_spec is not None"]
    B -->|"supertonic absent - release.yml"| C[_SUPERTONIC_INSTALLED = False]
    B -->|"supertonic present - ci.yml --all-extras"| D[_SUPERTONIC_INSTALLED = True]
    C --> E[test_cpu_only_honest - SKIP]
    C --> F[test_license_gate - SKIP]
    C --> G[test_optional_dep_missing - RUN]
    D --> H[test_cpu_only_honest - RUN]
    D --> I[test_license_gate - RUN]
    D --> J[test_optional_dep_missing - RUN]
    subgraph smoke ["Always skipped unless OMNIVOICE_SMOKE=1"]
        K[test_sha_resolves]
        L[test_smoke_3langs_3sec]
        M[test_sidecar_selftest]
    end
Loading

Fix All in Claude Code

Reviews (1): Last reviewed commit: "fix(ci): skip supertonic license/cpu tes..." | Re-trigger Greptile

Comment thread tests/test_supertonic3.py
Comment on lines +176 to 177
@pytest.mark.skipif(not _SUPERTONIC_INSTALLED, reason="supertonic optional dep not installed (uv sync --all-extras)")
def test_cpu_only_honest(mock_settings_store):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The new skipif decorators are single-line (116+ chars) while the existing SUPERTONIC_SMOKE skip markers in the same file use a multi-line form. Keeping the style consistent makes diffs and readability easier.

Suggested change
@pytest.mark.skipif(not _SUPERTONIC_INSTALLED, reason="supertonic optional dep not installed (uv sync --all-extras)")
def test_cpu_only_honest(mock_settings_store):
@pytest.mark.skipif(
not _SUPERTONIC_INSTALLED,
reason="supertonic optional dep not installed (uv sync --all-extras)",
)
def test_cpu_only_honest(mock_settings_store):

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

Comment thread tests/test_supertonic3.py
Comment on lines +208 to 209
@pytest.mark.skipif(not _SUPERTONIC_INSTALLED, reason="supertonic optional dep not installed (uv sync --all-extras)")
def test_license_gate(mock_settings_store):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Same single-line style inconsistency as the decorator above — wrapping to match the multi-line SUPERTONIC_SMOKE pattern already in the file.

Suggested change
@pytest.mark.skipif(not _SUPERTONIC_INSTALLED, reason="supertonic optional dep not installed (uv sync --all-extras)")
def test_license_gate(mock_settings_store):
@pytest.mark.skipif(
not _SUPERTONIC_INSTALLED,
reason="supertonic optional dep not installed (uv sync --all-extras)",
)
def test_license_gate(mock_settings_store):

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

@debpalash
debpalash merged commit cf816b5 into main Jun 1, 2026
15 checks passed
@debpalash
debpalash deleted the fix/release-supertonic-test-skip branch June 1, 2026 02:42
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