Skip to content

test: re-enable checkForUpdatesCommand local server / CDN specs#297

Merged
MarshallOfSound merged 5 commits into
mainfrom
sam/reenable-local-server-tests
May 2, 2026
Merged

test: re-enable checkForUpdatesCommand local server / CDN specs#297
MarshallOfSound merged 5 commits into
mainfrom
sam/reenable-local-server-tests

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Collaborator

Stacked on #296.

These two specs were already in the suite but only ran their bodies when SQUIRREL_TEST_LOCAL_SERVER / SQUIRREL_TEST_LOCAL_CDN were set — and #296 disabled those env vars in the scheme because the swizzled updateFromJSONData: was never restored, which broke later in-process specs.

This makes them safe to run unconditionally:

  • Swizzle + OHHTTPStubs registration moved into beforeEach, original IMPs captured and restored via addCleanupBlock
  • Stub now returns [RACSignal empty] instead of nil so the command chain completes cleanly
  • Scheme env vars flipped back to isEnabled="YES"

56 tests, 0 failures, both specs now actually exercise the HTTP path.

- Bump Quick to v5.0.1 and Nimble to v9.2.1 (last versions with full
  Objective-C QuickSpec DSL compatibility)
- SWIFT_VERSION 3.0 -> 5.0
- Disable -Werror at the project level so vendored ReactiveCocoa 2.x
  builds against modern clang
- Bump deployment target to 10.13 (libarclite no longer ships for older)
- TestApplication: ad-hoc sign instead of requiring the GitHub team cert
- Regenerate signed test fixtures at build time so SQRLCodeSignature
  cross-validates regardless of host machine
- Update specs for Quick 5 ObjC API (QCKConfiguration, qck_beforeSuite,
  before/afterEachWithMetadata:)
- SQRLUpdaterSpec: write update zips to per-test temp dir, swizzle
  isRunningOnReadOnlyVolume under xctest CLI host, fix env-var typing
  for NSWorkspace, xit prune-after-update test (behavior intentionally
  removed in 7dffc4b)
- SQRLDirectoryManagerSpec: derive expected identifier from main bundle
- Disable manual local-server scheme env vars by default
- Add script/test wrapper
Travis only ever built the framework; the new workflow builds and runs
the test suite on macos-latest. xcbeautify is preinstalled on the
runner image.
TestApplication is ad-hoc signed now, so the encrypted GitHub team
certificate and the keychain import dance are dead code.
The vendored xcconfigs (0.8.1, circa 2015) set VALID_ARCHS=x86_64 in
Mac-Base.xcconfig, so all Squirrel targets were x86_64-only while
Quick/Nimble built for the host arch. On arm64 runners this meant
implicit dependency detection couldn't match Nimble.framework and the
test target failed with 'no such module'.

- VALID_ARCHS = arm64 x86_64 at the project level and on the CLI
- ONLY_ACTIVE_ARCH=YES + explicit -destination so everything builds
  for the host arch
- Quick-macOS / Nimble-macOS added as explicit scheme buildables
  (buildForTesting only) so they're always in the dependency graph
- parallelizeBuildables=NO so the Swift-generated headers exist before
  SquirrelTests starts dependency-scanning
These were no-ops because the swizzled implementations were never
restored, breaking later in-process specs. Move the swizzling and
OHHTTPStubs registration into beforeEach, capture the original IMPs,
and restore both via cleanup. Also return [RACSignal empty] from the
stub instead of nil so the command chain completes cleanly.
@MarshallOfSound MarshallOfSound force-pushed the sam/reenable-local-server-tests branch from f7bdf84 to 85ac37f Compare May 2, 2026 22:03
Base automatically changed from sam/its-2026 to main May 2, 2026 22:06
@MarshallOfSound MarshallOfSound merged commit 6a99d12 into main May 2, 2026
1 check passed
@MarshallOfSound MarshallOfSound deleted the sam/reenable-local-server-tests branch May 2, 2026 22:07
MarshallOfSound added a commit that referenced this pull request May 2, 2026
…hs (#299)

Stacked on #298.

Fills gaps between this suite and
`electron/spec/api-autoupdater-darwin-spec.ts` for behaviors that
already exist in `Squirrel/` source. **56 → 63 tests, 0 failures.**

#### Added (`SQRLUpdaterSpec.m`)
- `checkForUpdatesCommand` → 204 No Content treated as no-update
- `checkForUpdatesCommand` → custom request headers reach the server
- `checkForUpdatesCommand` JSONFILE mode → picks matching release's
`updateTo` when `currentRelease` is newer
- `checkForUpdatesCommand` JSONFILE mode → no download when
`currentRelease` == running version
- `checkForUpdatesCommand` JSONFILE mode → no download when
`currentRelease` < running version
- `checkForUpdatesCommand` JSONFILE mode → invalid body →
`SQRLUpdaterErrorInvalidServerBody`
- `response handling` → download endpoint non-2xx → error

Also re-enables the `SQUIRREL_TEST_LOCAL_CDN` / `_SERVER` scheme env
vars (dropped in the #297 squash).

#### Skipped (blocked on patch upstream — separate PRs incoming)
- `ElectronSquirrelPreventDowngrades` (4 specs)
- prune orphaned staged updates / bounded count / `quitAndInstall` race
- `SquirrelMacEnableDirectContentsWrite`
- abort-if-app-still-running
- nested-code strict-validate failures
- zip-extract launch failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant