Skip to content

refactor(vscode): split tests out of src into sibling tests/ and e2e/ trees - #7

Merged
fi3ework merged 4 commits into
mainfrom
chore/unit-tests-out-of-src
Aug 7, 2026
Merged

refactor(vscode): split tests out of src into sibling tests/ and e2e/ trees#7
fi3ework merged 4 commits into
mainfrom
chore/unit-tests-out-of-src

Conversation

@fi3ework

@fi3ework fi3ework commented Aug 7, 2026

Copy link
Copy Markdown
Member

What

Stacked on #6. Pure relocation — no test changed what it asserts.

The unit suites sat next to the modules they cover, so src/ (the tree that produces the published bundle) also held 17 test files and a text fixture, and the E2E harness sat one level deeper than it needed to. The package now has three siblings:

packages/vscode/
  src/     source only
  tests/   the Rstest unit suites, mirroring src/
  e2e/     the extension-host suites (tsc -> tests-dist/)

rstest.config.mts and tsconfig.json already named the destination, so the moves themselves were the easy half. The rest is everything that was depth-sensitive:

  • Suite imports into src/ lose one .. in tests/, and one more in e2e/ (both trees came up a level).
  • Every harness climbs one fewer level out of tests-dist/runTest.ts x3 and the rstest FIXTURES_ROOT each drop a .., and the compiled entry points move from tests-dist/tests/e2e/... to tests-dist/e2e/....
  • Path literals and globs follow the trees: the package scripts, both tsconfigs, the Rstest include/exclude, the lint and fmt ignore globs in the root rstack.config.ts, the playground fixture list in .vscode/launch.json, and one CI comment.
  • .gitignore kept fixture installs untracked through four rules under the old path. They stopped matching the moment the tree moved, which surfaced as fixture lockfiles turning up untracked; they now point at e2e/.

src/stacks/fmt/stubProcess.ts moves with the suites that use it — it was always test-only scaffolding, never a build entry. src/stacks/test/parse.fixture.txt moves for the same reason; it was the one non-.ts file under src/.

The second commit removes an include from tsconfig.e2e.json that pointed at src/shell/detection.ts and src/shell/types.ts, a path this package has never had. tsc ignores a non-matching include pattern when another one matches, so it was inert: the suites always reached those modules through their own imports.

Test plan

Every gate run locally against the new layout, with tests-dist/ deleted first so no stale compile could mask a broken path:

  • pnpm lint — 0 errors, 0 type errors.
  • pnpm test:unit — 19 files, 165 passing, the same set as before the move.
  • pnpm build — clean.
  • All four E2E harnesses exit 0, since each one's __dirname climb changed: test:e2e:smoke, test:e2e:vscode, test:e2e:rstest:run, test:e2e:lint:run (8 suites).

Fixture file contents are byte-identical — they were renamed, never rewritten, and the pre-commit rs fmt skips them through the ignore globs.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eef7bebd3c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .gitignore
Base automatically changed from feat/fmt-prewarm to main August 7, 2026 08:40
… trees

The unit suites lived next to the modules they cover, which put test files and
one test fixture inside the tree that produces the published bundle, and put
the E2E harness a level deeper than it needed to be. The package now has three
siblings: src/ is source only, tests/ mirrors it with the Rstest suites, and
e2e/ holds the extension-host suites.

Nothing about what the tests assert changed — only where they live and the
paths that reach them. Rstest and tsconfig already listed the destination, so
the moves are the smaller half of the diff; the rest is the paths that were
depth-sensitive. Every harness climbs one fewer level out of tests-dist/ now,
so runTest and the fixture roots lose a '..' each, and both the config globs
and the gitignore rules that keep fixture installs untracked follow the trees
to their new homes.
The E2E tsconfig listed `src/shell/detection.ts` and `src/shell/types.ts`, a
path that has never existed here — the shell's modules sit directly under
`src/`. tsc ignores an include pattern that matches nothing as long as another
pattern matches, so the entry was silently inert and the suites compiled anyway:
tsc reaches those modules through the imports in the suites that use them.

Verified by removing tests-dist and rebuilding: `tests-dist/src/detection.js`
and the rest still emit, and the vscode suite passes.
The ignore existed to keep the E2E fixtures' pinned toolchain versions out of
automated bumps, which is a manual, E2E-verified decision. It named
packages/vscode/tests/**, where those fixtures used to live; all six manifests
are now under packages/vscode/e2e/** and the old path holds no manifest at
all, so the rule was matching nothing.
@fi3ework
fi3ework force-pushed the chore/unit-tests-out-of-src branch from 08cd1ba to 631b16a Compare August 7, 2026 08:41
The repository is about to be public, so the landing page needs to say what
state the project is in before a reader forms an expectation from the feature
list. Names it concretely — pre-1.0, settings and command ids can still move,
not every config source is wired up — and points at the roadmap table already
below it rather than restating what works.
@fi3ework
fi3ework merged commit 5e1b5bf into main Aug 7, 2026
0 of 3 checks passed
@fi3ework
fi3ework deleted the chore/unit-tests-out-of-src branch August 7, 2026 08:51
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.

1 participant