Skip to content

[UFNL] Add iOS SDK promo Thor tests - #175

Closed
sidharth-pardeshi wants to merge 51 commits into
Affirm:masterfrom
sidharth-pardeshi:codex/ios-upfunnel-promo-thor-tests
Closed

[UFNL] Add iOS SDK promo Thor tests#175
sidharth-pardeshi wants to merge 51 commits into
Affirm:masterfrom
sidharth-pardeshi:codex/ios-upfunnel-promo-thor-tests

Conversation

@sidharth-pardeshi

@sidharth-pardeshi sidharth-pardeshi commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds Upfunnel-owned promo messaging UI coverage for the iOS merchant SDK example app.

  • adds Examples/ExamplesUITests/UpfunnelPromoMessaging with an Upfunnel OWNERS file
  • adds UpfunnelPromoMessagingThorUITests, which launches the example app through the real iOS SDK and points promo calls at a Thor host when Thor inputs are supplied
  • adds an internal promosURLOverride implementation hook used only by the example app category, avoiding new public SDK API surface
  • passes the Thor-created promo_external_id through the example app into the SDK promo request path
  • adds tools/buildkite/create_upfunnel_promo_thor_merchant.py, which creates and verifies real Upfunnel merchant/template data on the Thor using all-the-things test-framework helpers
  • adds tools/buildkite/run_upfunnel_promo_thor_uitest.sh, which runs the Thor simulator test and keeps an .xcresult bundle with screenshots
  • adds tools/buildkite/upfunnel_promo_thor_tests.yaml, which provisions a live US Thor and creates the Thor merchant before dispatching the iOS simulator test
  • wires .github/workflows/ui-tests.yml so Buildkite can dispatch the Thor-specific UI test on GitHub Actions macOS and upload the .xcresult artifact
  • keeps Xcode screenshot attachments for promo render debugging
  • makes the pre-existing sandbox-dependent ExamplesUITests opt-in via AFFIRM_RUN_SANDBOX_UI_TESTS so normal CI no longer depends on live sandbox promo behavior

Real Thor Contract

The Thor path does not use canned promo responses. The setup script:

  1. calls the Thor backend at https://<thor-id>.affirm-thor.com
  2. creates merchant/pricing/template state through the existing all-the-things Upfunnel test-framework helpers
  3. verifies the live Upfunnel response with UpfunnelAPI.get_upfunnel
  4. passes the resulting public key, promo external id, and expected ALA to the iOS SDK test

The SDK test then launches the example app and lets the SDK issue its normal /api/promos/v2/<public_key> request against the Thor host, including promo_external_id.

Thor Inputs

  • AFFIRM_PROMO_BASE_URL=https://<thor-id>.affirm-thor.com, or Buildkite metadata thor-id-us-live
  • AFFIRM_PUBLIC_KEY=<merchant public key created on Thor>, or Buildkite metadata upfunnel-sdk-promo-messaging-public-key
  • optional AFFIRM_PROMO_EXTERNAL_ID, defaulting to setup metadata or test_external_id
  • optional AFFIRM_EXPECTED_PROMO_TEXT, defaulting to the setup script's live Upfunnel ALA metadata
  • optional country/locale/currency values, defaulting to USA / en_US / USD

Without the Thor URL/public key, the Thor UI test skips so the repo's existing GitHub Actions can still run.

Validation

  • git diff --check
  • bash -n tools/buildkite/run_upfunnel_promo_thor_uitest.sh
  • python3 -m py_compile tools/buildkite/create_upfunnel_promo_thor_merchant.py tools/buildkite/dispatch_upfunnel_promo_thor_uitest.py
  • parsed .github/workflows/ui-tests.yml and tools/buildkite/upfunnel_promo_thor_tests.yaml with PyYAML
  • GitHub PR checks Run Tests and Run UITests passed before the latest CI-wiring commit; the latest rerun is in progress
  • Attempted local xcodebuild; local machine has only Command Line Tools and no full Xcode, so local simulator verification was not available

CI Notes

The companion Terraffirm pipeline registration is in Affirm/terraffirm#23676. Once applied, that PR should create the Buildkite PR check that uploads tools/buildkite/upfunnel_promo_thor_tests.yaml from this SDK branch. The current iOS runner still dispatches the simulator step to GitHub Actions macOS after Thor setup, so that execution path remains part of the CI Platform review.

@sidharth-pardeshi
sidharth-pardeshi force-pushed the codex/ios-upfunnel-promo-thor-tests branch from ced8ba7 to 31da5d8 Compare June 19, 2026 19:26
@sidharth-pardeshi

Copy link
Copy Markdown
Collaborator Author

Closing this SDK-repo PR because the simulator/E2E Thor test belongs in the native iOS app test harness instead. Replacement PR: https://github.com/Affirm/ios/pull/8683

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