#6915

code-modernization: tooling_only() does not recognise JS e2e harnesses (*.e2e.mjs + helpers) or test-oracle folders

Openpiotrlaczykowskiopened 3d ago

Plugin: code-modernization 1.0.0, scripts/trace_rules.py tooling_only() / file_kind().

What happens: the commands say a folder holding only test code and the files that build it is test tooling, listed "not judged". A typical JavaScript browser e2e harness is not recognised:

e2e/
  package.json
  run-e2e.sh
  laborant.e2e.mjs   device.e2e.mjs   field.e2e.mjs   exchange.e2e.mjs   # the tests
  junit.mjs  junit.test.mjs  load.mjs  seed-users.mjs  wait-for.mjs        # helpers used only by the tests
  • TEST_NAME does not match *.e2e.mjs / *.e2e.ts (a common Playwright/Cypress naming), so the tests count as main code.
  • Helper modules that only the tests import (wait-for.mjs, seed-users.mjs, a JUnit writer) and a run-*.sh count as main code.

So the folder is judged as a module and gets "No equivalence cases", "Fresh inputs" gaps it can never close. The same happens to a folder of test oracles (independent re-implementations used only to check the product, plus their fixtures).

Suggested fix (minimal):

  • add \.e2e\.[^.]+$ (and maybe \.cy\.[^.]+$) to TEST_NAME;
  • treat a module whose own folder name is in TEST_DIRS or is e2e as test tooling when it has at least one test file, or
  • let a person declare it in the module notes (Test tooling: <reason>), listed in VERIFICATION.md like the automatic case.

Moving files into a test/ folder only to satisfy the heuristic would change the repo layout without proving anything, so a declared path seems better than renaming.

Activity

0

No activity yet.