Skip to content

Skip Java source placeholders in local test planning - #36553

Merged
pmbrull merged 2 commits into
mainfrom
pmbrull/skip-empty-java-test-sources
Nov 1, 2026
Merged

pmbrull merged 2 commits into
mainfrom
pmbrull/skip-empty-java-test-sources

Conversation

@pmbrull

@pmbrull pmbrull commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Describe your changes

Fix local Java test planning selecting TODO-only source files as runnable tests and then reporting missing test results. Require a matching class declaration for both unit and integration test discovery, while keeping classes with inherited tests eligible.

Test-tooling fix; no linked issue.

Type of change

  • Bug fix

High-level design

Reuse the class-declaration check after stripping comments. Read candidate files in batches for both working-tree and committed-tree discovery.

Tests

Planner regression tests

  • Two isolated regression cases pass with this change and fail with the original planner. They cover empty and comment-only files, commented-out declarations, inherited tests, and both source views.
  • A separate positive check confirms real MCP and LLM service tests are selected, regardless of whether the MCP service placeholder is implemented.
  • Full planner suite: 56 passed, 3 pre-existing failures. The same three existing tests fail with the base planner at 6efd86bca46: two ownership audits flag IdBatchesIT and CustomPropertyReferences.java, and the lane assertion expects only SystemResourceIT in its command.
  • ruff check, ruff format --check, and git diff --check passed.

Backend integration tests

Local Java test run: NOT NEEDED — no Java unit or integration test is impacted.

  • Commit: d705edb6c2ce (base origin/main)

Playwright and ingestion tests

No UI or ingestion changes. The Playwright planner could not complete dependency expansion because local @playwright/test is unavailable; no Playwright tests were run.

Manual testing and UI recording

Checked the actual source inventory and regression plans. No manual UI run or recording applies to this test-tooling change.

Checklist

  • Regression coverage added; baseline failures recorded above.
  • Self-review of d705edb6c2ce against REVIEW.md: no blocking findings.
  • Decision check: no new contract, default, or configuration.

Select Java sources only when they declare the named test class.
Preserve inherited-test classes and batch reads of committed sources.
@pmbrull pmbrull added the skip-pr-checks Bypass PR metadata validation check label Oct 29, 2026
@pmbrull
pmbrull requested review from a team, akash-jain-10, harshach and tutte as code owners October 29, 2026 13:11
@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Oct 29, 2026
Keep placeholder exclusion covered by temporary test sources.
The live plan check only asserts that real service tests are selected.
@gitar-bot

gitar-bot Bot commented Oct 29, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 closed / 1 findings

🟡 Medium risk · Requiring class declarations during local Java test discovery could omit legitimate tests if parsing misses valid declarations, reducing planned test coverage.

Restricts local Java test discovery to files with a matching class declaration after stripping comments, so TODO-only source placeholders are no longer selected as runnable tests. The regression test that relied on a live TODO placeholder was decoupled and now passes against the fixed planner. No open issues found.

✅ 1 closed
✅ Quality: Regression test depends on a live TODO placeholder staying unimplemented

📄 .github/scripts/test_plan_local_java_tests.py:399-405
test_ai_context_plan_excludes_the_empty_mcp_service_placeholder runs against the real checkout. It asserts that McpServiceResourceIT is not selected only because that file currently holds nothing but a TODO comment. Once someone writes the IT (the TODO asks for exactly that), the class will be selected correctly and this test will fail even though the planner works, so the test breaks on a legitimate change. The behaviour is already covered by the hermetic test_discovery_skips_placeholders_and_keeps_inherited_test_classes, so drop the McpServiceResourceIT assertion. Alternatively, make the test skip itself once that file declares the class.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@pmbrull
pmbrull added this pull request to the merge queue Oct 30, 2026
@Vishnuujain Vishnuujain mentioned this pull request Oct 30, 2026
7 of 11 tasks
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-10-31T00:49:24Z)

Blocked the queue: playwright-summary

Failed Playwright tests:

  • Features/OntologyFirstRun.spec.ts › creates an ontology from scratch and lands in Edit with the New class panel
  • Features/OntologyNativeAuthoring.spec.ts › a competing lease leaves no partial class and the form stays usable
  • Features/OntologyNativeAuthoring.spec.ts › creates every class field atomically, preserves free space, and cancels provisional relations
  • Features/OntologyNativeExport.spec.ts › downloads every format of the current ontology release, then gates on SHACL
  • Features/OntologyNativeStudio.spec.ts › authors a native model through the shared View, Edit, and Query shell

@pmbrull
pmbrull added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit c7cb6f1 Nov 1, 2026
75 checks passed
@pmbrull
pmbrull deleted the pmbrull/skip-empty-java-test-sources branch November 1, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants