Skip to content

Commit 093250a

Browse files
authored
Flaky tests env var (#259)
* Initial flaky test case export * Export BITRISE_FLAKY_TEST_CASES env var * Update Exporter mock for tests * Test BITRISE_FLAKY_TEST_CASES env var * Add more tests for flaky test case export * Add BITRISE_FLAKY_TEST_CASES step output * Update README * Update simulator version for test_test_plan e2e test * Code cleanup and skipp test_test_plan on Xcode 26 * Add test bundle name to the exported flaky test cases * Fix yaml lint issues * Fix more yamllint issues * Fix e2e test run_if * Limit BITRISE_FLAKY_TEST_CASES env var value
1 parent d0bfcff commit 093250a

File tree

820 files changed

+5688
-12
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

820 files changed

+5688
-12
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ Run tests with custom xcconfig file path:
124124
| `BITRISE_XCODE_TEST_ATTACHMENTS_PATH` | This is the path of the test attachments zip. |
125125
| `BITRISE_XCODEBUILD_BUILD_LOG_PATH` | If `single_build` is set to false, the step runs `xcodebuild build` before the test, and exports the raw xcodebuild log. |
126126
| `BITRISE_XCODEBUILD_TEST_LOG_PATH` | The step exports the `xcodebuild test` command output log. |
127+
| `BITRISE_FLAKY_TEST_CASES` | A test case is considered flaky if it has failed at least once, but passed at least once as well. The list contains the test cases in the following format: ``` - TestTarget_1.TestClass_1.TestMethod_1 - TestTarget_1.TestClass_1.TestMethod_2 - TestTarget_1.TestClass_2.TestMethod_1 - TestTarget_2.TestClass_1.TestMethod_1 ... ``` |
127128
</details>
128129

129130
## 🙋 Contributing

e2e/bitrise.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,27 @@ workflows:
3636

3737
# Requires Xcode 11+
3838
test_test_plan:
39+
description: |-
40+
This test fails on Xcode 26 with: 'BullsEye (33951) encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. (Underlying Error: Crash: BullsEye (33951) <external symbol>))' error.
41+
Example build: https://app.bitrise.io/build/c71f9c3a-e164-423f-8779-d4c8db69827a
42+
before_run:
43+
- _expose_xcode_version
44+
steps:
45+
- bitrise-run:
46+
run_if: |-
47+
{{ getenv "XCODE_MAJOR_VERSION" | ne "26" }}
48+
inputs:
49+
- workflow_id: utility_test_test_plan
50+
- bitrise_config_path: ./e2e/bitrise.yml
51+
52+
utility_test_test_plan:
3953
envs:
4054
- TEST_APP_URL: https://github.com/bitrise-io/sample-swift-project-with-parallel-ui-test.git
4155
- TEST_APP_BRANCH: master
4256
- BITRISE_PROJECT_PATH: BullsEye.xcworkspace
4357
- BITRISE_SCHEME: BullsEye
4458
- TEST_PLAN: UnitTests
45-
- DESTINATION: platform=iOS Simulator,name=iPhone 12,OS=latest
59+
- DESTINATION: platform=iOS Simulator,name=Bitrise iOS default,OS=latest
4660
- LOG_FORMATTER: xcbeautify
4761
- EXPECT_TEST_FAILURE: "false"
4862
- CACHE_LEVEL: swift_packages
@@ -263,3 +277,25 @@ workflows:
263277
echo "BITRISE_CACHE_INCLUDE_PATHS is empty"
264278
exit 1
265279
fi
280+
281+
_expose_xcode_version:
282+
steps:
283+
- script:
284+
title: Expose Xcode major version
285+
inputs:
286+
- content: |-
287+
#!/bin/env bash
288+
set -e
289+
if [[ ! -z "$XCODE_MAJOR_VERSION" ]]; then
290+
echo "Xcode major version already exposed: $XCODE_MAJOR_VERSION"
291+
exit 0
292+
fi
293+
version=`xcodebuild -version`
294+
regex="Xcode ([0-9]*)."
295+
if [[ ! $version =~ $regex ]]; then
296+
echo "Failed to determine Xcode major version"
297+
exit 1
298+
fi
299+
xcode_major_version=${BASH_REMATCH[1]}
300+
echo "Xcode major version: $xcode_major_version"
301+
envman add --key XCODE_MAJOR_VERSION --value $xcode_major_version

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ require (
1010
github.com/bitrise-io/go-utils v1.0.13
1111
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23
1212
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.53
13+
github.com/bitrise-steplib/steps-deploy-to-bitrise-io v0.0.0-20250707145051-550b658b019b
1314
github.com/hashicorp/go-version v1.7.0
1415
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
1516
github.com/stretchr/testify v1.10.0
@@ -18,9 +19,9 @@ require (
1819
require (
1920
github.com/bitrise-io/envman v0.0.0-20240730123632-8066eeb61599 // indirect
2021
github.com/bitrise-io/go-steputils v1.0.6 // indirect
22+
github.com/bitrise-io/go-xcode v1.1.2 // indirect
2123
github.com/bitrise-io/stepman v0.0.0-20240828074035-6ae1a5f5efde // indirect
2224
github.com/davecgh/go-spew v1.1.1 // indirect
23-
github.com/google/go-cmp v0.6.0 // indirect
2425
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
2526
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
2627
github.com/kr/pretty v0.3.1 // indirect
@@ -34,4 +35,5 @@ require (
3435
golang.org/x/text v0.21.0 // indirect
3536
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
3637
gopkg.in/yaml.v3 v3.0.1 // indirect
38+
howett.net/plist v1.0.1 // indirect
3739
)

go.sum

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ github.com/bitrise-io/go-utils v1.0.13 h1:1QENhTS/JlKH9F7+/nB+TtbTcor6jGrE6cQ4CJ
1111
github.com/bitrise-io/go-utils v1.0.13/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY=
1212
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23 h1:Dfh4nyZPuEtilBisidejqxBrkx9cWvbOUrpq8VEION0=
1313
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23/go.mod h1:3XUplo0dOWc3DqT2XA2SeHToDSg7+j1y1HTHibT2H68=
14+
github.com/bitrise-io/go-xcode v1.1.2 h1:7tit56lNPPzH714pBt083z/iZh7P44vgVsNrEdvkYG4=
15+
github.com/bitrise-io/go-xcode v1.1.2/go.mod h1:9OwsvrhZ4A2JxHVoEY7CPcABAKA+OE7FQqFfBfvbFuY=
1416
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.53 h1:Ud59kqcvRulyEx8WsM+DpYlubRWhG4zAGE2ORHIcQYo=
1517
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.53/go.mod h1:T4rhWQljdgH5As4Dq/RQWuazdScY0YB7uZAMuBUnxeY=
1618
github.com/bitrise-io/stepman v0.0.0-20240828074035-6ae1a5f5efde h1:LinFhZG5OdayDh1T1JO8QANsNwQWzqORZ0A9EGHQ0ps=
1719
github.com/bitrise-io/stepman v0.0.0-20240828074035-6ae1a5f5efde/go.mod h1:Lq9nEqKerBD35w3eSU8lf83F7uZPkXfmRSZEUDJN40w=
20+
github.com/bitrise-steplib/steps-deploy-to-bitrise-io v0.0.0-20250707145051-550b658b019b h1:/Gd2kLTzdcnmPyhoirrAPE66Dt4JV2Kh8iFRw+vcuGk=
21+
github.com/bitrise-steplib/steps-deploy-to-bitrise-io v0.0.0-20250707145051-550b658b019b/go.mod h1:p7uINAQkv4SXH7Mgrd/NDGYWZ65c/BT7GIqAfpCWvfQ=
1822
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
1923
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2024
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -34,6 +38,7 @@ github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISH
3438
github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
3539
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
3640
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
41+
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
3742
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
3843
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
3944
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
@@ -85,9 +90,12 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
8590
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
8691
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
8792
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
93+
gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg=
8894
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
8995
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
9096
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
9197
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
9298
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
9399
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
100+
howett.net/plist v1.0.1 h1:37GdZ8tP09Q35o9ych3ehygcsL+HqKSwzctveSlarvM=
101+
howett.net/plist v1.0.1/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g=

output/mocks/Logger.go

Lines changed: 130 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)