Skip to content

Clear first-party warnings from the cross-platform swift test job#25813

Merged
jkmassel merged 1 commit into
trunkfrom
jkmassel/swift-test-warnings
Jul 22, 2026
Merged

Clear first-party warnings from the cross-platform swift test job#25813
jkmassel merged 1 commit into
trunkfrom
jkmassel/swift-test-warnings

Conversation

@jkmassel

Copy link
Copy Markdown
Contributor

Description

The cross-platform swift test job added in #25344 surfaces a handful of warnings that the iOS app build hides — Xcode suppresses warnings from SPM package dependencies, and WordPressCore / WordPressCoreTests build in Swift 6 language mode (neither package sets .swiftLanguageMode(.v5) on them). This clears the first-party ones. All are dead code or a missing conformance — no behavior change.

1. Dead awaitUserService.fetchUsers()

users.sequenceWithEditContext(params:) builds a PaginationSequence synchronously; the async throws is on iteration (for try await), not construction. Dropped the await.

2. Dead try ×3 — WordPressClientFeatureTests

WordPressClient(api:siteURL:) is non-throwing. Dropped the three try; each test keeps its other try await client.supports(…) calls, so throws stays justified.

3. Missing @unchecked Sendable restatement ×5 — MockWordPressClientAPI

The five mock executors subclass wordpress-rs's @unchecked Sendable base classes; Swift 6 requires restating the conformance on the subclass. Their added stored properties (routes / isBlockTheme) are set-in-init and read-only, so @unchecked is honest.

All three are correct for iOS too — same sources, same wordpress-rs binary, no platform conditionals.

The remaining swiftsoup "unhandled files" warning is upstream and handled separately in #25811.

Testing instructions

  • swift test (cross-platform package) — 128 tests pass and the three first-party warning classes above are gone. (The upstream swiftsoup warning still shows on this branch; Update SwiftSoup from 2.7.5 to 2.13.6 #25811 removes it.)
  • CI — Swift Package Tests, plus WordPress/Jetpack Unit Tests (WordPressCoreTests runs in both).

Related

The `swift test` job added in #25344 surfaces warnings the iOS app build
hides — Xcode suppresses warnings from SPM package dependencies, and
`WordPressCore` / `WordPressCoreTests` build in Swift 6 language mode. All
three are dead code or a missing conformance, with no behavior change:

- `UserService.fetchUsers()`: dead `await` on `sequenceWithEditContext`,
  which builds a `PaginationSequence` synchronously.
- `WordPressClientFeatureTests`: three dead `try` on the non-throwing
  `WordPressClient(api:siteURL:)` initializer.
- `MockWordPressClientAPI`: five mock executors subclass wordpress-rs's
  `@unchecked Sendable` base classes without restating the conformance,
  which Swift 6 requires.

Correct for iOS too — same sources, same wordpress-rs binary, no platform
conditionals.
@jkmassel jkmassel added Testing Unit and UI Tests and Tooling [Type] Tech Debt labels Jul 22, 2026
@jkmassel jkmassel added this to the 27.2 milestone Jul 22, 2026
@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number33319
VersionPR #25813
Bundle IDorg.wordpress.alpha
Commitdcd758a
Installation URL28t9dt935jmk0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number33319
VersionPR #25813
Bundle IDcom.jetpack.alpha
Commitdcd758a
Installation URL2cjg068q7f6vo
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@jkmassel
jkmassel added this pull request to the merge queue Jul 22, 2026
Merged via the queue into trunk with commit 227641a Jul 22, 2026
30 of 31 checks passed
@jkmassel
jkmassel deleted the jkmassel/swift-test-warnings branch July 22, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Testing Unit and UI Tests and Tooling [Type] Tech Debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants