Skip to content

test: skip optional-extra tests when the extra is not installed (#4190) - #4193

Open
yatharth1706 wants to merge 1 commit into
Graphify-Labs:v8from
yatharth1706:fix/4190-skip-tests-without-extras
Open

yatharth1706 wants to merge 1 commit into
Graphify-Labs:v8from
yatharth1706:fix/4190-skip-tests-without-extras

Conversation

@yatharth1706

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #4190.

Tests that need an optional extra (erlang, r, solidity, vbnet, ollama, sql) failed instead of skipping on a default uv sync, which is the setup CONTRIBUTING.md tells contributors to use. CI runs uv sync --all-extras, so it never showed up there.

Changes:

  • Erlang / R / Solidity / VB.NET: add a _needs_<lang> skip marker using the existing pattern from tests/test_languages.py (pytest.mark.skipif(find_spec(...) is None)), applied to every test that needs the grammar.
  • The *_missing_parser_reports_install_hint tests are left unmarked on purpose. They simulate the absent grammar themselves, so they keep running on a default install.
  • Ollama: pytest.importorskip("openai"), since all 4 tests patch openai.OpenAI.
  • SQL encoding: only the schema.sql case is skipped; the PowerShell and Svelte cases in the same test still run.
  • CONTRIBUTING.md: recommend uv sync --all-extras for a full local run, matching CI.

No production code changed.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Tests or CI
  • Refactor
  • Security fix

Verification & Invariants

  • Read the CONTRIBUTING.md guide.
  • Reproduced the issue and identified the invariant.
  • Made the smallest fix necessary.
  • Added a regression test (if bug fix) or isolated boundary test.
  • Kept the PR description synchronized with the final implementation.
  • Documented any limitations / unsupported cases explicitly.

How was this tested?

# Before (default install)
uv sync --frozen && uv run --frozen pytest tests/ -q
→ 35 failed, 6533 passed, 106 skipped

# After, the 6 affected files
uv sync --frozen
uv run --frozen pytest tests/test_erlang_extractor.py tests/test_r_extractor.py tests/test_solidity_extractor.py tests/test_vbnet_extractor.py tests/test_ollama_retry_cap.py tests/test_source_file_encoding.py -q
→ 45 passed, 34 skipped (missing-parser tests for erlang/r/solidity/vbnet still run and pass)

uv sync --all-extras --frozen
→ same 6 files: 82 passed

uv run --frozen ruff check <changed files>   → All checks passed
uv run --frozen pyright <changed files>      → 0 errors

Graphify-specific checklist

  • I updated generated skill artifacts (uv run python -m tools.skillgen --bless) when changing their source fragments.
  • I confirmed that AST/structural extraction remains deterministic (no ambient state dependencies like ENV variables).
  • I reviewed changes for security implications (no unsafe interpolation into shell/Python).
  • I confirmed no API keys or local-only graph data are included.
  • (If applicable) I disclosed AI authorship in my commit messages.

…hify-Labs#4190)

Grammar and SDK tests for erlang, r, solidity, vbnet, ollama and the sql encoding case failed instead of skipping on a default uv sync. Guard them with the existing _needs_* skipif pattern and point CONTRIBUTING at uv sync --all-extras to match CI.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

Thanks for the pull request, @yatharth1706. A maintainer will review it soon.

Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions.

A couple of things that speed up review: make sure the test suite passes on Python 3.10 and 3.13, and that the change keeps extraction deterministic.

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Graphify reviewed this change.

Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).


Graphify review — findings

Skips the Erlang, R and Solidity grammar tests when their optional tree-sitter packages aren't installed, and the Ollama retry tests when openai is missing, so a plain uv sync checkout runs cleanly. The missing-parser install-hint tests still run because they simulate the absent grammar themselves. CONTRIBUTING.md now recommends uv sync --all-extras to match CI; without it, the skipped tests go unexercised locally.

