fastlane-plugin-test_center 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +52 -0
- data/lib/fastlane/plugin/test_center.rb +16 -0
- data/lib/fastlane/plugin/test_center/actions/suppress_tests.rb +122 -0
- data/lib/fastlane/plugin/test_center/actions/test_center_action.rb +44 -0
- data/lib/fastlane/plugin/test_center/helper/test_center_helper.rb +12 -0
- data/lib/fastlane/plugin/test_center/version.rb +5 -0
- metadata +162 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 85e6cf44f104832ab85c9816adf67983844a6c4d
|
4
|
+
data.tar.gz: 6e166c48e796a9d76ad53bb3c5e2e9382f2a6712
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 86e6bf6df5e33e25f8f93826e35b6d0eaae491b08072094fc52aa35922319f8b6fc52e976fbaa60bcb60ebd9c3af7e73d1457f231153a03d92134f2916812e54
|
7
|
+
data.tar.gz: 887914bbdefb1a846588769483d28fa120592042d7fd7886d7133de2cbb34d6c7ec8b0afa3079b40de0d7456f31687d02b9772bf74a0611ece4e654e3c5062db
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Lyndsey Ferguson <lyndsey.ferguson@appian.com>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# test_center plugin
|
2
|
+
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-test_center)
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
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
|
+
|
9
|
+
```bash
|
10
|
+
fastlane add_plugin test_center
|
11
|
+
```
|
12
|
+
|
13
|
+
## About test_center
|
14
|
+
|
15
|
+
Makes testing your iOS app easier
|
16
|
+
|
17
|
+
**Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
|
18
|
+
|
19
|
+
## Example
|
20
|
+
|
21
|
+
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
22
|
+
|
23
|
+
**Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
|
24
|
+
|
25
|
+
## Run tests for this plugin
|
26
|
+
|
27
|
+
To run both the tests, and code style validation, run
|
28
|
+
|
29
|
+
```
|
30
|
+
rake
|
31
|
+
```
|
32
|
+
|
33
|
+
To automatically fix many of the styling issues, use
|
34
|
+
```
|
35
|
+
rubocop -a
|
36
|
+
```
|
37
|
+
|
38
|
+
## Issues and Feedback
|
39
|
+
|
40
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
41
|
+
|
42
|
+
## Troubleshooting
|
43
|
+
|
44
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
45
|
+
|
46
|
+
## Using _fastlane_ Plugins
|
47
|
+
|
48
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
49
|
+
|
50
|
+
## About _fastlane_
|
51
|
+
|
52
|
+
_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).
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/test_center/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module TestCenter
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::TestCenter.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
@@ -0,0 +1,122 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
SUPPRESS_TESTS_CUSTOM_VALUE = :SUPPRESS_TESTS_CUSTOM_VALUE
|
5
|
+
end
|
6
|
+
|
7
|
+
class SuppressTestsAction < Action
|
8
|
+
require 'xcodeproj'
|
9
|
+
|
10
|
+
def self.run(params)
|
11
|
+
project_path = params[:xcodeproj]
|
12
|
+
tests_to_skip = params[:tests]
|
13
|
+
scheme = params[:scheme]
|
14
|
+
|
15
|
+
scheme_filepaths = Dir.glob("#{project_path}/{xcshareddata,xcuserdata}/**/xcschemes/#{scheme || '*'}.xcscheme")
|
16
|
+
if scheme_filepaths.length.zero?
|
17
|
+
UI.user_error!("Error: cannot find any scheme named #{scheme}") unless scheme.nil?
|
18
|
+
UI.user_error!("Error: cannot find any schemes in the Xcode project")
|
19
|
+
end
|
20
|
+
|
21
|
+
scheme_filepaths.each do |scheme_filepath|
|
22
|
+
is_dirty = false
|
23
|
+
xcscheme = Xcodeproj::XCScheme.new(scheme_filepath)
|
24
|
+
xcscheme.test_action.testables.each do |testable|
|
25
|
+
tests_to_skip.each do |test_to_skip|
|
26
|
+
skipped_test = Xcodeproj::XCScheme::TestAction::TestableReference::SkippedTest.new
|
27
|
+
skipped_test.identifier = test_to_skip
|
28
|
+
testable.add_skipped_test(skipped_test)
|
29
|
+
is_dirty = true
|
30
|
+
end
|
31
|
+
end
|
32
|
+
xcscheme.save! if is_dirty
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
#####################################################
|
37
|
+
# @!group Documentation
|
38
|
+
#####################################################
|
39
|
+
|
40
|
+
def self.description
|
41
|
+
"A short description with <= 80 characters of what this action does"
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.details
|
45
|
+
# Optional:
|
46
|
+
# this is your chance to provide a more detailed description of this action
|
47
|
+
"You can use this action to do cool things..."
|
48
|
+
end
|
49
|
+
|
50
|
+
def self.available_options
|
51
|
+
# Define all options your action supports.
|
52
|
+
|
53
|
+
# Below a few examples
|
54
|
+
[
|
55
|
+
FastlaneCore::ConfigItem.new(
|
56
|
+
key: :xcodeproj,
|
57
|
+
env_name: "FL_SUPPRESS_TESTS_XCODE_PROJECT", # The name of the environment variable
|
58
|
+
description: "The file path to the Xcode project file to modify", # a short description of this parameter
|
59
|
+
verify_block: proc do |path|
|
60
|
+
UI.user_error!("Error: Xcode project file path not given!") unless path and !path.empty?
|
61
|
+
UI.user_error!("Error: Xcode project '#{path}' not found!") unless Dir.exist?(path)
|
62
|
+
end
|
63
|
+
),
|
64
|
+
FastlaneCore::ConfigItem.new(
|
65
|
+
key: :tests,
|
66
|
+
env_name: "FL_SUPPRESS_TESTS_TESTS_TO_SUPPRESS", # The name of the environment variable
|
67
|
+
description: "A list of tests to suppress", # a short description of this parameter
|
68
|
+
verify_block: proc do |tests|
|
69
|
+
UI.user_error!("Error: no tests were given to suppress!") unless tests and !tests.empty?
|
70
|
+
tests.each do |test_identifier|
|
71
|
+
is_valid_test_identifier = %r{^[a-zA-Z][a-zA-Z0-9]+(\/test[a-zA-Z0-9]+)?$} =~ test_identifier
|
72
|
+
unless is_valid_test_identifier
|
73
|
+
UI.user_error!("Error: invalid test identifier '#{test_identifier}'. It must be in the format of 'TestSuiteToSuppress' or 'TestSuiteToSuppress/testToSuppress'")
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end,
|
77
|
+
type: Array
|
78
|
+
),
|
79
|
+
FastlaneCore::ConfigItem.new(
|
80
|
+
key: :scheme,
|
81
|
+
optional: true,
|
82
|
+
env_name: "FL_SUPPRESS_TESTS_SCHEME_TO_UPDATE", # The name of the environment variable
|
83
|
+
description: "The Xcode scheme where the tests should be suppressed", # a short description of this parameter
|
84
|
+
verify_block: proc do |scheme_name|
|
85
|
+
UI.user_error!("Error: Xcode Scheme '#{scheme_name}' is not valid!") if scheme_name and scheme_name.empty?
|
86
|
+
end
|
87
|
+
)
|
88
|
+
]
|
89
|
+
end
|
90
|
+
|
91
|
+
def self.output
|
92
|
+
# Define the shared values you are going to provide
|
93
|
+
# Example
|
94
|
+
[
|
95
|
+
['SUPPRESS_TESTS_CUSTOM_VALUE', 'A description of what this value contains']
|
96
|
+
]
|
97
|
+
end
|
98
|
+
|
99
|
+
def self.return_value
|
100
|
+
# If your method provides a return value, you can describe here what it does
|
101
|
+
end
|
102
|
+
|
103
|
+
def self.authors
|
104
|
+
# So no one will ever forget your contribution to fastlane :) You are awesome btw!
|
105
|
+
["Your GitHub/Twitter Name"]
|
106
|
+
end
|
107
|
+
|
108
|
+
def self.is_supported?(platform)
|
109
|
+
# you can do things like
|
110
|
+
#
|
111
|
+
# true
|
112
|
+
#
|
113
|
+
# platform == :ios
|
114
|
+
#
|
115
|
+
# [:ios, :mac].include?(platform)
|
116
|
+
#
|
117
|
+
|
118
|
+
platform == :ios
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class TestCenterAction < Action
|
4
|
+
def self.run(params)
|
5
|
+
UI.message("The test_center plugin is working!")
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.description
|
9
|
+
"Makes testing your iOS app easier"
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.authors
|
13
|
+
["Lyndsey Ferguson"]
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.return_value
|
17
|
+
# If your method provides a return value, you can describe here what it does
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.details
|
21
|
+
# Optional:
|
22
|
+
"Makes testing your iOS app easier by providing a list of possible tests, changing what tests are suppressed or not, re-running fragile tests, etc."
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.available_options
|
26
|
+
[
|
27
|
+
# FastlaneCore::ConfigItem.new(key: :your_option,
|
28
|
+
# env_name: "TEST_CENTER_YOUR_OPTION",
|
29
|
+
# description: "A description of your option",
|
30
|
+
# optional: false,
|
31
|
+
# type: String)
|
32
|
+
]
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.is_supported?(platform)
|
36
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
37
|
+
# See: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
|
38
|
+
#
|
39
|
+
# [:ios, :mac, :android].include?(platform)
|
40
|
+
true
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Helper
|
3
|
+
class TestCenterHelper
|
4
|
+
# class methods that you define here become available in your action
|
5
|
+
# as `Helper::TestCenterHelper.your_method`
|
6
|
+
#
|
7
|
+
def self.show_message
|
8
|
+
UI.message("Hello from the test_center plugin helper!")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,162 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-test_center
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Lyndsey Ferguson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-10-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: fastlane
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.56.0
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.56.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry-byebug
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: simplecov
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description:
|
126
|
+
email: lyndsey.ferguson@appian.com
|
127
|
+
executables: []
|
128
|
+
extensions: []
|
129
|
+
extra_rdoc_files: []
|
130
|
+
files:
|
131
|
+
- LICENSE
|
132
|
+
- README.md
|
133
|
+
- lib/fastlane/plugin/test_center.rb
|
134
|
+
- lib/fastlane/plugin/test_center/actions/suppress_tests.rb
|
135
|
+
- lib/fastlane/plugin/test_center/actions/test_center_action.rb
|
136
|
+
- lib/fastlane/plugin/test_center/helper/test_center_helper.rb
|
137
|
+
- lib/fastlane/plugin/test_center/version.rb
|
138
|
+
homepage:
|
139
|
+
licenses:
|
140
|
+
- MIT
|
141
|
+
metadata: {}
|
142
|
+
post_install_message:
|
143
|
+
rdoc_options: []
|
144
|
+
require_paths:
|
145
|
+
- lib
|
146
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - ">="
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
151
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
|
+
requirements:
|
153
|
+
- - ">="
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: '0'
|
156
|
+
requirements: []
|
157
|
+
rubyforge_project:
|
158
|
+
rubygems_version: 2.6.11
|
159
|
+
signing_key:
|
160
|
+
specification_version: 4
|
161
|
+
summary: Makes testing your iOS app easier
|
162
|
+
test_files: []
|