Skip to content

fix(generation): give e2e spec files a wiki page - #1842

Merged
RaghavChamadiya merged 1 commit into
repowise-dev:mainfrom
sloemo01:fix/e2e-spec-pages
Sep 11, 2026
Merged

RaghavChamadiya merged 1 commit into
repowise-dev:mainfrom
sloemo01:fix/e2e-spec-pages

Conversation

@sloemo01

Copy link
Copy Markdown
Contributor

What

End-to-end test spec files (apps/*/e2e/**, *.spec.ts under an e2e/ tree, etc.) are silently dropped from ingestion entirely, so they never get a file_page. Because get_answer searches wiki pages, any question about test infrastructure comes back as five confident, unrelated files — with no signal a whole area is missing.

Root cause

The e2e directory is in _BLOCKED_DIRS in packages/core/src/repowise/core/ingestion/traverser.py. It was grouped with fixtures/ and conftest/ as "browser-driven test rigs whose content rarely answers code questions", but unlike those it silently excludes every file under an e2e/ directory before parsing — before a file_page could ever be selected. This is why the init summary reported only 2 by .gitignore, 1 by filename pattern, 18 oversized, 11 binary, 4 generated, 79 unknown type as exclusions: the e2e/ drop happened in the walker's blocklist, which the summary doesn't count.

Fix

Remove e2e from _BLOCKED_DIRS so e2e specs are traversed and parsed like any other test file. They are stamped is_test=True via is_test_related_path() (the e2e token was already in _TEST_DIR_TOKENS), so:

  • they get a file_page and are retrievable by get_answer, and
  • every existing downstream filter (skip_tests, scoring's test penalty, test-dilution handling) still works exactly as before.

This matches how tests/, spec/ and __tests__/ are already treated — the traverser comment already documented that those directories are indexed and tagged is_test=True.

Tests

  • Added test_traverses_e2e_specs to tests/unit/ingestion/test_traverser.py: an apps/console/e2e/** tree is traversed and every file is tagged is_test=True.
  • uv run ruff check . — all checks passed.
  • uv run pytest tests/unit/ingestion/ tests/unit/generation/ tests/unit/test_test_paths.py tests/unit/test_no_test_path_copies.py -q — all pass (one unrelated pre-existing git-rebase sandbox failure excluded).

Notes

The issue offered two acceptable resolutions: surface the skip (--include-tests flag / overview note) or just give e2e specs a page. Since these files are small, high-signal, and already meant to be indexed as tests (the #-comment above _BLOCKED_DIRS explicitly says test dirs are not blocked and are tagged is_test=True), making them actually indexed is the cleaner fix — no flag needed, and nothing is silently hidden.

e2e spec files were silently dropped from traversal via _BLOCKED_DIRS,
so they never reached file_page generation and get_answer could not
answer any test-infrastructure question, with no signal a whole area was
missing. Index them like other test files (tagged is_test=True so they
stay filterable), and add a regression test.

@Ayush7614 Ayush7614 left a comment

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.

Verified: packages/core/src/repowise/core/ingestion/traverser.py:223 removes e2e from _BLOCKED_DIRS so e2e specs are traversed and tagged is_test=True via is_test_related_path — fixes silent drop where file_page never created for test-infra questions. TestTraversesE2eSpecs covers apps/console/e2e tree. Matching handling to tests/spec. LGTM.

@RaghavChamadiya RaghavChamadiya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @sloemo01, and sorry this waited so long for a look.

This is the necessary half of #1497 and the reporter's own mechanism was one level off, which is worth recording. They wrote that e2e specs "are ingested but never get a file_page", and inferred the gap was in the page layer. It is not: _BLOCKED_DIRS is consulted during the directory walk itself (traverser.py:622), so an e2e/ directory is never descended into and no page could ever exist for anything inside it. Taking "e2e" out of that set is the only change that can fix it, and no amount of work in selection would have.

The safety properties that make this comfortable to take are worth naming, since the obvious worry is a large Playwright suite flooding the wiki. These files still come back is_test=True via is_test_related_path(), so --skip-tests and every downstream filter keep working, _PENALTY_TEST still down-ranks them in scoring so production code wins under a page cap, and max_file_pages still bounds the total. They become eligible, not privileged.

Rewriting the comment rather than deleting the line is the right instinct too. That block is a record of why each entry is there, and a silent deletion would have left the next reader assuming e2e was an oversight.

Note that #2018 also targets #1497, from a different angle (the importance floor and the test penalty in selection, which is the tests/-directory half rather than the e2e/ half). They are complementary rather than competing; I will say so on that thread.

@RaghavChamadiya
RaghavChamadiya merged commit 0bc04e9 into repowise-dev:main Sep 11, 2026
9 checks passed
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.

3 participants