No blocking issues surfaced. 1 lower-confidence candidate did not survive cross-model review.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 108 functions depend on the 108 functions this change touches.

Health — grade A; no new coupling hotspots.

Verification — 108 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 108 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

337 of 337 test file(s) selected (100%) via static blast radius.

Escalated to a full run for safety — the selection is not trustworthy on its own (see below). CI should run the whole suite.

  • tests/test_affected_cli.py — full-run-safety
  • tests/test_affected_member_seed.py — full-run-safety
  • tests/test_agents_platform.py — full-run-safety
  • tests/test_analyze.py — full-run-safety
  • tests/test_anthropic_custom_endpoint.py — full-run-safety
  • tests/test_antigravity_install.py — full-run-safety
  • tests/test_apm_fallback_version.py — full-run-safety
  • tests/test_architecture_doc.py — full-run-safety
  • tests/test_astro_extraction.py — full-run-safety
  • tests/test_astro_import_ids.py — full-run-safety
  • tests/test_atomic_canvas_export.py — full-run-safety
  • tests/test_atomic_version_stamp.py — full-run-safety
  • tests/test_atomic_writes.py — full-run-safety
  • tests/test_backend_env_isolation.py — full-run-safety
  • tests/test_backend_extras.py — full-run-safety
  • tests/test_benchmark.py — full-run-safety
  • tests/test_benchmark_raw_graph.py — full-run-safety
  • tests/test_blade_extractor.py — full-run-safety
  • tests/test_build.py — full-run-safety
  • tests/test_build_located_semantic_identity.py — full-run-safety
  • tests/test_build_merge_dedup_scope.py — full-run-safety
  • tests/test_build_merge_hyperedges_and_prune.py — full-run-safety
  • tests/test_build_merge_shrink_guard.py — full-run-safety
  • tests/test_builtin_global_type_refs.py — full-run-safety
  • tests/test_cache.py — full-run-safety
  • tests/test_callflow_html.py — full-run-safety
  • tests/test_cargo_introspect.py — full-run-safety
  • tests/test_cargo_missing_manifest.py — full-run-safety
  • tests/test_carried_hyperedge_remap.py — full-run-safety
  • tests/test_case_sensitive_resolution.py — full-run-safety
  • tests/test_charmap_encoding.py — full-run-safety
  • tests/test_chunking.py — full-run-safety
  • tests/test_cjs_module_extension.py — full-run-safety
  • tests/test_claude_cli_backend.py — full-run-safety
  • tests/test_claude_md.py — full-run-safety
  • tests/test_cli_broken_pipe.py — full-run-safety
  • tests/test_cli_export.py — full-run-safety
  • tests/test_cli_help.py — full-run-safety
  • tests/test_cluster.py — full-run-safety
  • tests/test_cluster_exclude_hubs.py — full-run-safety
  • tests/test_cobol_extractor.py — full-run-safety
  • tests/test_codebuddy.py — full-run-safety
  • tests/test_community_hub_labels.py — full-run-safety
  • tests/test_community_labels_skill.py — full-run-safety
  • tests/test_confidence.py — full-run-safety
  • tests/test_corrupt_graph_json.py — full-run-safety
  • tests/test_cpp_method_declarations.py — full-run-safety
  • tests/test_cpp_nested_and_cli.py — full-run-safety
  • tests/test_cpp_objc_cross_file_calls.py — full-run-safety
  • tests/test_cpp_preprocess.py — full-run-safety
  • … and 287 more

non-code file(s) changed (CONTRIBUTING.md) → running the full suite for safety (a code graph can't see config/fixture/data deps)

changed code file(s) with no mapped test (CONTRIBUTING.md) — a coverage gap or a missing link — running the full suite rather than only the selected tests

Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.

This branch has not been deployed

No deployments
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.

[Bug]: Optional-grammar tests fail instead of skipping on a default uv sync

1 participant