Skip to content

Commit abc2b01

Browse files
authored
Failed test retry (#42)
* Modernize step * Fix go lint issues * Fix lint issue * Update available devices list * Update e2e test project * Update default test device * Update default test device * Fix test timeout param * Update sample project * Automatic code signing in tests * Update certificates * Update destination for xcode-build-for-testing step * Fix yamllint issues * Update destination * Add sdk option * Use default destination * Specify test plan * Add num_flaky_test_attempts step input * Add failed test retry
1 parent a168355 commit abc2b01

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

bitrise.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ workflows:
4040
- path::./:
4141
inputs:
4242
- download_test_results: "true"
43+
- num_flaky_test_attempts: 2
4344
- script:
4445
title: Output check
4546
inputs:

main.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ type ConfigsModel struct {
3535
AppSlug string `env:"BITRISE_APP_SLUG,required"`
3636

3737
// shared
38-
ZipPath string `env:"zip_path,file"`
39-
TestDevices string `env:"test_devices,required"`
40-
TestTimeout float64 `env:"test_timeout,range[0..2700]"`
41-
DownloadTestResults bool `env:"download_test_results,opt[false,true]"`
38+
ZipPath string `env:"zip_path,file"`
39+
TestDevices string `env:"test_devices,required"`
40+
TestTimeout float64 `env:"test_timeout,range[0..2700]"`
41+
DownloadTestResults bool `env:"download_test_results,opt[false,true]"`
42+
NumFlakyTestAttempts int `env:"num_flaky_test_attempts,range[0..10]"`
4243
}
4344

4445
// UploadURLRequest ...
@@ -115,6 +116,7 @@ func main() {
115116
testModel := &testing.TestMatrix{}
116117
testModel.EnvironmentMatrix = &testing.EnvironmentMatrix{IosDeviceList: &testing.IosDeviceList{}}
117118
testModel.EnvironmentMatrix.IosDeviceList.IosDevices = []*testing.IosDevice{}
119+
testModel.FlakyTestAttempts = int64(configs.NumFlakyTestAttempts)
118120

119121
scanner := bufio.NewScanner(strings.NewReader(configs.TestDevices))
120122
for scanner.Scan() {

step.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,15 @@ inputs:
166166
value_options:
167167
- "false"
168168
- "true"
169+
- num_flaky_test_attempts: "0"
170+
opts:
171+
title: Number of times a test execution is reattempted
172+
summary: Specifies the number of times a test execution should be reattempted if one or more of its test cases fail for any reason.
173+
description: |-
174+
Specifies the number of times a test execution should be reattempted if one or more of its test cases fail for any reason. An execution that
175+
initially fails but succeeds on any reattempt is reported as FLAKY.
176+
The maximum number of reruns allowed is 10. (Default: 0, which implies no reruns.)
177+
is_required: true
169178
- api_base_url: https://vdt.bitrise.io/test
170179
opts:
171180
title: Test API's base URL

0 commit comments

Comments
 (0)