Skip to content

refactor(e2e): decouple E2E tests into commands layer and shared e2e package#93

Merged
XXPermanentXX merged 10 commits into
mainfrom
feat/migrate-e2e
Jul 10, 2026
Merged

refactor(e2e): decouple E2E tests into commands layer and shared e2e package#93
XXPermanentXX merged 10 commits into
mainfrom
feat/migrate-e2e

Conversation

@hopelynd

@hopelynd hopelynd commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Introduces packages/e2e as a private workspace package for shared E2E infrastructure (gating, subprocess runner, output helpers, global setup).
  • Moves ~30 topic E2E suites from packages/cli/tests/e2e to packages/commands/tests/e2e, executed through a self-maintained harness (binName: "bl").
  • Reduces product-layer E2E to registry smoke only (cli / kscli); merges kscli knowledge live coverage into knowledge chat/search paths in commands.
  • Relocates proxy.e2e and console cross-domain flag rejection tests to packages/runtime/tests.
  • Fixes CI failures by scoping library tsconfig to src/** (prevents tsgo from emitting tests/**/*.d.ts during pack) and running E2E subprocesses via tsx instead of bare node (Node strip-only mode cannot load workspace TypeScript sources with parameter properties).

Architecture

Layer Responsibility
packages/e2e Shared gating, runner, output, globalSetup
packages/commands/tests/e2e Help, missing-arg, dry-run, and gated live tests
packages/cli / packages/kscli Registry smoke (--help for all registered paths)
packages/runtime/tests Proxy integration and cross-domain flag rejection

Test plan

  • vp check
  • vp test packages/commands/tests/e2e/ (32 files, 298 tests)
  • vp test packages/cli/tests/e2e/registry.smoke.e2e.test.ts (100 tests)
  • vp test packages/kscli/tests/e2e/registry.smoke.e2e.test.ts (7 tests)
  • vp test packages/runtime/tests/proxy.e2e.test.ts (5 tests)
  • vp test packages/runtime/tests/console-flags.e2e.test.ts (2 tests)
  • vp test packages/commands/tests/e2e/harness/e2e-command-map.contract.test.ts (4 tests)
  • node tools/compare-e2e-command-map.ts (cli map aligned with harness map)

hopelynd added 10 commits July 10, 2026 11:46
- Added e2e package as a workspace dependency in pnpm-lock.yaml.
- Updated globalSetup path in vite.config.ts to point to the new e2e package location.
- Enhanced documentation for CLI E2E testing, including architecture layers and triggering conditions.
- Refactored test paths and commands in the documentation to align with the new structure.
- Removed outdated dataset and auth E2E tests to streamline the test suite.
- Updated command references and validation checks in the documentation to reflect recent changes.
Runtime pack build was pulling in e2e test imports and tsgo emitted
helpers.d.ts beside commands/tests; restrict runtime tsconfig to src and
ignore tests/**/*.d.ts in fmt/gitignore as a safety net.
Runtime tsconfig already limits pack to src, so tests/**/*.d.ts is never
emitted during build; the fmt ignore and gitignore entries are unnecessary.
Node's strip-only TypeScript mode cannot execute workspace source that
uses parameter properties. Use the monorepo tsx binary for runNodeMain and
the proxy e2e probe (.mts for top-level await).
- Replaced hardcoded command paths with dynamic route mappings in E2E tests.
- Enhanced documentation for command testing, specifying minimum route requirements.
- Consolidated command path management into `topic-routes.ts` for better maintainability.
- Updated various E2E test cases to utilize the new routing structure, ensuring consistency across tests.
- Removed redundant helper functions and improved test clarity by directly referencing route exports.
…orts

- Deleted the `token-plan.e2e.test.ts` file as it contained outdated test cases.
- Introduced `TOKEN_PLAN_ROUTES` in `topic-routes.ts` to define new command routes for token-plan operations.
- This update streamlines the E2E testing structure and prepares for future enhancements.
- Removed the `bailian-cli-commands` dependency from `pnpm-lock.yaml` and `package.json` as it was no longer needed.
- Expanded the E2E tests in `auth.e2e.test.ts` to cover additional scenarios for the `auth login` command, ensuring proper error handling for conflicting flags and missing parameters.
- Improved test assertions for better clarity and coverage of authentication flows.
@hopelynd hopelynd requested a review from XXPermanentXX July 10, 2026 09:51
@XXPermanentXX XXPermanentXX merged commit 6e095a6 into main Jul 10, 2026
2 checks passed
@XXPermanentXX XXPermanentXX deleted the feat/migrate-e2e branch July 10, 2026 09:56
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.

2 participants