Skip to content

refactor(test): simplify real-provider E2E under scanner-safe e2e-tests #142

Description

@ClaudiaFang

Summary

Follow-up to #129: relocate the real-provider E2E suite from e2e/ to a scanner-safe e2e-tests/provider/ boundary, and remove the E2E_RUNTIME_DIR runtime-generation workaround that currently produces the Obsidian requestUrl shim, window-timer shim, and GitVerifier as shell-generated TypeScript instead of committed files.

Do not start until #129 merges. This should branch off main (after #129 lands there via claude/source-control-foundation), not be folded into #129 itself — that PR is already large (75 commits).

Scope

In scope — pure boundary/structure change, no coverage or test-semantics change:

  1. Move e2e/{config,shim,suites,support} → e2e-tests/provider/{config,shim,suites,support}.
  2. Update scripts/e2e-suites.txt and scripts/run-e2e.sh paths to the new location; keep the manifest/registration guard and core/full tiering as-is.
  3. Remove the scanner-workaround runtime generation in scripts/e2e-harness.sh (generate_runtime_modules() and friends) and commit obsidian-request-url.ts, window-timers.ts, and git-verifier.ts as real static files under e2e-tests/provider/runtime/ and e2e-tests/provider/support/.
  4. Simplify vitest.e2e.config.ts: drop E2E_RUNTIME_DIR-based aliasing (@e2e-runtime/*, runtime-modules.d.ts), point alias/setupFiles/include at the static paths instead.
  5. Update CI changes.e2e-relevant filter: e2e/** → e2e-tests/**, add scripts/e2e-suites.txt and vitest.e2e.config.ts (currently not watched, so a manifest-only change could silently skip E2E), and fix the stale src/logic/sync-manager.ts path (sync logic is now split under src/logic/sync/).
  6. Update ESLint config: e2e/**/*.ts → e2e-tests/**/*.ts, and flip the rule intent — this is Node test tooling, not shipping Obsidian runtime code, so Node globals/built-ins (node:fs, node:child_process, fetch, etc.) should be allowed there instead of banned.
  7. Update tsconfig.json include path e2e/**/*.ts → e2e-tests/**/*.ts (scanner-ignored ≠ typecheck-ignored — keep it in the TS gate).
  8. Extend tests/ci-workflow.test.ts with contract assertions for the new paths and for the removal of E2E_RUNTIME_DIR/runtime-generation, while keeping all existing assertions (Gitea dynamic port, mktemp isolation, workflow-level concurrency, required-checks, fork-PR trust boundary).
  9. Update docs/testing/real-provider-e2e.md and docs/obsidian-scanner-audit.md to describe the new static architecture.
  10. Fix feat(source-control): replace sync status panel with the source control workflow #129's PR description: "Playwright-driven" → "Vitest-driven real-provider E2E".

Out of scope:

  • No Playwright migration (tracked separately if ever pursued).
  • No renaming of test semantics (e.g. suites → specs).
  • No changes to Gitea/GitHub/GitLab CI job topology, concurrency, or the required-checks DAG established in feat(source-control): replace sync status panel with the source control workflow #129.
  • No changes to scripts/e2e-namespace.sh, scripts/e2e-namespace-cleanup.sh, scripts/e2e-janitor.sh — these are real lifecycle/isolation logic, not scanner workarounds.

Acceptance Criteria

Structure

  • e2e/ no longer exists
  • Provider E2E lives entirely under e2e-tests/provider/
  • scripts/e2e-suites.txt remains the single source of truth for suite registration

Scanner boundary

  • Scanner-sensitive Node tooling exists only inside the officially scanner-ignored e2e-tests/ boundary
  • No more runtime-generated TypeScript used to dodge the Obsidian plugin scanner

Shell

  • e2e-harness.sh no longer generates verifier/requestUrl/timer .ts files at runtime
  • Provision/seed/verify/cleanup logic is unchanged
  • e2e-namespace*.sh / e2e-janitor.sh unchanged

Quality gates

  • npx eslint . — 0 errors, includes e2e-tests/**
  • npm run build — passes (includes Obsidian 1.11.0 compat typecheck), includes e2e-tests/**
  • npx vitest run — passes

CI

E2E

  • Gitea, GitHub, GitLab provider suites green
  • source-control-flows and two-client-sync suites still run
  • core/full tiering behavior unchanged
  • Suite registration guard still catches unregistered/missing suites

Docs

Evidence of the lint/build/test run (command + result) must be recorded in progress.md or the PR description per this repo's CLAUDE.md definition of done.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions