actir 1.4.1 → 1.4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/actir/parallel_tests/cli.rb +55 -55
- data/lib/actir/script/cookies_file.rb +25 -0
- data/lib/actir/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae54b7de1a72de6f6257261eec1cf8506636fa5c
|
4
|
+
data.tar.gz: 97e0942beca3d46c156ab9d374b5385bfc0ee728
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98811afbebabb6778a644cc436b25d67b5423945b165844623dab8c86779fd3b91f7910078768197d8a3bc1e57152608fb02f6711751be77d33c765f362b05a4
|
7
|
+
data.tar.gz: 3936f3bff3d132c170c7d41b1730442a5fafaea196db640ea0937eaa23f130d51bb8afa2ea0b47cd8b42f5962bbe55bb5b261433fc41e33f93c92f9fcf435432
|
@@ -35,16 +35,16 @@ module Actir
|
|
35
35
|
test_results = nil
|
36
36
|
|
37
37
|
#修改全局变量$env至对应的预发布环境的名字
|
38
|
-
if options[:pre_name]
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
else
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
end
|
38
|
+
# if options[:pre_name]
|
39
|
+
# # 不等于当前的预发环境
|
40
|
+
# if options[:pre_name] != $env
|
41
|
+
# $env = options[:pre_name]
|
42
|
+
# end
|
43
|
+
# else
|
44
|
+
# if options[:pre_name] != $env
|
45
|
+
# $env = "online"
|
46
|
+
# end
|
47
|
+
# end
|
48
48
|
|
49
49
|
report_time_taken do
|
50
50
|
groups = @runner.tests_in_groups(options[:files], num_processes, options)
|
@@ -180,65 +180,65 @@ module Actir
|
|
180
180
|
OptionParser.new do |opts|
|
181
181
|
opts.banner = <<-BANNER.gsub(/^ /, '')
|
182
182
|
Run all tests in parallel
|
183
|
-
Usage:
|
183
|
+
Usage: actir [switches] [--] [files & folders] [-] [testcase_name]
|
184
184
|
Options are:
|
185
185
|
BANNER
|
186
|
-
# opts.on("-n [PROCESSES]", Integer, "How many processes to use, default: 1") { |n| options[:count] = n }
|
187
186
|
opts.on("-n [TESTCASE]", String, "Run this testcase") { |casename| options[:testcase] = casename }
|
188
|
-
opts.on("
|
189
|
-
group
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
187
|
+
opts.on("-p [PROCESSES]", Integer, "How many processes to use, default: 1") { |p| options[:count] = p }
|
188
|
+
# opts.on("--group-by [TYPE]", <<-TEXT.gsub(/^ /, '')
|
189
|
+
# group tests by:
|
190
|
+
# found - order of finding files
|
191
|
+
# filesize - by size of the file
|
192
|
+
# default - filesize
|
193
|
+
# TEXT
|
194
|
+
# ) { |type| options[:group_by] = type.to_sym }
|
195
195
|
opts.on("-r [TIMES]", "--rerun [TIMES]", Integer, "rerun times for failure&error testcase, default: 0") { |n| options[:rerun] = n }
|
196
196
|
#opts.on("-m [FLOAT]", "--multiply-processes [FLOAT]", Float, "use given number as a multiplier of processes to run") { |multiply| options[:multiply] = multiply }
|
197
|
-
opts.on("-i", "--isolate",
|
198
|
-
|
199
|
-
|
200
|
-
end
|
197
|
+
# opts.on("-i", "--isolate",
|
198
|
+
# "Do not run any other tests in the group used by --single(-s)") do |pattern|
|
199
|
+
# options[:isolate] = true
|
200
|
+
# end
|
201
201
|
opts.on("-e", "--exec [COMMAND]", "execute this code parallel") { |path| options[:execute] = path }
|
202
|
-
opts.on("--serialize-stdout", "Serialize stdout output, nothing will be written until everything is done") { options[:serialize_stdout] = true }
|
203
|
-
opts.on("--combine-stderr", "Combine stderr into stdout, useful in conjunction with --serialize-stdout") { options[:combine_stderr] = true }
|
204
|
-
opts.on("--non-parallel", "execute same commands but do not in parallel, needs --exec") { options[:non_parallel] = true }
|
205
|
-
opts.on("--nice", "execute test commands with low priority") { options[:nice] = true }
|
202
|
+
# opts.on("--serialize-stdout", "Serialize stdout output, nothing will be written until everything is done") { options[:serialize_stdout] = true }
|
203
|
+
# opts.on("--combine-stderr", "Combine stderr into stdout, useful in conjunction with --serialize-stdout") { options[:combine_stderr] = true }
|
204
|
+
# opts.on("--non-parallel", "execute same commands but do not in parallel, needs --exec") { options[:non_parallel] = true }
|
205
|
+
# opts.on("--nice", "execute test commands with low priority") { options[:nice] = true }
|
206
206
|
opts.on("--verbose", "Print more output") { options[:verbose] = true }
|
207
207
|
opts.on("--log", "record exec result to logfile") { options[:log] = true}
|
208
208
|
opts.on("--report", "make a report to show the test result") { options[:report] = true}
|
209
|
-
opts.on("--remote", "run testcase in remote environment") { options[:mode] = :remote }
|
210
|
-
opts.on("--local", "run testcase in local environment") { options[:mode] = :local }
|
211
|
-
# 填写预发环境,目前只支持bjpre2-4,别的后续再添加
|
212
|
-
opts.on("-p", "--pre [PRE]", <<-TEXT.gsub(/^ /, '')
|
213
|
-
set pre environment to run testcase:
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
209
|
+
# opts.on("--remote", "run testcase in remote environment") { options[:mode] = :remote }
|
210
|
+
# opts.on("--local", "run testcase in local environment") { options[:mode] = :local }
|
211
|
+
# # 填写预发环境,目前只支持bjpre2-4,别的后续再添加
|
212
|
+
# opts.on("-p", "--pre [PRE]", <<-TEXT.gsub(/^ /, '')
|
213
|
+
# set pre environment to run testcase:
|
214
|
+
# bjpre2
|
215
|
+
# bjpre3
|
216
|
+
# bjpre4
|
217
|
+
# TEXT
|
218
|
+
# ) { |pre| pre = "online" if ( pre != "bjpre2" && pre != "bjpre3" && pre != "bjpre4"); options[:pre_name] = pre }
|
219
219
|
#add by Hub
|
220
220
|
#-u commnd, update baifubao's cookies
|
221
221
|
opts.on("-u", "--update", "Update Baifubao's cookies") { options[:update] = true }
|
222
222
|
#add by Hub
|
223
223
|
#-s commnd, show test mode,and remote env ipaddress
|
224
|
-
opts.on("-s", "--show [PATH]", "Show Test Mode") do |path|
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
end
|
224
|
+
# opts.on("-s", "--show [PATH]", "Show Test Mode") do |path|
|
225
|
+
# abort "Please input project directory path!" if path == nil
|
226
|
+
# $project_path = File.join(Dir.pwd, path)
|
227
|
+
# puts division_str
|
228
|
+
# if Actir::Config.get("config.test_mode.env") == :local
|
229
|
+
# puts "mode : Local"
|
230
|
+
# else
|
231
|
+
# puts "mode : Remote"
|
232
|
+
# node_name = Actir::Config.get("config.test_mode.docker.name")
|
233
|
+
# address = Actir::Remote.get_remote_address
|
234
|
+
# puts "node_num : " + address.size.to_s
|
235
|
+
# address.each_with_index do |address, i|
|
236
|
+
# puts $env + node_name + (i+1).to_s + " : " + address
|
237
|
+
# end
|
238
|
+
# end
|
239
|
+
# puts division_str
|
240
|
+
# exit
|
241
|
+
# end
|
242
242
|
opts.on("-h", "--help", "Show this.") { puts opts; exit }
|
243
243
|
end.parse!(argv)
|
244
244
|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Actir
|
2
|
+
class CookiesFile
|
3
|
+
class << self
|
4
|
+
|
5
|
+
# 获取cookies文件的路径
|
6
|
+
# 因为涉及到权限问题,路径需要放在个人账号目录下
|
7
|
+
# 通过whoami命令获取当前账户名称
|
8
|
+
# 暂时存放在/User/xx/目录下
|
9
|
+
def path
|
10
|
+
user_name = `whoami`
|
11
|
+
return "/Users/" + user_name + "/"
|
12
|
+
end
|
13
|
+
|
14
|
+
def name
|
15
|
+
return "cookies.yaml"
|
16
|
+
end
|
17
|
+
|
18
|
+
def exists?
|
19
|
+
File::exists?(path + name)
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
data/lib/actir/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actir
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.1
|
4
|
+
version: 1.4.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hub
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-unit
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- lib/actir/remote.rb
|
146
146
|
- lib/actir/script/cookies/cookies.yaml
|
147
147
|
- lib/actir/script/cookies_baidu.rb
|
148
|
+
- lib/actir/script/cookies_file.rb
|
148
149
|
- lib/actir/version.rb
|
149
150
|
- lib/actir/webdriver/browser.rb
|
150
151
|
- lib/actir/webdriver/browser_options.rb
|