Repository navigation
fix(generation): give e2e spec files a wiki page - #1842
Conversation
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
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
What
End-to-end test spec files (
apps/*/e2e/**,*.spec.tsunder ane2e/tree, etc.) are silently dropped from ingestion entirely, so they never get afile_page. Becauseget_answersearches 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
e2edirectory is in_BLOCKED_DIRSinpackages/core/src/repowise/core/ingestion/traverser.py. It was grouped withfixtures/andconftest/as "browser-driven test rigs whose content rarely answers code questions", but unlike those it silently excludes every file under ane2e/directory before parsing — before afile_pagecould ever be selected. This is why the init summary reported only2 by .gitignore, 1 by filename pattern, 18 oversized, 11 binary, 4 generated, 79 unknown typeas exclusions: thee2e/drop happened in the walker's blocklist, which the summary doesn't count.Fix
Remove
e2efrom_BLOCKED_DIRSso e2e specs are traversed and parsed like any other test file. They are stampedis_test=Trueviais_test_related_path()(thee2etoken was already in_TEST_DIR_TOKENS), so:file_pageand are retrievable byget_answer, andskip_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 taggedis_test=True.Tests
test_traverses_e2e_specstotests/unit/ingestion/test_traverser.py: anapps/console/e2e/**tree is traversed and every file is taggedis_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-testsflag / 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_DIRSexplicitly says test dirs are not blocked and are taggedis_test=True), making them actually indexed is the cleaner fix — no flag needed, and nothing is silently hidden.