Fix the flaky race cancellation tests and run the Fastlane check under rbenv - #587
Merged
Merged
Conversation
…dating The "Cancellation is always checked before returning" tests cancelled their task after creating it, so the task could run the race to completion first and get `.noTasksScheduled`. They now wait for the cancellation before racing. validate.sh now puts rbenv's shims on PATH, so shells that haven't run `rbenv init` use the Ruby from .ruby-version instead of skipping the Fastlane check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 tasks done
bradleymackey
added a commit
that referenced
this pull request
Sep 25, 2026
## Summary `scripts/validate.sh`, and gps-app's copy of it, are now one tested package, [badbundle/local-check](https://github.com/badbundle/local-check) (v0.1.0), which both repos depend on. `make validate` still posts the same **Validate (local)** check that `main` requires, from the same checks. - **The checks** are in `local-check.config.ts` and are the same as before: 1. `make lint`, keeping `Vault/.build` between runs so it's incremental; 2. the Fastlane config check, with rbenv's shims first on `PATH` as #587 added. It's skipped, and named on the check, if the Ruby in `.ruby-version` isn't installed; 3. a build and full run of `iOSAllTests` with Xcode 27.0, on a throwaway iPhone 18 Pro Max simulator addressed by UDID. The config is loaded from the commit being validated, so a commit carries its own checks. - **Setup is `bun install`.** `package.json` pins `github:badbundle/local-check#v0.1.0`, and its `prepare` script writes `.githooks/pre-push` and points `core.hooksPath` at it. The hook is now a small shim that runs the installed local-check. - **`make validate`** runs `bun install --frozen-lockfile` first, so the copy that runs always matches the pin, then `bun run validate`. - **Results and logs** move from `.git/validate/` to `.git/local-check/`. The worktree and DerivedData move to `~/Library/Caches/local-check/`. - **Docs:** `README.md`'s Validation section and both `AGENTS.md` files now describe the Bun setup and point to `local-check.config.ts`. - **Removed:** `scripts/validate.sh`. Moving to a newer local-check is a deliberate change: bump the tag in `package.json`, run `bun install`, and validate. ## Test plan - [x] `make validate` on this PR's commit: Lint, Fastlane config, Build and Tests passed in 3m34s. The Fastlane check ran on Ruby 4.0.5, and the throwaway simulator was deleted afterwards. - [x] The new pre-push hook posted **Validate (local): success** when the branch was pushed. - [x] A fresh `bun install --frozen-lockfile` from `bun.lock` installs local-check 0.1.0, identical to the tag. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 5.5 <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.
Summary
This fixes two leftovers from #586: a flaky test that could fail validation, and the Fastlane check that validation was skipping.
Task+RaceTests.swiftcreated a task and then cancelled it. The task could runTask.raceto completion beforecancel()was called. When it did, the race wasn't cancelled and correctly threw.noTasksScheduledinstead ofCancellationError. BothFirstValueandFirstResolvedhave this race. The tests now wait for the cancellation, using the existingTaskCancellationWaiter, before starting the race.Task.raceitself is unchanged..ruby-versionis now installed on the validating Mac through rbenv.validate.shnow also puts rbenv's shims onPATHitself. Before this, shells that hadn't runrbenv init(non-interactive ones, like an agent's) found the system Ruby 2.6 and still skipped the check.Testing
FoundationExtensionsTests/TaskRaceTestson macOS with-test-iterations 500 -run-tests-until-failure,FirstResolvedfailed with.noTasksScheduled.bundle exec fastlane lanessucceeds on Ruby 4.0.5, andGemfile.lockis unchanged.make validatepassed on c34aa3c in 3m36s. This time the Fastlane config step ran instead of being skipped.🤖 Generated with Claude Code