[Phase1] Add E2E matrix launch smoke foundation#356
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
b630f4e to
1455147
Compare
1455147 to
26d5c48
Compare
26d5c48 to
4f48aa5
Compare
Assisted-By: devx/6c1e3ad5-96c8-4972-b087-da7ff7b195c3
|
|
||
| def expand | ||
| applications.flat_map do |application| | ||
| os_tracks.flat_map do |os_track| |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Yeah fair I can make it clearer
There was a problem hiding this comment.
i've replaced os_tracks with os_version_tags
| ```bash | ||
| E2E_APP_ID=com.shopify.checkoutkit.reactnativedemo \ | ||
| E2E_READY_MARKER=catalog-tab \ | ||
| maestro --platform ios test e2e/tests/shared/launch-smoke.yaml |
There was a problem hiding this comment.
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
| - `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 |
There was a problem hiding this comment.
this'll also be removed with kyles pr's as he unifies the sample apps
|
|
||
| def expand | ||
| applications.flat_map do |application| | ||
| os_tracks.flat_map do |os_track| |
There was a problem hiding this comment.
Yeah fair I can make it clearer
4f48aa5 to
155c337
Compare
Assisted-By: devx/96a590ff-685a-49ce-8199-0810f0ac2379
155c337 to
b733667
Compare
| platform: ios | ||
| app_id: com.shopify.checkoutkit.reactnativedemo | ||
| artifact_env: E2E_REACT_NATIVE_IOS_APP_PATH | ||
| ready_marker: catalog-tab |
There was a problem hiding this comment.
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.
| ready_marker: catalog-tab | |
| ready_marker: checkout-kit-sample-ready |
There was a problem hiding this comment.
Good shout - i didn't know that one had merged yet!
There was a problem hiding this comment.
Swapped the marker around
|
|
||
| def run_at(index) | ||
| runs = expand | ||
| runs.fetch(index) |
There was a problem hiding this comment.
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?
| 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) |
There was a problem hiding this comment.
Added the index check above
|
|
||
| validate_unique_ids(errors, "suite", suites) | ||
| suites.each do |suite| | ||
| id = suite.fetch("id", "<missing>") |
There was a problem hiding this comment.
Could suite ids be validated here too? A suite with execute but no id can pass validation, then crash later during expansion.
| id = suite.fetch("id", "<missing>") | |
| id = suite.fetch("id", "") | |
| errors << "suite missing id" if id.to_s.empty? |
| require_relative "../lib/e2e_matrix" | ||
|
|
||
| options = { | ||
| config: "e2e/config/matrix.yml" |
There was a problem hiding this comment.
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?
| config: "e2e/config/matrix.yml" | |
| config: File.expand_path("../config/matrix.yml", __dir__) |
410c55c to
6ab2050
Compare
Merge activity
|

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.ymlas input and outputting a set of JSON launch tasks for browserstack to fan out tests acrossWhat?
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