Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions e2e/BITRISE.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,15 @@ The `e2e-execute-browserstack-run` workflow fans out one parallel copy per Brows

These secrets are configured in Bitrise.io; they cannot live in the repository. `scripts/setup_storefront_env` reads them to configure the sample app before builds.

| Secret | Purpose |
| ------------------------- | ---------------------------------------------- |
| `STOREFRONT_DOMAIN` | Storefront domain for sample app builds. |
| `STOREFRONT_ACCESS_TOKEN` | Storefront access token for sample app builds. |
| Secret | Purpose |
| --------------------------------------------- | --------------------------------------------------------- |
| `STOREFRONT_DOMAIN` | Storefront domain for sample app builds. |
| `STOREFRONT_ACCESS_TOKEN` | Storefront access token for sample app builds. |
| `SWIFT_APPLE_PAY_MERCHANT_IDENTIFIER` | Apple Pay entitlement for the Swift E2E application. |

Expose these secrets to pull-request builds. The Swift build fails before Xcode
when the generated merchant identifier is missing or blank, and never prints its
configured value.

## BrowserStack secrets

Expand Down
6 changes: 6 additions & 0 deletions e2e/config/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ applications:
app_id: com.shopify.checkoutkit.swiftdemo
artifact_env: E2E_SWIFT_IOS_APP_PATH
ready_marker: checkout-kit-sample-ready
# This provisioned app carries the Apple Pay entitlement and is checked for a
# nonblank merchant identifier before it is built.
exclude_tags:
- flaky
- wip
- full
changed_files_filters:
- swift
- protocolSwift
Expand Down
1 change: 1 addition & 0 deletions e2e/scripts/build_swift_ios
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ source "$script_dir/bitrise_ci_helpers"
source "$script_dir/ios_build_helpers"

e2e_configure_storefront
"$script_dir/check_swift_apple_pay_config"

e2e_log "Generating Swift sample Xcode projects"
platforms/swift/Scripts/generate_xcode_projects
Expand Down
14 changes: 14 additions & 0 deletions e2e/test/check_swift_apple_pay_config_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
class CheckSwiftApplePayConfigTest < Minitest::Test
REPO_ROOT = File.expand_path("../..", __dir__)
SCRIPT = File.join(REPO_ROOT, "e2e", "scripts", "check_swift_apple_pay_config")
BUILD_SCRIPT = File.join(REPO_ROOT, "e2e", "scripts", "build_swift_ios")
SYNTHETIC_IDENTIFIER = "merchant.com.example.e2e"

def test_script_is_executable_bash
Expand Down Expand Up @@ -59,6 +60,19 @@ def test_nonblank_assignment_succeeds_without_printing_the_value
end
end

def test_bitrise_swift_build_checks_config_after_generating_it
script = File.read(BUILD_SCRIPT)
configure_index = script.index("e2e_configure_storefront")
check_index = script.index('"$script_dir/check_swift_apple_pay_config"')
xcodegen_index = script.index("platforms/swift/Scripts/generate_xcode_projects")

refute_nil configure_index
refute_nil check_index
refute_nil xcodegen_index
assert_operator configure_index, :<, check_index
assert_operator check_index, :<, xcodegen_index
end

private

def with_config(contents)
Expand Down
10 changes: 7 additions & 3 deletions e2e/test/e2e_matrix_to_browserstack_run_plan_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,17 @@ def test_runs_carry_default_tags_and_the_other_platform_exclusion
android_run = run_for("kotlin-android")

assert_equal ["launch", "checkout"], ios_run.fetch("include_tags")
assert_equal ["flaky", "wip", "full", "apple-pay", "android-only"], ios_run.fetch("exclude_tags")
assert_equal ["flaky", "wip", "full", "android-only"], ios_run.fetch("exclude_tags")
assert_equal ["flaky", "wip", "full", "apple-pay", "ios-only"], android_run.fetch("exclude_tags")
end

def test_apple_pay_is_excluded_from_every_application_by_default
def test_only_the_swift_ios_application_allows_apple_pay
plan.expand.each do |run|
assert_includes run.fetch("exclude_tags"), "apple-pay", run.fetch("application_id")
if run.fetch("application_id") == "swift-ios"
refute_includes run.fetch("exclude_tags"), "apple-pay"
else
assert_includes run.fetch("exclude_tags"), "apple-pay", run.fetch("application_id")
end
end
end

Expand Down
Loading