xamarin-test-cloud 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xamarin-test-cloud/cli.rb +77 -1
- data/lib/xamarin-test-cloud/cli.rb alias +0 -0
- data/lib/xamarin-test-cloud/version.rb +1 -1
- metadata +14 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f60e55bbba9205215510389613c5c60672d9983
|
4
|
+
data.tar.gz: 237e950267809c66173d8d388593a5b598865c63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5696ca55bd8e3c6fde7043b000ffc8dd97d4bab99aa7f5a5e2aa4a7f8bdb52bbd7a64e31a7ea0443aaebb59bb1f8a6938e2a2901fc6c0ce680a647ee4b67390
|
7
|
+
data.tar.gz: a93037446d255ead1f82a3397fcf6cc879091d28cec34378ef03c3e95776478218e3b5053a6719d331142fd528c843e3ef2245e1e661069c6e6a7b726e136aa2
|
@@ -20,6 +20,7 @@ require "xamarin-test-cloud/calabash_version_detector"
|
|
20
20
|
require 'securerandom'
|
21
21
|
require 'open3'
|
22
22
|
require "bundler"
|
23
|
+
require 'pathname'
|
23
24
|
|
24
25
|
trap "SIGINT" do
|
25
26
|
puts "Exiting"
|
@@ -37,8 +38,11 @@ module XamarinTestCloud
|
|
37
38
|
attr_accessor :app, :api_key, :appname, :test_parameters, :user,
|
38
39
|
:config, :profile, :skip_config_check, :dry_run,
|
39
40
|
:device_selection, :pretty, :async, :async_json, :priority, :endpoint_path,
|
41
|
+
:include_files_input,
|
40
42
|
:locale, :series, :session_id
|
41
43
|
|
44
|
+
attr_writer :included_files_map
|
45
|
+
|
42
46
|
def self.exit_on_failure?
|
43
47
|
true
|
44
48
|
end
|
@@ -130,6 +134,16 @@ module XamarinTestCloud
|
|
130
134
|
:type => :boolean,
|
131
135
|
:default => false
|
132
136
|
|
137
|
+
|
138
|
+
#A list of items which are files or folders in the workspace.
|
139
|
+
# Must be a path relative to workspace and
|
140
|
+
# must not refer outside (e.g. no usage of ../ etc). Example --include .xtc foo
|
141
|
+
method_option 'include',
|
142
|
+
:desc => 'Include folders or files in workspace in addition the features folder.',
|
143
|
+
:aliases => '-i',
|
144
|
+
:type => :array,
|
145
|
+
:default => []
|
146
|
+
|
133
147
|
method_option 'dry-run',
|
134
148
|
:desc => "Sanity check only, don't upload",
|
135
149
|
:aliases => '-s',
|
@@ -218,6 +232,8 @@ module XamarinTestCloud
|
|
218
232
|
|
219
233
|
self.skip_config_check = options['skip-config-check']
|
220
234
|
|
235
|
+
self.include_files_input = options['include']
|
236
|
+
|
221
237
|
# Resolves the workspace and sets the @derived_workspace variable.
|
222
238
|
expect_features_directory_in_workspace
|
223
239
|
|
@@ -243,6 +259,8 @@ module XamarinTestCloud
|
|
243
259
|
end
|
244
260
|
end
|
245
261
|
|
262
|
+
self.included_files_map = parse_included_folders
|
263
|
+
|
246
264
|
if Environment.debug?
|
247
265
|
puts "Host = #{self.host}"
|
248
266
|
puts "User = #{self.user}"
|
@@ -255,6 +273,7 @@ module XamarinTestCloud
|
|
255
273
|
puts "Config = #{self.config}"
|
256
274
|
puts "Profile = #{self.profile}"
|
257
275
|
puts "dSym = #{self.dsym}"
|
276
|
+
puts "Include = #{self.included_files_map}" if self.included_files_map
|
258
277
|
end
|
259
278
|
|
260
279
|
|
@@ -761,7 +780,8 @@ and try submitting again.
|
|
761
780
|
def collect_test_suite_files(tmpdir)
|
762
781
|
files = collect_files_from_features +
|
763
782
|
collect_files_from_tmpdir(tmpdir) +
|
764
|
-
collect_gemfile_files(tmpdir)
|
783
|
+
collect_gemfile_files(tmpdir) +
|
784
|
+
collect_included_files(tmpdir)
|
765
785
|
|
766
786
|
if config
|
767
787
|
files << config
|
@@ -806,6 +826,17 @@ and try submitting again.
|
|
806
826
|
end
|
807
827
|
end
|
808
828
|
|
829
|
+
def collect_included_files(tmpdir)
|
830
|
+
collected_files = []
|
831
|
+
self.included_files_map.each_pair do |src, dest|
|
832
|
+
FileUtils.cp_r(src, File.join(tmpdir,dest))
|
833
|
+
collect_files_with_glob(File.join(tmpdir,dest,"**","*")).map do |file|
|
834
|
+
collected_files << TestFile.new(file, tmpdir)
|
835
|
+
end
|
836
|
+
end
|
837
|
+
collected_files
|
838
|
+
end
|
839
|
+
|
809
840
|
# Returns a list of digests
|
810
841
|
# @param [Array<TestFile>] test_files A list of TestFile instances.
|
811
842
|
def collect_test_suite_file_digests(test_files)
|
@@ -1018,6 +1049,51 @@ and try submitting again.
|
|
1018
1049
|
self.config = TestFile.cucumber_config(config_path)
|
1019
1050
|
end
|
1020
1051
|
|
1052
|
+
def included_files_map
|
1053
|
+
@included_files_map ||= parse_included_folders
|
1054
|
+
end
|
1055
|
+
|
1056
|
+
def parse_included_folders
|
1057
|
+
return {} unless self.include_files_input
|
1058
|
+
basedir = derived_workspace
|
1059
|
+
parsed_included_folders = {}
|
1060
|
+
self.include_files_input.each do |folder|
|
1061
|
+
src = File.join(basedir, folder)
|
1062
|
+
validate_include_folder!(src, folder)
|
1063
|
+
parsed_included_folders[src]=folder
|
1064
|
+
end
|
1065
|
+
parsed_included_folders
|
1066
|
+
end
|
1067
|
+
|
1068
|
+
def validate_include_folder!(src, tgt)
|
1069
|
+
unless File.exists?(src)
|
1070
|
+
raise ValidationError, %Q[
|
1071
|
+
Requested include folder: #{src} does not exist.
|
1072
|
+
|
1073
|
+
Specified include options: #{self.include_files_input}
|
1074
|
+
]
|
1075
|
+
end
|
1076
|
+
tgt_pathname = Pathname.new(tgt)
|
1077
|
+
if tgt_pathname.absolute?
|
1078
|
+
raise ValidationError, %Q[
|
1079
|
+
Only relative target path names are allowed.
|
1080
|
+
|
1081
|
+
Requested target folder: #{tgt} is an absolute file name.
|
1082
|
+
|
1083
|
+
Specified include options: #{self.include_files_input}"
|
1084
|
+
]
|
1085
|
+
end
|
1086
|
+
if /\.\./.match(tgt)
|
1087
|
+
raise ValidationError, %Q[
|
1088
|
+
Only expanded relative target paths are allowed.
|
1089
|
+
|
1090
|
+
Requested target folder includes '..'.
|
1091
|
+
|
1092
|
+
Specified include options: #{self.include_files_input}"
|
1093
|
+
]
|
1094
|
+
end
|
1095
|
+
end
|
1096
|
+
|
1021
1097
|
def expect_features_directory_in_workspace
|
1022
1098
|
path = derived_workspace
|
1023
1099
|
features = File.join(path, "features")
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xamarin-test-cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karl Krukow
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-10-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -103,16 +103,22 @@ dependencies:
|
|
103
103
|
name: httpclient
|
104
104
|
requirement: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
|
-
- - "
|
106
|
+
- - ">="
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version:
|
108
|
+
version: 2.7.1
|
109
|
+
- - "<"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '3.0'
|
109
112
|
type: :runtime
|
110
113
|
prerelease: false
|
111
114
|
version_requirements: !ruby/object:Gem::Requirement
|
112
115
|
requirements:
|
113
|
-
- - "
|
116
|
+
- - ">="
|
114
117
|
- !ruby/object:Gem::Version
|
115
|
-
version:
|
118
|
+
version: 2.7.1
|
119
|
+
- - "<"
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '3.0'
|
116
122
|
- !ruby/object:Gem::Dependency
|
117
123
|
name: mime-types
|
118
124
|
requirement: !ruby/object:Gem::Requirement
|
@@ -316,6 +322,7 @@ files:
|
|
316
322
|
- bin/test-cloud
|
317
323
|
- lib/xamarin-test-cloud/calabash_version_detector.rb
|
318
324
|
- lib/xamarin-test-cloud/cli.rb
|
325
|
+
- lib/xamarin-test-cloud/cli.rb alias
|
319
326
|
- lib/xamarin-test-cloud/dsym.rb
|
320
327
|
- lib/xamarin-test-cloud/environment.rb
|
321
328
|
- lib/xamarin-test-cloud/http/payload.rb
|
@@ -344,9 +351,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
344
351
|
version: '0'
|
345
352
|
requirements: []
|
346
353
|
rubyforge_project:
|
347
|
-
rubygems_version: 2.6.
|
354
|
+
rubygems_version: 2.6.4
|
348
355
|
signing_key:
|
349
356
|
specification_version: 4
|
350
357
|
summary: Command-line interface to Xamarin Test Cloud
|
351
358
|
test_files: []
|
352
|
-
has_rdoc:
|