-
Notifications
You must be signed in to change notification settings - Fork 1
[Phase 7] Soft-launch E2E PR checks #364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
kieran-osgood-shopify
wants to merge
1
commit into
main
Choose a base branch
from
kieran-osgood/e2e-browserstack/phase-7-soft-launch
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| # Checkout Kit E2E Runbook | ||
|
|
||
| ## Rollout behaviour | ||
|
|
||
| The E2E pipeline always runs and always reports; it never blocks PR merges on its | ||
| own. Merge-blocking is controlled solely by whether the GitHub checks are marked | ||
| **required** in branch protection. Keep them non-required until the suite is | ||
| stable, then make them required — no code change is needed to gate or un-gate. | ||
|
|
||
| The runner never hard-fails on test or infrastructure problems: every run writes a | ||
| `result.json` and exits `0`, so the report workflow always has data to publish as | ||
| GitHub commit statuses, Check Runs, and the sticky PR failure comment. Failures | ||
| are therefore loud (red checks and a failure comment) but non-blocking. | ||
|
|
||
| Failures land in `result.json` in one of two shapes: | ||
|
|
||
| - **Assertion / suite failures** — a BrowserStack build that reports failed test | ||
| cases or a non-passing terminal status. Recorded by `normalize_result` with | ||
| `status` set to the build's terminal status (e.g. `"failed"`) and the failing | ||
| cases under `failed_tests`; there is no `error`/`error_class`. | ||
| - **Runner exceptions** — malformed run plan, out-of-range parallel index, device | ||
| resolution, artifact upload, build start, polling, and timeouts. Caught and | ||
| recorded with `status: "error"`, `error`, and `error_class`, with the class, | ||
| message, and full backtrace logged to the failing step's stderr. | ||
|
|
||
| Setup failures that happen before a run plan row is read have no run metadata | ||
| (suite, target, status context), so they appear in the Check Run summary and the | ||
| failure comment but do **not** post a per-suite commit status. This is separate | ||
| from the Bitrise step's own required-env guards: a missing config variable | ||
| (e.g. `BROWSERSTACK_ACCESS_KEY`) is validated by the step and fails fast before | ||
| the runner starts. | ||
|
|
||
| ## Retry behavior | ||
|
|
||
| BrowserStack API calls retry transient infrastructure responses once by default: | ||
|
|
||
| ```bash | ||
| E2E_BROWSERSTACK_API_RETRIES=1 | ||
| ``` | ||
|
|
||
| Retry applies to HTTP 429 and 5xx responses, and only to idempotent read/poll (GET) requests — build-creation and upload requests fail fast to avoid duplicate builds. Test assertion failures are not auto-retried by default so first-failure evidence is preserved. | ||
|
|
||
| ## Timeouts | ||
|
|
||
| BrowserStack polling uses these defaults: | ||
|
|
||
| ```bash | ||
| E2E_BROWSERSTACK_TIMEOUT_SECONDS=1800 | ||
| E2E_BROWSERSTACK_POLL_SECONDS=30 | ||
| ``` | ||
|
|
||
| If polling times out, the runner attempts to stop the BrowserStack build before recording the failure. | ||
|
|
||
| ## Local rerun notes | ||
|
|
||
| Use the BrowserStack run plan row from a failure report to identify the app target, platform, OS version tag, and suite: | ||
|
|
||
| ```bash | ||
| ruby e2e/scripts/e2e_matrix_to_browserstack_run_plan expand --index <index> | ||
| ruby e2e/scripts/e2e_matrix_to_browserstack_run_plan expand > /tmp/browserstack-run-plan.json | ||
| ``` | ||
|
|
||
| Use the reported resolved device to pin a rerun: | ||
|
|
||
| ```bash | ||
| E2E_DEVICE_OVERRIDE="<resolved BrowserStack device>" \ | ||
| e2e/scripts/execute_browserstack_run --index <index> --run-plan /tmp/browserstack-run-plan.json --tests-zip <e2e-tests.zip> --output-dir <results-dir> | ||
| ``` | ||
|
|
||
| The app artifact environment variable for the run plan row must point at the `.apk` or `.ipa` artifact before rerunning. | ||
|
|
||
| ## Failure triage | ||
|
|
||
| Use the GitHub Check Run or sticky PR failure comment first. Failure summaries should include Markdown links to: | ||
|
|
||
| - BrowserStack build | ||
| - failed testcase | ||
| - video | ||
| - screenshot | ||
| - Maestro command log | ||
| - Maestro log | ||
| - device log | ||
| - network log when enabled | ||
|
|
||
| BrowserStack artifact links require BrowserStack App Automate access. Sign in to [BrowserStack App Automate](https://app-automate.browserstack.com/dashboard/v2/builds) before opening evidence links. | ||
|
|
||
| Avoid posting additional PR comments for green runs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary "action to take" statement - this is already enabled