test(e2e): gated end-to-end harness against a real org (#36)#47
Merged
Conversation
Adds e2e/warden.e2e.test.ts + vitest.e2e.config.ts + npm run test:e2e + a nightly/dispatch e2e.yml workflow. Self-skips unless WARDEN_E2E_* env is set, so default CI/contributors are unaffected (npm test still 468, excludes e2e). Phase 1: per-cycle fetchLive+diff against the real org, asserting read-only (all GET) + valid change set — validates the live API contract mocks can't (esp. token cycles). Phase 2 (WARDEN_E2E_APPLY=1): one teardown-guarded variable round-trip. tsconfig now type-checks e2e/. Closes #36. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Closes #36.
Adds a gated end-to-end suite that exercises every cycle against a real GitHub org via a real App installation — the only thing that validates the live API contract (mocks can't, especially the App-only token cycles #15/#16).
What
e2e/warden.e2e.test.ts+vitest.e2e.config.ts+npm run test:e2e.github/workflows/e2e.yml— nightly + workflow_dispatch only (never on PRs), usingWARDEN_E2E_*repo secretsnpm test(default config globssrc/**);tsconfignow type-checkse2e/How it runs
Self-skips unless these are set, so default CI / contributors without a test org are unaffected:
WARDEN_E2E_APP_ID,WARDEN_E2E_INSTALLATION_ID,WARDEN_E2E_PRIVATE_KEY,WARDEN_E2E_ORG(+ optionalWARDEN_E2E_APPLY=1).fetchLive+buildDesired+diffagainst the org and asserts (a) every HTTP call was aGET— fetchLive never mutates — and (b) the pipeline composes into a valid change set. This is what catches API-contract drift.finallycleanup.To activate (your side)
Add repo secrets
WARDEN_E2E_APP_ID/_INSTALLATION_ID/_PRIVATE_KEY/_ORG(an App installed on a throwaway test org). Then it runs nightly, orgh workflow run e2e.yml(toggleapplyfor Phase 2).Verification
npx tsc --noEmitclean (incl. e2e)npm teststill 468 (e2e excluded)npm run test:e2ewith no creds → 14 skipped, exit 0e2e.ymlvalid YAML; no action-bundle drift🤖 Generated with Claude Code