Repository navigation
test(native): run the whole update chain with real builds - #1884
Merged
Merged
Conversation
TestUpdateChain builds Core twice, installs the previous release with ftw-launcher, updates through FTW_RELEASE_MIRROR, kills the candidate three times inside probation, retries it and takes a binary rollback. Slots, the running version, two settings, a saved charging goal and the history count are checked at each step. It runs only with FTW_UPDATE_CHAIN=1; make update-chain starts it from the last three betas. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Without beta tags (shallow clone or fork) make update-chain passed an empty FTW_UPDATE_CHAIN_FROM, and the test quietly built the previous release from the candidate's own source. Now an empty list fails before any build and says how to fix it. FTW_UPDATE_CHAIN_FROM=tree (or UPDATE_CHAIN_FROM=tree) opts into the tree-only run, and the Makefile passes a caller's FTW_UPDATE_CHAIN_FROM through. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Item W0-6 of the stable plan (gate G5).
Problem
Nothing tests the native update chain with real binaries. The launcher tests use a fake exec (
go/cmd/ftw-launcher/main_test.go), and the site rig only ever stops Core with SIGTERM (go/test/site/stack_test.go:411). So no test shows that a box on the last beta can update to a candidate, fall back after a crash loop in probation, take a binary rollback, and keep its data.Change
TestUpdateChainingo/cmd/ftw-launcher/update_chain_test.go, plusmake update-chain. The test runs only withFTW_UPDATE_CHAIN=1, because it builds Core.For each previous release (by default the last three betas before HEAD, each built from
git archive; or this tree whenFTW_UPDATE_CHAIN_FROM=tree), it:ftw-linux-<arch>.tar.gzplus.sha256and serves them throughFTW_RELEASE_MIRROR.ftw-launcher installandinitfor the previous release, starts it, and saves a mode, a grid target and a recurring charging schedule. A standalone Lua site meter in the user-drivers overlay records history.GET /api/version/checkandPOST /api/version/update, then restarts the launcher as systemd would. The trial commits.last_failedset to the candidate.{"retry": true}, then callsPOST /api/version/binary-rollback. The previous release starts as a trial and commits.At each step it checks the exact slots, the version that
/api/statusreports, the saved settings and goal, and that the history count did not fall.It does not yet check that the commit comes after the first control tick. That ordering arrives with A7, which can add the check here.
Tests
make update-chain(v0.157.1-beta.1, v0.157.0-beta.1, v0.156.0-beta.1 to the tree): PASS, 81 s.FTW_UPDATE_CHAIN=1 go test -race -run TestUpdateChain ./cmd/ftw-launcher/: PASS, 43 s (now needsFTW_UPDATE_CHAIN_FROM=tree).--no-tags --depth 1clone,make update-chainfails before any build and says to fetch tags, name refs or setFTW_UPDATE_CHAIN_FROM=tree.TestChainRefscovers the empty list.make update-chain UPDATE_CHAIN_FROM=tree: PASS, 28 s.crashLimitraised from 3 to 4, the test fails withCore never served v0.998.0-beta.1 (last "v0.999.0-beta.1"). I reverted the change.go test -race ./cmd/ftw-launcher/...,go vet ./...andgo build ./...: clean.Risk
Low. The PR adds a test and a make target and changes no Core code. Without the env var the test skips, so
make testand CI do not change. It runs on arm64 and amd64 hosts with host builds. The archive matchesscripts/package-linux.py, except that the energyplan bundle manifest is a stub.🤖 Generated with Claude Code