test(upgrade): run channel flow tests against the mock server offline - #36286
Open
bartlomieju wants to merge 1 commit into
Open
test(upgrade): run channel flow tests against the mock server offline#36286bartlomieju wants to merge 1 commit into
bartlomieju wants to merge 1 commit into
Conversation
The `stable`, `canary`, `specific_stable` and `specific_canary` upgrade spec tests each copied the binary and ran a real `deno upgrade`, hitting GitHub / dl.deno.land and downloading a full ~40MB release on every CI run. That wastes bandwidth and couples PR CI to the live release state (a freshly published version could break the output match on unrelated PRs). Point these four at the existing test-server mock instead, the same way `delta` and `checksum` already do, via DENO_TESTING_UPGRADE and DENO_DONT_USE_INTERNAL_BASE_UPGRADE_URL. The version lookup and download now resolve to localhost:4545, so the tests are fully offline, deterministic (fixed sentinel versions), and run in tens of milliseconds instead of ~13s. The mock serves a placeholder, non-executable binary, so each upgrade runs through version resolution and the download and then fails validation; the tests assert the resolved version and the mocked download URL rather than a completed install. Canary downloads previously had no test hook, so extend the DENO_TESTING_UPGRADE redirect to the canary download URL in get_download_url and teach the test server to serve zips under /deno-upgrade/canary/, mirroring the existing /deno-upgrade/download/ handling. The end-to-end tests that need a real runnable binary (space_in_tmp, out) are intentionally left on the real network for now.
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.
The
stable,canary,specific_stableandspecific_canaryupgradespec tests each copied the binary and ran a real
deno upgrade, hittingGitHub and dl.deno.land and downloading a full release archive on every
CI run across every platform. That burns bandwidth and couples PR CI to
the live release state: when a new version ships mid-flight, the output
match can break on unrelated PRs (which is exactly what happened when
v2.9.4 was published).
This points these four tests at the existing test-server mock instead,
the same mechanism
deltaandchecksumalready use, viaDENO_TESTING_UPGRADEandDENO_DONT_USE_INTERNAL_BASE_UPGRADE_URL. Theversion lookup and the download both resolve to localhost:4545, so the
tests are fully offline, deterministic (fixed sentinel versions), and run
in tens of milliseconds instead of ~13s each.
The mock serves a placeholder, non-executable binary, so each upgrade
runs through version resolution and the download and then fails
validation. The tests assert the resolved version and the mocked
download URL rather than a completed install, matching the pattern the
existing mocked upgrade tests use.
Canary downloads previously had no test hook, so this extends the
DENO_TESTING_UPGRADEredirect to the canary download URL inget_download_url(only active when that env var is set, so noproduction impact) and teaches the test server to serve zips under
/deno-upgrade/canary/, mirroring the existing/deno-upgrade/download/handling.
The two end-to-end tests that need a real runnable binary to assert the
upgraded executable actually runs and reports the expected version
(
space_in_tmp,out) are intentionally left on the real network fornow; moving those behind a mock needs a runnable cross-platform stub or a
scheduled real-network job, which is a follow-up.