fastlane-plugin-test_center 3.5.0 â 3.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +98 -61
- data/lib/fastlane/plugin/test_center/actions/collate_html_reports.rb +4 -0
- data/lib/fastlane/plugin/test_center/actions/collate_json_reports.rb +4 -0
- data/lib/fastlane/plugin/test_center/actions/collate_junit_reports.rb +4 -0
- data/lib/fastlane/plugin/test_center/actions/collate_test_result_bundles.rb +4 -0
- data/lib/fastlane/plugin/test_center/actions/multi_scan.rb +4 -0
- data/lib/fastlane/plugin/test_center/actions/suppress_tests.rb +4 -0
- data/lib/fastlane/plugin/test_center/actions/suppress_tests_from_junit.rb +4 -0
- data/lib/fastlane/plugin/test_center/actions/suppressed_tests.rb +4 -0
- data/lib/fastlane/plugin/test_center/actions/tests_from_junit.rb +4 -0
- data/lib/fastlane/plugin/test_center/actions/tests_from_xctestrun.rb +4 -0
- data/lib/fastlane/plugin/test_center/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1eaa0f4225d01562a8fe0726ac8b542597e25a2f
|
4
|
+
data.tar.gz: da812fdf4b4d3c199537361331ce2ba325b864c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e628ee3ea5f790c0f94e08d28e6b6103f7263955f806a054de77a6a359f93f2c4dce38297ffc694daf3096f08bb49e211e226545fceaa0224da0ff3a4728c775
|
7
|
+
data.tar.gz: 851ccddfcdc15fbf01de62956c1243102068b773d7b74832f845ea490a6511c8a4885b37d5171b913c8e48bc9cd6193d240a64a12e9feb0025a38706a4e2cd32
|
data/README.md
CHANGED
@@ -1,8 +1,24 @@
|
|
1
|
-
# test_center plugin đ¯
|
2
1
|
|
2
|
+
<!--
|
3
|
+
<img src="docs/test_center_banner.png" />
|
4
|
+
-->
|
5
|
+
|
6
|
+
# test_center plugin đ¯
|
3
7
|
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-test_center)
|
4
8
|
|
5
|
-
|
9
|
+
Have you ever spent too much time trying to fix fragile tests only to give up with nothing real to show? Use the `fastlane` actions from `test_center` to remove internal and external interference from your tests, so that you can focus on what makes đ°: features that customers love đ.
|
10
|
+
|
11
|
+
<p align="center">
|
12
|
+
<a href="#quick-start">Quick Start</a> |
|
13
|
+
<a href="#overview">Overview</a> |
|
14
|
+
<a href="#issues-and-feedback">Issues and Feedback</a> |
|
15
|
+
<a href="#contributing">Contributing</a> |
|
16
|
+
<a href="#license">License</a>
|
17
|
+
</p>
|
18
|
+
|
19
|
+
<img src="docs/multi_scan.gif" />
|
20
|
+
|
21
|
+
## Quick Start
|
6
22
|
|
7
23
|
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-test_center`, add it to your project by running:
|
8
24
|
|
@@ -10,53 +26,51 @@ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To
|
|
10
26
|
fastlane add_plugin test_center
|
11
27
|
```
|
12
28
|
|
13
|
-
|
14
|
-
|
15
|
-
This plugin makes testing your iOS app easier by providing you actions that give you greater control over everthing related to testing your app.
|
29
|
+
Add this example 'lane' to your `Fastfile`, change `MY_XCODE_PROJECT_FILEPATH` to point to your project path, and change the option `scheme: AtomicBoy` in the call to `multi_scan` to be the name of your Xcode projects Scheme:
|
16
30
|
|
17
|
-
|
31
|
+
```ruby
|
18
32
|
|
33
|
+
################################################################################
|
34
|
+
# An example of how one can use the plugin's :multi_scan action to run tests
|
35
|
+
# that have not yet passed (up to 3 times). If, after the 3 runs of the tests, there
|
36
|
+
# are still failing tests, print out the number of tests that are still failing.
|
37
|
+
#
|
38
|
+
# For a walkthrough to write a lane that can run tests up to 3 times, suppress
|
39
|
+
# the failing tests in the Xcode project, and create a Github Pull Request, see:
|
40
|
+
# https://github.com/lyndsey-ferguson/fastlane-plugin-test_center/blob/master/docs/WALKTHROUGH.md
|
41
|
+
################################################################################
|
42
|
+
|
43
|
+
MY_XCODE_PROJECT_FILEPATH = File.absolute_path('../AtomicBoy/AtomicBoy.xcodeproj')
|
44
|
+
lane :sweep do
|
45
|
+
test_run_block = lambda do |testrun_info|
|
46
|
+
failed_test_count = testrun_info[:failed].size
|
47
|
+
|
48
|
+
if testrun_info[:failed_testcount] > 0
|
49
|
+
UI.important('The run of tests would finish with failures due to fragile tests here.')
|
50
|
+
|
51
|
+
try_attempt = testrun_info[:try_count]
|
52
|
+
if try_attempt < 3
|
53
|
+
UI.header('Since we are using :multi_scan, we can re-run just those failing tests!')
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
result = multi_scan(
|
59
|
+
project: MY_XCODE_PROJECT_FILEPATH,
|
60
|
+
try_count: 3,
|
61
|
+
fail_build: false,
|
62
|
+
scheme: 'AtomicBoy',
|
63
|
+
testrun_completed_block: test_run_block
|
64
|
+
)
|
65
|
+
unless result[:failed_testcount].zero?
|
66
|
+
UI.info("There are #{failed_tests.size} legitimate failing tests")
|
67
|
+
end
|
68
|
+
end
|
19
69
|
```
|
20
|
-
đ - code is done, time to run the automated tests
|
21
|
-
|
22
|
-
â
â
â
â
â
âââ
ââ
â
âââ
â
â
â
â
ââ
â
â
â
â
â
â
â
ââ
â
â
â
âââ
â
ââââ
â
â
â
â
â
ââ
â
|
23
|
-
|
24
|
-
đ¤ - most of these tests run fine locally and I do not know how to fix them...
|
25
|
-
|
26
|
-
đ - bummer, maybe if I re-run the tests?
|
27
|
-
|
28
|
-
â
â
â
â
â
ââ
â
â
ââ
ââ
â
â
ââ
â
â
âââ
â
â
â
â
â
â
â
âââ
â
ââ
â
â
ââ
â
â
â
ââ
â
â
â
â
|
29
|
-
|
30
|
-
âšī¸ - aw man, still failing? One more time? đ¤
|
31
|
-
|
32
|
-
â
â
â
â
âââ
â
â
â
â
â
â
â
â
â
â
ââ
â
ââ
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
ââ
â
â
â
â
â
ââ
â
â
|
33
|
-
|
34
|
-
đĄ - this is terrible, my tests keep failing randomly!
|
35
|
-
|
36
|
-
đ¤ - maybe there is a better way?
|
37
|
-
|
38
|
-
đ đĄ đ
|
39
|
-
|
40
|
-
> enter multi_scan
|
41
70
|
|
42
|
-
|
71
|
+
## Overview
|
43
72
|
|
44
|
-
|
45
|
-
|
46
|
-
đ - bummer, maybe if I re-run multi_scan again?
|
47
|
-
|
48
|
-
â
â
â
â
â
ââ
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
ââ
â
â
â
â
â
â
â
â
â
|
49
|
-
|
50
|
-
đ - hmmm, maybe these are real test failures?
|
51
|
-
|
52
|
-
â
â
â
â
â
ââ
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
ââ
â
â
â
â
â
â
â
â
â
|
53
|
-
|
54
|
-
đ - okay, these are real test failures, time to fix them!
|
55
|
-
|
56
|
-
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
â
|
57
|
-
|
58
|
-
đ - green is joy!
|
59
|
-
```
|
73
|
+
This plugin makes testing your iOS app easier by providing you actions that give you greater control over everthing related to testing your app.
|
60
74
|
|
61
75
|
`multi_scan` began when I engineered an action to only re-run the failed tests in order to determine which ones were truly failing, or just failing randomly due to a fragile infrastructure. This action morphed into an entire plugin with many actions related to tests.
|
62
76
|
|
@@ -74,16 +88,28 @@ This fastlane plugin includes the following actions:
|
|
74
88
|
|
75
89
|
### multi_scan đ
|
76
90
|
|
77
|
-
|
91
|
+
Use `:multi_scan` intead of `:scan` to improve the usefulness of iOS test results, inspect partial results periodically during a test run, and provide better results reporting.
|
92
|
+
|
93
|
+
#### Improving Usefulness
|
78
94
|
|
79
|
-
|
95
|
+
Over time, your tests can change the state of your application in unexpected ways that cause other tests to fail randomly. Or, the tools and infrastructure for testing are the root causes of random test failures. The test results may not truly reflect how the product code is working.
|
80
96
|
|
81
|
-
|
97
|
+
Rather than wasting time trying to account for instable tools, or trying to tweak your test code ad-nauseum to get a passing result reliably, just use the `:try_count` option to run `:scan` multiple times, running only the tests that failed each time. This ensures that any _fragility_ is ironed out over a number of "tries". The end result is that only the truly failing tests appear.
|
82
98
|
|
83
|
-
|
99
|
+
Another issue that can cause tests to incorrectly fail comes from an issue with the iOS Simulator. If you provide a huge number of tests to the iOS Simulator, it can exhaust the available resources and cause it to fail large numbers of tests. You can get around this by running your tests in batches using the `:batch_count` option in order to lighten the load on the simulator.
|
100
|
+
|
101
|
+
#### Inspect Partial Results
|
102
|
+
|
103
|
+
If you have a large number of tests, and you want to inspect the overall status of how test runs are progressing, you can use the `:testrun_completed_block` callback to bailout early or make adjustments on how your tests are exercised.
|
104
|
+
|
105
|
+
#### Better Results Reporting
|
106
|
+
|
107
|
+
Do you have multiple test targets and the normal operation of `:scan` is providing you a test report that implies that all the tests ran in just one test target? Don't worry, `:multi_scan` has fixed that. It will provide a separate test report for each test target. It can handle JUnit, HTML, JSON, and Apple's `test_result` bundles.
|
108
|
+
|
109
|
+
`test_result` bundles are particularly useful because they contain screenshots of the UI when a UI test fails so you can review what was actually there compared to what you expected.
|
84
110
|
|
85
111
|
<details>
|
86
|
-
<summary>Example Code:</summary>
|
112
|
+
<summary>Example Code (expand to view):</summary>
|
87
113
|
<!-- multi_scan examples: begin -->
|
88
114
|
|
89
115
|
```ruby
|
@@ -242,12 +268,12 @@ multi_scan(
|
|
242
268
|
|
243
269
|
### suppress_tests_from_junit
|
244
270
|
|
245
|
-
|
271
|
+
Do you not have time to fix a test and it can be tested manually? You can suppress the `:failed` tests in your project and create and prioritize a ticket in your bug tracking system.
|
246
272
|
|
247
|
-
|
273
|
+
Do you want to create a special CI job that only re-tries failing tests? Suppress the `:passing` tests in your project and exercise your fragile tests.
|
248
274
|
|
249
275
|
<details>
|
250
|
-
<summary>Example Code:</summary>
|
276
|
+
<summary>Example Code (expand to view):</summary>
|
251
277
|
<!-- suppress_tests_from_junit examples: begin -->
|
252
278
|
|
253
279
|
```ruby
|
@@ -292,7 +318,7 @@ UI.message(
|
|
292
318
|
Have some tests that you want turned off? Give the list to this action in order to suppress them for your project.
|
293
319
|
|
294
320
|
<details>
|
295
|
-
<summary>Example Code:</summary>
|
321
|
+
<summary>Example Code (expand to view):</summary>
|
296
322
|
<!-- suppress_tests examples: begin -->
|
297
323
|
|
298
324
|
```ruby
|
@@ -352,7 +378,7 @@ suppress_tests(
|
|
352
378
|
Do you have an automated process that requires the list of suppressed tests in your project? Use this action to get that.
|
353
379
|
|
354
380
|
<details>
|
355
|
-
<summary>Example Code:</summary>
|
381
|
+
<summary>Example Code (expand to view):</summary>
|
356
382
|
<!-- suppressed_tests examples: begin -->
|
357
383
|
|
358
384
|
```ruby
|
@@ -402,7 +428,7 @@ UI.message("tests: #{tests}")
|
|
402
428
|
Performing analysis on a test report file? Get the lists of failing and passing tests using this action.
|
403
429
|
|
404
430
|
<details>
|
405
|
-
<summary>Example Code:</summary>
|
431
|
+
<summary>Example Code (expand to view):</summary>
|
406
432
|
<!-- tests_from_junit examples: begin -->
|
407
433
|
|
408
434
|
```ruby
|
@@ -424,7 +450,7 @@ UI.message("Failed tests: #{result[:failed]}")
|
|
424
450
|
Do you have multiple test targets referenced by your `xctestrun` file and need to know all the tests? Use this action to go through each test target, collect the tests, and return them to you in a simple and usable structure.
|
425
451
|
|
426
452
|
<details>
|
427
|
-
<summary>Example Code:</summary>
|
453
|
+
<summary>Example Code (expand to view):</summary>
|
428
454
|
<!-- tests_from_xctestrun examples: begin -->
|
429
455
|
|
430
456
|
```ruby
|
@@ -460,7 +486,7 @@ tests.values.flatten.each { |test_identifier| puts test_identifier }
|
|
460
486
|
Do you have multiple junit test reports coming in from different sources and need it combined? Use this action to collate all the tests performed for a given test target into one report file.
|
461
487
|
|
462
488
|
<details>
|
463
|
-
<summary>Example Code:</summary>
|
489
|
+
<summary>Example Code (expand to view):</summary>
|
464
490
|
<!-- collate_junit_reports examples: begin -->
|
465
491
|
|
466
492
|
```ruby
|
@@ -484,7 +510,7 @@ collate_junit_reports(
|
|
484
510
|
Do you have multiple html test reports coming in from different sources and need it combined? Use this action to collate all the tests performed for a given test target into one report file.
|
485
511
|
|
486
512
|
<details>
|
487
|
-
<summary>Example Code:</summary>
|
513
|
+
<summary>Example Code (expand to view):</summary>
|
488
514
|
<!-- collate_html_reports examples: begin -->
|
489
515
|
|
490
516
|
```ruby
|
@@ -508,7 +534,7 @@ collate_html_reports(
|
|
508
534
|
Do you have multiple json test reports coming in from different sources and need it combined? Use this action to collate all the tests performed for a given test target into one report file.
|
509
535
|
|
510
536
|
<details>
|
511
|
-
<summary>Example Code:</summary>
|
537
|
+
<summary>Example Code (expand to view):</summary>
|
512
538
|
<!-- collate_json_reports examples: begin -->
|
513
539
|
|
514
540
|
```ruby
|
@@ -532,7 +558,7 @@ collate_json_reports(
|
|
532
558
|
Do you have multiple test_result bundles coming in from different sources and need it combined? Use this action to collate all the tests performed for a given test target into one test_result bundle.
|
533
559
|
|
534
560
|
<details>
|
535
|
-
<summary>Example Code:</summary>
|
561
|
+
<summary>Example Code (expand to view):</summary>
|
536
562
|
<!-- collate_test_result_bundles examples: begin -->
|
537
563
|
|
538
564
|
```ruby
|
@@ -566,7 +592,11 @@ rubocop -a
|
|
566
592
|
|
567
593
|
## Issues and Feedback
|
568
594
|
|
569
|
-
For any other issues and feedback about this plugin, please submit it to this repository.
|
595
|
+
For any other issues and feedback about this plugin, please [submit it](https://github.com/lyndsey-ferguson/fastlane-plugin-test_center/issues) to this repository.
|
596
|
+
|
597
|
+
## Contributing
|
598
|
+
|
599
|
+
If you would like to contribute to this plugin, please review the [contributing document][contributing doc].
|
570
600
|
|
571
601
|
## Troubleshooting
|
572
602
|
|
@@ -579,3 +609,10 @@ For more information about how the `fastlane` plugin system works, check out the
|
|
579
609
|
## About _fastlane_
|
580
610
|
|
581
611
|
_fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
612
|
+
|
613
|
+
## License
|
614
|
+
|
615
|
+
MIT
|
616
|
+
|
617
|
+
<!-- Links -->
|
618
|
+
[contributing doc]: ./docs/CONTRIBUTING.md
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-test_center
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.
|
4
|
+
version: 3.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lyndsey Ferguson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|