feat(test): add automated pre-deploy test suite#10
Open
theredspoon wants to merge 1 commit intosimple10:mainfrom
Open
feat(test): add automated pre-deploy test suite#10theredspoon wants to merge 1 commit intosimple10:mainfrom
theredspoon wants to merge 1 commit intosimple10:mainfrom
Conversation
Extract pure functions from build/pre-deploy.mjs into pre-deploy-lib.mjs for testability. Add 167 tests across 19 files covering: - Pre-deploy config resolution (env refs, deep merge, memory parsing, claw validation, daily report time, env value formatting, stack env generation, auto token resolution, JSONC parsing) - AI Gateway Worker (routing, auth with KV, CORS, errors, log sanitization, llemtry enablement, admin credential masking/merging) - Docker compose template rendering (Handlebars → valid YAML) - Shell grep patterns from build-openclaw.sh against fixture files - resolve-config-vars.mjs subprocess tests Entry point: npm test (runs vitest at root + workers/ai-gateway)
d8dc5e2 to
af62141
Compare
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
pre-deploy.mjsintopre-deploy-lib.mjsfor unit testabilityresolve-config-varscoercionnpm testruns root vitest (102 tests) + workers/ai-gateway vitest with miniflare KV (59 tests)docker.iogrep pattern andMATRIX_ENABLED=falsebaked-env bug that were found manually in prior deploysTest plan
npm test— all 161 tests passnpm run pre-deploy:dry— lib extraction preserves full build pipeline behavior@cloudflare/vitest-pool-workers