refactor(e2e): decouple E2E tests into commands layer and shared e2e package#93
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
packages/e2eas a private workspace package for shared E2E infrastructure (gating, subprocess runner, output helpers, global setup).packages/cli/tests/e2etopackages/commands/tests/e2e, executed through a self-maintained harness (binName: "bl").cli/kscli); merges kscli knowledge live coverage intoknowledge chat/searchpaths in commands.proxy.e2eand console cross-domain flag rejection tests topackages/runtime/tests.tsconfigtosrc/**(prevents tsgo from emittingtests/**/*.d.tsduring pack) and running E2E subprocesses viatsxinstead of barenode(Node strip-only mode cannot load workspace TypeScript sources with parameter properties).Architecture
packages/e2epackages/commands/tests/e2epackages/cli/packages/kscli--helpfor all registered paths)packages/runtime/testsTest plan
vp checkvp 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)