Skip to content

Commit 393566b

Browse files
authored
Flaky tests Step Output (#46)
* Deploy test artifacts for e2e tests * Fix lint issue * Update available devices * Deploy assets as a compressed dir * Expose BITRISE_FLAKY_TEST_CASES Step Output * Add BITRISE_FLAKY_TEST_CASES Step Output * Fix maintenance tests * Fix flaky test cases env var export * Code cleanup * Add tests for flaky tests step output * Fix lint issue * Parse testlab test results * Fix test report parsing * Fix main.go * Code cleanup * Code cleanup * Update BITRISE_FLAKY_TEST_CASES Step Output description * Fix lint issue * Code cleanup * Print failed test runs log
1 parent abc2b01 commit 393566b

File tree

107 files changed

+30667
-806
lines changed

Some content is hidden

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

107 files changed

+30667
-806
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.bitrise*
22
_tmp
33
.idea
4+
.env

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ You can also run this step directly with [Bitrise CLI](https://github.com/bitris
5353
| Key | Description | Flags | Default |
5454
| --- | --- | --- | --- |
5555
| `zip_path` | Open finder, and navigate to the directory you designated for Derived Data output. Open the folder for your project, then the Build/Products folders inside it. You should see a folder Debug-iphoneos and PROJECT_NAME_iphoneos_DEVELOPMENT_TARGET-arm64.xctestrun. Select them both, then right-click on one of them and select Compress 2 items. | required | `$BITRISE_TEST_BUNDLE_ZIP_PATH` |
56-
| `test_devices` | Format: One device configuration per line and the parameters are separated with `,` in the order of: `deviceID,version,language,orientation` For example: `iphone8,14.7,en,portrait` `iphone8,14.7,en,landscape` Available devices and its versions: ``` ┌─────────────┬────────────────────────┬────────────────┬──────────────┐ │ MODEL_ID │ NAME │ OS_VERSION_IDS │ TAGS │ ├─────────────┼────────────────────────┼────────────────┼──────────────┤ │ ipad10 │ iPad (10th generation) │ 16.6 │ │ │ iphone11pro │ iPhone 11 Pro │ 16.6 │ │ │ iphone13pro │ iPhone 13 Pro │ 15.7,16.6 │ default │ │ iphone14pro │ iPhone 14 Pro │ 16.6 │ │ │ iphone15 │ iPhone 15 │ 18.0 │ preview=18.0 │ │ iphone15pro │ iPhone 15 Pro │ 18.0 │ preview=18.0 │ │ iphone8 │ iPhone 8 │ 15.7,16.6 │ │ └─────────────┴────────────────────────┴────────────────┴──────────────┘ ``` Device and OS Capacity: ``` ┌─────────────┬────────────────────────┬───────────────┬─────────────────┐ │ MODEL_ID │ MODEL_NAME │ OS_VERSION_ID │ DEVICE_CAPACITY │ ├─────────────┼────────────────────────┼───────────────┼─────────────────┤ │ ipad10 │ iPad (10th generation) │ 16.6 │ Low │ │ iphone11pro │ iPhone 11 Pro │ 16.6 │ High │ │ iphone13pro │ iPhone 13 Pro │ 15.7 │ Medium │ │ iphone13pro │ iPhone 13 Pro │ 16.6 │ High │ │ iphone14pro │ iPhone 14 Pro │ 16.6 │ High │ │ iphone15 │ iPhone 15 │ 18.0 │ Low │ │ iphone15pro │ iPhone 15 Pro │ 18.0 │ Medium │ │ iphone8 │ iPhone 8 │ 15.7 │ Medium │ │ iphone8 │ iPhone 8 │ 16.6 │ Medium │ └─────────────┴────────────────────────┴───────────────┴─────────────────┘ ``` | required | `iphone13pro,16.6,en,portrait` |
56+
| `test_devices` | Format: One device configuration per line and the parameters are separated with `,` in the order of: `deviceID,version,language,orientation` For example: `iphone8,14.7,en,portrait` `iphone8,14.7,en,landscape` Available devices and its versions: ``` ┌─────────────┬────────────────────────┬────────────────┬──────────────┐ │ MODEL_ID │ NAME │ OS_VERSION_IDS │ TAGS │ ├─────────────┼────────────────────────┼────────────────┼──────────────┤ │ ipad10 │ iPad (10th generation) │ 16.6 │ │ │ iphone11pro │ iPhone 11 Pro │ 16.6 │ │ │ iphone13pro │ iPhone 13 Pro │ 15.7,16.6 │ default │ │ iphone14pro │ iPhone 14 Pro │ 16.6 │ │ │ iphone15 │ iPhone 15 │ 18.0 │ preview=18.0 │ │ iphone15pro │ iPhone 15 Pro │ 18.0 │ preview=18.0 │ │ iphone8 │ iPhone 8 │ 15.7,16.6 │ │ └─────────────┴────────────────────────┴────────────────┴──────────────┘ ``` Device and OS Capacity: ``` ┌─────────────┬────────────────────────┬───────────────┬─────────────────┐ │ MODEL_ID │ MODEL_NAME │ OS_VERSION_ID │ DEVICE_CAPACITY │ ├─────────────┼────────────────────────┼───────────────┼─────────────────┤ │ ipad10 │ iPad (10th generation) │ 16.6 │ Low │ │ iphone11pro │ iPhone 11 Pro │ 16.6 │ High │ │ iphone13pro │ iPhone 13 Pro │ 15.7 │ High │ │ iphone13pro │ iPhone 13 Pro │ 16.6 │ High │ │ iphone14pro │ iPhone 14 Pro │ 16.6 │ High │ │ iphone15 │ iPhone 15 │ 18.0 │ Medium │ │ iphone15pro │ iPhone 15 Pro │ 18.0 │ Medium │ │ iphone8 │ iPhone 8 │ 15.7 │ Medium │ │ iphone8 │ iPhone 8 │ 16.6 │ High │ └─────────────┴────────────────────────┴───────────────┴─────────────────┘ ``` | required | `iphone13pro,16.6,en,portrait` |
5757
| `test_timeout` | Max time a test execution is allowed to run before it is automatically canceled. The default value is 900 (15 min). Duration in seconds with up to nine fractional digits. Example: "3.5". | | `900` |
5858
| `download_test_results` | If this input is set to `true` all files generated in the test run will be downloaded. Otherwise, no any file will be downloaded. | required | `false` |
59+
| `num_flaky_test_attempts` | 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 initially fails but succeeds on any reattempt is reported as FLAKY. The maximum number of reruns allowed is 10. (Default: 0, which implies no reruns.) | required | `0` |
5960
| `api_base_url` | The URL where test API is accessible. | required | `https://vdt.bitrise.io/test` |
6061
| `api_token` | The token required to authenticate with the API. | required, sensitive | `$ADDON_VDTESTING_API_TOKEN` |
6162
</details>
@@ -66,6 +67,7 @@ You can also run this step directly with [Bitrise CLI](https://github.com/bitris
6667
| Environment Variable | Description |
6768
| --- | --- |
6869
| `VDTESTING_DOWNLOADED_FILES_DIR` | The directory containing the downloaded files if you have set `download_test_results` inputs above. |
70+
| `BITRISE_FLAKY_TEST_CASES` | A list of 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: ``` - TestSuit_1.TestClass_1.TestName_1 - TestSuit_1.TestClass_1.TestName_2 - TestSuit_1.TestClass_2.TestName_1 - TestSuit_2.TestClass_1.TestName_1 ... ``` To export `BITRISE_FLAKY_TEST_CASES` Step Output `download_test_results` Step Input should be set to `true`. |
6971
</details>
7072

7173
## 🙋 Contributing

bitrise.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ workflows:
5353
else
5454
echo "VDTESTING_DOWNLOADED_FILES_DIR: $VDTESTING_DOWNLOADED_FILES_DIR"
5555
fi
56+
- deploy-to-bitrise-io@2:
57+
inputs:
58+
- is_compress: "true"
59+
- deploy_path: $VDTESTING_DOWNLOADED_FILES_DIR
5660

5761
maintenance:
5862
steps:

go.mod

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@ module github.com/bitrise-steplib/steps-virtual-device-testing-for-ios
33
go 1.21
44

55
require (
6-
github.com/bitrise-io/go-steputils v1.0.2
76
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.37
87
github.com/bitrise-io/go-utils v1.0.13
9-
github.com/pkg/errors v0.8.1
8+
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.25
9+
github.com/stretchr/testify v1.10.0
1010
google.golang.org/api v0.83.0
1111
)
1212

1313
require (
1414
cloud.google.com/go/compute v1.6.1 // indirect
15-
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23 // indirect
15+
github.com/davecgh/go-spew v1.1.1 // indirect
1616
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
1717
github.com/golang/protobuf v1.5.2 // indirect
18+
github.com/google/go-cmp v0.6.0 // indirect
1819
github.com/googleapis/gax-go/v2 v2.4.0 // indirect
20+
github.com/pmezard/go-difflib v1.0.0 // indirect
21+
github.com/stretchr/objx v0.5.2 // indirect
1922
go.opencensus.io v0.23.0 // indirect
2023
golang.org/x/net v0.0.0-20220607020251-c690dde0001d // indirect
2124
golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb // indirect
@@ -25,4 +28,5 @@ require (
2528
google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac // indirect
2629
google.golang.org/grpc v1.47.0 // indirect
2730
google.golang.org/protobuf v1.28.0 // indirect
31+
gopkg.in/yaml.v3 v3.0.1 // indirect
2832
)

go.sum

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,12 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
5555
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
5656
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
5757
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
58-
github.com/bitrise-io/go-steputils v1.0.2 h1:BEFG87r7uA/Yabk4SmuxP2yOgjjO+YGsDOYXtUH8IJ0=
59-
github.com/bitrise-io/go-steputils v1.0.2/go.mod h1:YIUaQnIAyK4pCvQG0hYHVkSzKNT9uL2FWmkFNW4mfNI=
6058
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.37 h1:2ovetrqRLDcs/i4PZEVbEkQhV6w/GHWpCXtLVwpAgu8=
6159
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.37/go.mod h1:ofknYj6lj4hDtg7lV/veUQ1DJWDEFctjhYoIC8m70Os=
62-
github.com/bitrise-io/go-utils v1.0.1/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY=
6360
github.com/bitrise-io/go-utils v1.0.13 h1:1QENhTS/JlKH9F7+/nB+TtbTcor6jGrE6cQ4CJWfp5U=
6461
github.com/bitrise-io/go-utils v1.0.13/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY=
65-
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23 h1:Dfh4nyZPuEtilBisidejqxBrkx9cWvbOUrpq8VEION0=
66-
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23/go.mod h1:3XUplo0dOWc3DqT2XA2SeHToDSg7+j1y1HTHibT2H68=
62+
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.25 h1:ektrSsM00OMKfcyZ+Sn/XWV7YMYuHAsFpELq8dBLKm0=
63+
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.25/go.mod h1:3XUplo0dOWc3DqT2XA2SeHToDSg7+j1y1HTHibT2H68=
6764
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
6865
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
6966
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
@@ -146,8 +143,9 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
146143
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
147144
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
148145
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
149-
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
150146
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
147+
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
148+
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
151149
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
152150
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
153151
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
@@ -188,11 +186,11 @@ github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:
188186
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
189187
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
190188
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
189+
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
191190
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
192191
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
192+
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
193193
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
194-
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
195-
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
196194
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
197195
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
198196
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
@@ -209,8 +207,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
209207
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
210208
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
211209
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
212-
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
213-
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
210+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
211+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
214212
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
215213
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
216214
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -647,6 +645,7 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
647645
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
648646
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
649647
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
648+
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
650649
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
651650
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
652651
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

0 commit comments

Comments
 (0)