chore(test): fix Windows test failures and eager Cloudflare credential resolution#605
Open
Mkassabov wants to merge 1 commit into
Open
chore(test): fix Windows test failures and eager Cloudflare credential resolution#605Mkassabov wants to merge 1 commit into
Mkassabov wants to merge 1 commit into
Conversation
Contributor
|
Install the packages built from this commit: alchemy bun add alchemy@https://pkg.ing/alchemy/6fd43e6@alchemy.run/better-auth bun add @alchemy.run/better-auth@https://pkg.ing/@alchemy.run/better-auth/6fd43e6@alchemy.run/pr-package bun add @alchemy.run/pr-package@https://pkg.ing/@alchemy.run/pr-package/6fd43e6 |
sam-goodwin
reviewed
Jun 16, 2026
Comment on lines
+14
to
+16
| const timeoutHandlerPath = fileURLToPath( | ||
| new URL("./timeout-handler.ts", import.meta.url), | ||
| ); |
Contributor
There was a problem hiding this comment.
pathe.resolve(import.meta.dirname, "timeout-handler.ts")?
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.
Fixes the 19 test failures / 2 suite failures from a full local
vitest runon Windows. Most were Windows-specific test bugs, but two were real cross-platform source bugs the run surfaced.Source fixes
Eager Cloudflare credential resolution (
Gateway/Rule.ts,Tunnel/Configuration.ts): both providers didforcing auth (or an interactive login prompt) just to construct the provider collection —
Providers.test.ts's unknown-profile guard test caught it by hanging on the Clack prompt. Both now hold the env effect and resolveaccountIdinside lifecycle ops, per the providers convention.PurePlugin.resolvePackageInfowalked above thenode_modules/<pkg>root, so a straypackage.jsonhigher up (e.g. a drive-root manifest on Windows) masked the path-derived package name. The walk now stops at the package's own root.Drizzle/Schema.diffforced{ action: "update" }wheneveroutput.outwas absolute (legacy-state migration shim). On Windows anouton a different drive than cwd has no relative form, so every deploy flagged an update. Now compares against today's canonicalrelativeOutform instead.Cloudflare OAuth
DEFAULT_SCOPES: addeddns_records:read/edit+teams:read/writeso a default oauth login can manage the DnsRecord and Tunnel/Gateway resources alchemy ships.Test/fixture fixes
new URL(...).pathname→fileURLToPath(...)(yields/D:/...on Windows) inLambda/Function.test.ts,Local/RpcServer.test.tspidListeningOnfixture:netstat -anoon win32 (lsofdoesn't exist) — un-cascades all 7 RpcSpawner/RpcSpawnerCleanup failuresPurePlugin.test.ts: junction instead of dir symlink on win32 (no elevation needed; type arg ignored on POSIX)Build.test.ts: normalize platform separators before comparingoutdirNot fixed (credentials, not code)
Zone,Ruleset,Dns,Tunnelsuites provision zones, and Cloudflare's OAuth client has nozone:writescope at all — those suites require API-token auth (CLOUDFLARE_API_TOKEN, what CI uses viaTEST_CLOUDFLARE_API_TOKEN).All fixed suites verified locally on Windows (PurePlugin 30/30, RpcSpawner 5/5, RpcSpawnerCleanup 4/4, RpcServer, Build, Drizzle 3/3, Providers, Lambda Function 2/2 incl. live deploys).