-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Retry Bitrise Pipeline
The purpose of this document is to show anyone who works within Bitrise to do the following common tasks:
- identify issues reported,
- (re)trigger builds
- unblock common issues. Bitrise grants us the ability to identify common causes of errors and permits reruns targeting failing workflows.
This section illustrates the common failures that could occur at different stages in the pipeline and how we could investigate those failures. Every PR must pass Bitrise before merging.
This stage performs the following:
- Builds the app (Firefox or Focus)
- Identifies lint issues
- Finds warnings
- Runs unit tests Here is an example pipeline that fails at build_applications and no workflows from run_tests are run. (picture here)
This stage could fail due to one of the steps or Bitrise related issues.
You can determine the cause of the failure by opening the logs:
- Click the workflow’s name (firefox_configure_build or focus_configure_build).
- Open the Tests tab for any unit test failures.
- Click Build Log for information for build failures, Swiftlint failures and any Bitrise errors. The same steps could be applied for focus_configure_build.
Ensure the supported version of Xcode is installed and invoked. See README of the repository for the currently supported version.
$ xcodebuild -version
Build the app using the command line.
$ cd firefox-ios/
$ xcodebuild build-for-testing -project Client.xcodeproj -scheme Fennec -configuration Fennec -sdk iphonesimulator -destination 'platform=iOS Simulator,name=<device>,OS=<iOS version>'
- Run
swiftlinton the command line.
- Run the unit tests in question using the command line.
$ cd firefox-ios/ $ xcodebuild test -target Client -scheme Fennec -destination 'platform=iOS Simulator,name=<device>,OS=<version>' -only-testing:<test> - If the unit tests in question passes, run the same tests repeatedly.
$ xcodebuild test -target Client -scheme Fennec -destination 'platform=iOS Simulator,name=<device>,OS=<version>' -test-iterations 100 -only-testing:<test>
If the unrelated unit tests fail intermittently, please retrigger the pipeline (see Retrigger the complete pipeline).
For any issues that are not covered above, please message @mobiletest on Slack.
run_tests consists of the XCUITest in the Smoke Tests suite running in parallel. The smoke tests consist of the key functionalities of the app.
- Click the failed workflow’s name under run_tests from the pipeline’s page.
- Identify the test’s name.
- Run the particular test using command line command locally.
For this example, the file would be
xcodebuild test -target Client -scheme Fennec -destination 'platform=iOS Simulator,name=<device>,OS=<version>' -only-testing:XCUITests/<file>/<test> -test-plan Smoketest<number>CreditCardsTests and the test would betestAutofillCreditCardsToggleOnOff. - For more information on the test failure reported by Bitrise, you may check the Build log. Scroll down to read the relevant section of the log.
- If the smoke test passes locally on your computer, please rebuild the unsuccessful workflow instead of rebuilding the whole pipeline.
In the event that the issue persists, please ping @mobiletest on Slack if you are unsure.
We can re-run the failing pipeline or workflow without committing a change to the branch.
If one of the workflows for smoke tests fails, you may run just the failed workflow. (See Test Retries for an explanation on how we handle intermittently failing tests.)
- Open the pipeline’s page on Bitrise.
- Open the Rebuild dropdown menu and select Rebuild unsuccessful Workflows.
- Open Bitrise Firefox iOS page. Locate the Manual Approval Builds section.
- Click Approve and run Build button for your PR.
⛔Important: Please do not re-run any part of the builds via Github. These links from Github do not invoke Bitrise properly.
If the pipeline fails on build_applications or earlier, you may retrigger the whole pipeline. An example use would be when a unit test fails intermittently.
- Open the pipeline’s page on Bitrise.
- Open the Rebuild dropdown menu and select Rebuild entire Pipeline.
- Go back to Bitrise Firefox iOS page. Locate the _Manual Approval Builds section. Click Approve and run Build button for your PR.
⛔Important: Please do not re-run any part of the builds via Github. These links do not invoke Bitrise properly.
If the Bitrise pipeline fails before the stages are run, there may be a syntax error in the bitrise.yml file. We can do a sanity check on this file by using Bitrise CLI.
- Install bitrise using brew:
brew update && brew install bitrise. - Run bitrise validate bitrise.yml.
It’s possible for the failing smoke tests to pass on retry because the smoke tests have a limit of 3 retries. In other words, if a smoke test fails initially, the test runner gives the smoke test another chance to pass. If the smoke test fails even after the retries, please debug the failing test locally.
Note that only Bitrise is needed to be green ✅ before the PR lands. Bitrise reports to Github as red ❌ if a smoke test did not pass initially. In the following example report from Github, this PR is ready to land.
If the Manual approval builds button does not appear or does not work for some reason, you may close and reopen the PR or fetch the changes from main to the branch.
- Go to the PR’s page on Github.
- Write a brief comment and click Close pull request.
- Write a brief comment and click Reopen pull request.
- Go to Bitrise Firefox iOS page on Bitrise. Scroll down to the list of running and recent pipelines to ensure that the pipeline is running.
- Open a terminal.
-
cdto the Firefox iOS repository. - Merge the latest changes from main to your branch.
- Go to the Bitrise Firefox iOS page on Bitrise.
- Scroll down to the list of running and recent pipelines to ensure that the pipeline is running.