feat: [SDK-4718] add native iOS SDK support to appium harness#38
Conversation
42a2eb8 to
33be33e
Compare
33be33e to
7e0fcb9
Compare
7707b07 to
f4afb76
Compare
|
@claude review |
Replace ios_pbxproj_inputs_hash's project.yml awk parser with a wholesale demo-dir file-listing scan. The awk only matched the `- path:` long form and would silently drop dirs declared with any of XcodeGen's three other sources: forms — current project.yml is fine but a future-edit footgun. Hoist the run-all.sh label decision above the platform skip arms so SKIP, PASS, and FAIL rows share one schema instead of mixing short and long labels in the same summary table. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
All three prior findings (sim/device stamp scoping, xcodegen cache gating, run-all label consistency) have been addressed in the latest commits — LGTM.
Extended reasoning...
Overview
The PR adds native iOS SDK support (OneSignal-iOS-SDK/examples/demo) as a first-class target in the local Appium harness scripts (run-all.sh, run-local.sh), plus two small test/doc cleanups (consolidated IAM spec loop, snackbar policy update in demo/build.md). All changes are confined to the test harness and demo guidance — no production SDK code is touched.
Security risks
None. The new build_ios_native writes a gitignored Secrets.plist via plutil (which handles XML-special characters safely), runs xcodegen and xcodebuild from a fixed demo directory, and reads env vars that already flow through the rest of the harness. No new attack surface.
Level of scrutiny
Low–medium. This is local developer/CI tooling — bugs surface as failed builds or stale binaries in dev, not as production regressions. The build-cache logic is the trickiest part, and my prior reviews flagged three correctness issues there which have all been addressed with verifiable fixes (stamp now scoped by IOS_BUILD_DIR, xcodegen gated on a content hash instead of mtime, summary labels hoisted to a single ${label} variable used in all branches).
Other factors
The author replied substantively to each finding, explained the precedent followed (matching build_dotnet_ios/build_unity_ios cache scoping), and verified the new whole-dir hash behaviour. The bug hunting system found no further issues on the current revision. The remaining diff (IAM spec collapse into a single it, outcome spec reordering to click radio before setting value, snackbar policy doc update) is mechanical and self-contained.
Description
Adds the native iOS demo (
OneSignal-iOS-SDK/examples/demo) as a first-class target in the Appium harness, sorun-all.sh/run-local.shcan build, install, and exercise it alongside the wrapper SDKs. Closes SDK-4718.Also includes a few small cleanups picked up while wiring the harness end-to-end (IAM spec consolidation, snackbar policy update in
demo/build.md).Details
Harness changes
run-all.shiostoALL_SDKSand updates--help.android(native) handling: when--sdk=iosis combined with--platform=android, warn + skip withSKIP ios / androidin the summary instead of failing.run-local.sh--sdk=iospath. InfersPLATFORM=ioswhen only--sdk=iosis passed, validates the combo, and exits 0 if invoked with--platform=android(parity with the native Android skip).IOS_DIRandIOS_NATIVE_PROJECTenv vars.IOS_NATIVE_PROJECTdefaults toApp.xcodeproj; the Xcode scheme is derived from its basename so users can rename the project without editing the script.build_ios_native():App/Secrets.plistviaplutil(empty dict when env vars are unset) so the bundled resource phase doesn't fail, and so API keys with XML-special characters round-trip safely. Falls back toSecretsConfig.defaultAppIdin the demo when credentials aren't provided.Secrets.plistBEFORE runningxcodegen, so the generated.pbxprojalways references a real on-disk file.xcodegen generateonproject.yml -nt project.pbxproj. xcodegen 2.45.x isn't deterministic across no-op runs, so unconditional regen would leave spurious unstaged changes in the iOS SDK repo on every invocation.ios_native_inputs_hash+.ios-native-build.stamp) covering demo sources, the SDK source pulled in viaprojectReferences,Secrets.plist, and the regenerated.pbxproj. Mirrors the existing dotnet/unity caching pattern; skips a no-opxcodebuild(~30-60s) when nothing relevant changed.xcodebuildwith the derived scheme,Release, the platform-appropriate-sdk, and the existing signing args path so--device-realworks on iOS native too.Test/doc cleanups
appium/tests/specs/03_iam.spec.ts: collapse thefor (const iam of iamTypes) { it(...) }block into a singleit('can show iam messages', …)that loops internally — same coverage, one less per-iteration session reset.demo/build.md: drop login/logout from the snackbar allow-list (the iOS demo and others now match the Capacitor convention of no snackbar for login/logout); minor copy fixes around the User and Send In-App Message sections.Affects
run-all.sh --platform=androidand existing per-SDK invocations behave identically.Testing
./run-all.sh --sdks=ios --spec=03_— IAM spec passes after the consolidation refactor../run-all.sh --sdks=ios— full iOS suite runs end-to-end against the rebuilt native demo../run-local.sh --sdk=ios(with and withoutONESIGNAL_APP_ID/ONESIGNAL_API_KEYenv vars) — builds, installs, and the hash cache correctly skips a second invocation../run-all.sh --sdks=ios --platform=android— warns and skips without failing..pbxprojdiff in the iOS SDK repo after repeated runs.Made with Cursor