Skip to content

[Phase1] Add E2E matrix launch smoke foundation#356

Merged
kieran-osgood-shopify merged 3 commits into
mainfrom
kieran-osgood/e2e-browserstack/phase-1-matrix
Jul 8, 2026
Merged

[Phase1] Add E2E matrix launch smoke foundation#356
kieran-osgood-shopify merged 3 commits into
mainfrom
kieran-osgood/e2e-browserstack/phase-1-matrix

Conversation

@kieran-osgood-shopify

@kieran-osgood-shopify kieran-osgood-shopify commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Stack Context

This is Phase 1 of the BrowserStack Maestro E2E stack for Checkout Kit.

Parent issue: https://github.com/shop/issues-checkout-kit/issues/1095
Epic: https://github.com/shop/issues-checkout-kit/issues/1084

TLDR;

This step achieves taking e2e/config/matrix.yml as input and outputting a set of JSON launch tasks for browserstack to fan out tests across

What?

The E2E pipeline should be matrix-driven to allow regression testing multiple operating system versions.
In this model we define the "applications", list the os_tracks to fan out across, as well as list the suites to run against the application.

Right now the suites run for all applications, but we might want to scope some suites to individual applications (e.g. apple pay for ios devices), this might be better achieved with maestro tags but I've left those out of scope for now.

Why?

Bitrise pipelines dont have built in declarative axis based matrix support like github actions, they allow parallel builds by index, but doesn't support fanning out the way we want.

This PR intentionally avoids Bitrise and BrowserStack execution. It establishes the minimum shared smoke suite and the matrix contract used by later PRs in the stack.

Validation

shadowenv exec -- ruby e2e/test/e2e_matrix_test.rb
shadowenv exec -- ruby e2e/scripts/e2e_matrix validate
shadowenv exec -- ruby e2e/scripts/e2e_matrix expand --index 0

@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Jun 29, 2026
Assisted-By: devx/6c1e3ad5-96c8-4972-b087-da7ff7b195c3
Comment thread e2e/lib/e2e_matrix.rb Outdated

def expand
applications.flat_map do |application|
os_tracks.flat_map do |os_track|

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, likely very subjective. But I wondered a little bit about the meaning of tracks when first reading

We've got platform.. Would os or os_versions be clearer, or is this just a me problem?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah fair I can make it clearer

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've replaced os_tracks with os_version_tags

Comment thread e2e/README.md
```bash
E2E_APP_ID=com.shopify.checkoutkit.reactnativedemo \
E2E_READY_MARKER=catalog-tab \
maestro --platform ios test e2e/tests/shared/launch-smoke.yaml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test will be dropped when its replaced by Kyle's full suite of tests - I just wanted to decouple from his PR's and keep it simple whilst I setup the browserstack tests

Comment thread e2e/README.md
- `config/matrix.yml`, `lib/e2e_matrix.rb`, and `scripts/` drive the CI matrix.
- `tests/shared/launch-smoke.yaml` is the shared launch smoke suite.

## Shared app contract

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this'll also be removed with kyles pr's as he unifies the sample apps

Comment thread e2e/lib/e2e_matrix.rb Outdated

def expand
applications.flat_map do |application|
os_tracks.flat_map do |os_track|

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah fair I can make it clearer

Assisted-By: devx/96a590ff-685a-49ce-8199-0810f0ac2379
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-1-matrix branch from 155c337 to b733667 Compare July 8, 2026 11:41
Comment thread e2e/lib/e2e_matrix.rb
Comment thread e2e/config/matrix.yml Outdated
platform: ios
app_id: com.shopify.checkoutkit.reactnativedemo
artifact_env: E2E_REACT_NATIVE_IOS_APP_PATH
ready_marker: catalog-tab

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use the existing app-ready marker here? catalog-tab only proves the tab is visible, while checkout-kit-sample-ready is the readiness marker used by the existing E2E launch flow.

Suggested change
ready_marker: catalog-tab
ready_marker: checkout-kit-sample-ready

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good shout - i didn't know that one had merged yet!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swapped the marker around

Comment thread e2e/lib/e2e_matrix.rb
Comment thread e2e/lib/e2e_matrix.rb

def run_at(index)
runs = expand
runs.fetch(index)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruby arrays allow negative indexes, so --index -1 would return the last run instead of failing. Could we reject indexes outside the valid range before fetching?

Suggested change
runs.fetch(index)
unless index.is_a?(Integer) && index >= 0 && index < runs.length
raise IndexError, "index #{index} outside of run range 0...#{runs.length}"
end
runs.fetch(index)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the index check above

Comment thread e2e/lib/e2e_matrix.rb Outdated

validate_unique_ids(errors, "suite", suites)
suites.each do |suite|
id = suite.fetch("id", "<missing>")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could suite ids be validated here too? A suite with execute but no id can pass validation, then crash later during expansion.

Suggested change
id = suite.fetch("id", "<missing>")
id = suite.fetch("id", "")
errors << "suite missing id" if id.to_s.empty?

Comment thread e2e/scripts/e2e_matrix Outdated
require_relative "../lib/e2e_matrix"

options = {
config: "e2e/config/matrix.yml"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default config path currently depends on the caller’s working directory. Could we make the default file-relative so the script works from outside the repo root too?

Suggested change
config: "e2e/config/matrix.yml"
config: File.expand_path("../config/matrix.yml", __dir__)

@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/e2e-browserstack/phase-1-matrix branch from 410c55c to 6ab2050 Compare July 8, 2026 15:08

kieran-osgood-shopify commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

@kieran-osgood-shopify kieran-osgood-shopify merged commit 56afe53 into main Jul 8, 2026
25 checks passed
@kieran-osgood-shopify kieran-osgood-shopify deleted the kieran-osgood/e2e-browserstack/phase-1-matrix branch July 8, 2026 15:13
@kieran-osgood-shopify kieran-osgood-shopify changed the title Add E2E matrix launch smoke foundation [Phase1] Add E2E matrix launch smoke foundation Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants