atm_formatter 0.1.34 → 0.1.35

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 449df3366c2e3daa644b6f10aebcbe2825276184
4
- data.tar.gz: 47275194cc0e4af14c58bb60170a0bbe48a73ed2
3
+ metadata.gz: 62a6c68dddcb2104820e891a92a4e244b3d7d810
4
+ data.tar.gz: b31b9ceafc3c71d15f43397d1545db73cfe9a04b
5
5
  SHA512:
6
- metadata.gz: 87f6a15bd0c43e17797c1eb16737a16a8e40610ed3576eb68e63034a49a293757e6c3604375a4e8aeeafe40a8e1f5cfa2e6b1d3f167147dad176958e0885e9fd
7
- data.tar.gz: 7bab7caf74c9f72581f8aedccb837f482ea160c74a9c7050a5e315d21385d2137962a78aea29aa4bd0dbe8414631a02cf8f26900657a21174e62b0a3497d30f9
6
+ metadata.gz: a9cf1f121d9bfbca724948d35d87641b8b070acc53ae782d46a67b68dbe30905b9be2060f723b17c31d408c0d508a1a47da30063cb9ed2b8a7c533ac85fc784a
7
+ data.tar.gz: c02b67ef8d3068e65843940509ec89157d7e214a7b8d1c5ec0a0ce8fc21aedc964bff032a3b6fc49a9485c4db6939fb449e7dcc20c4772d1ea66f73d5eb8ec42
@@ -14,44 +14,44 @@ module ATM
14
14
  def install
15
15
  namespace 'atm' do
16
16
  desc 'Create test cases with steps on Adaptavist Test Management'
17
- task :create_with_steps, [:path] do |_t, args|
18
- exec("bundle exec rspec #{args[:path] if args[:path]} --format ATMCreateTestFormatter --dry-run -r atm_formatter/example")
17
+ task :create_with_steps, [:path] do |_t, options|
18
+ exec("bundle exec rspec #{options[:path] if options[:path]} --format ATMCreateTestFormatter --dry-run -r atm_formatter/example")
19
19
  end
20
20
 
21
21
  desc 'Create test cases on Adaptavist Test Management'
22
- task :create, [:path] do |_t, args|
23
- exec("bundle exec rspec #{args[:path] if args[:path]} --format ATMCreateTestFormatter --dry-run")
22
+ task :create, [:path] do |_t, options|
23
+ exec("bundle exec rspec #{options[:path] if options[:path]} --format ATMCreateTestFormatter --dry-run")
24
24
  end
25
25
 
26
26
  desc 'Update test cases with steps on Adaptavist Test Management'
27
- task :update_with_steps, [:path] do |_t, args|
28
- exec("bundle exec rspec #{args[:path] if args[:path]} --format ATMUpdateTestFormatter --dry-run -r atm_formatter/example")
27
+ task :update_with_steps, [:path] do |_t, options|
28
+ exec("bundle exec rspec #{options[:path] if options[:path]} --format ATMUpdateTestFormatter --dry-run -r atm_formatter/example")
29
29
  end
30
30
 
31
31
  desc 'Update test cases on Adaptavist Test Management'
32
- task :update, [:path] do |_t, args|
33
- exec("bundle exec rspec #{args[:path] if args[:path]} --format ATMUpdateTestFormatter --dry-run")
32
+ task :update, [:path] do |_t, options|
33
+ exec("bundle exec rspec #{options[:path] if options[:path]} --format ATMUpdateTestFormatter --dry-run")
34
34
  end
35
35
 
36
36
  desc 'Upload saved test results'
37
- task :upload, %i[url username password file_path] do |_t, args|
38
- client = ATM::Client.new(base_url: args[:url], username: args[:username], password: args[:password], auth_type: :basic)
39
- files = args[:file_path] ? Dir.glob(args[:file_path]) : Dir.glob('test_results/*.json')
37
+ task :upload, %i[url username password file_path] do |_t, options|
38
+ client = ATM::Client.new(base_url: options[:url], username: options[:username], password: options[:password], auth_type: :basic)
39
+ files = options[:file_path] ? Dir.glob(options[:file_path]) : Dir.glob('test_results/*.json')
40
40
 
41
- files.each do |my_text_file|
42
- puts "working on: #{my_text_file}..."
43
- File.open(my_text_file, 'r') do |_test_case_data|
44
- file_data = JSON.parse(File.read(my_text_file))
41
+ files.each do |json_file|
42
+ puts "working on: #{json_file}..."
43
+ File.open(json_file, 'r') do |_test_case_data|
44
+ file_data = JSON.parse(File.read(json_file))
45
45
  progressbar = ProgressBar.create(total: file_data['test_cases'].size, format: 'Progress %c/%C |%B| %a')
46
- file_data['test_cases'].each do |test_case|
47
- test_run_id = test_case.delete('test_run_id')
48
- test_case_id = test_case.delete('test_case') if test_run_id
46
+ file_data['test_cases'].each do |test_data|
47
+ test_run_id = test_data.delete('test_run_id')
49
48
 
50
49
  if test_run_id
51
- client.TestRun.create_new_test_run_result(test_run_id, test_case_id, test_case)
50
+ test_case_id = test_data.delete('test_case_id')
51
+ client.TestRun.create_new_test_run_result(test_run_id, test_case_id, test_data)
52
52
  progressbar.increment
53
53
  else
54
- warn('Have to run against test run')
54
+ warn("TEST RUN ID for test_case_id: '#{test_case_id}' was not specified.")
55
55
  end
56
56
  end
57
57
  end
@@ -1,3 +1,3 @@
1
1
  module ATMFormatter
2
- VERSION = '0.1.34'.freeze
2
+ VERSION = '0.1.35'.freeze
3
3
  end
@@ -29,11 +29,14 @@ class ATMResultFormatter < RSpec::Core::Formatters::BaseFormatter
29
29
  file_path = "#{file_name}_#{@time_stamp}"
30
30
  @test_results[file_path.to_sym] = { test_cases: [] }
31
31
  test_data = @client.TestRun.process_result(process_metadata(example))
32
- @test_data << if ATMFormatter.config.test_run_id
33
- test_data.merge!(test_run_id: ATMFormatter.config.test_run_id, test_case: example.metadata[:test_id], file_path: file_path)
34
- else
35
- test_data.merge!(test_case: example.metadata[:test_id], file_path: file_path)
36
- end
32
+ @test_data << if ATMFormatter.config.test_run_id
33
+ test_data.merge!(test_run_id: ATMFormatter.config.test_run_id,
34
+ test_case_id: example.metadata[:test_id],
35
+ file_path: file_path)
36
+ else
37
+ test_data.merge!(test_case_id: example.metadata[:test_id],
38
+ file_path: file_path)
39
+ end
37
40
  end
38
41
 
39
42
  @test_results.each do |k, _v|
@@ -82,7 +85,7 @@ class ATMResultFormatter < RSpec::Core::Formatters::BaseFormatter
82
85
 
83
86
  def process_metadata(example)
84
87
  {
85
- test_case: test_id(example),
88
+ test_case_id: test_id(example),
86
89
  status: status(example.metadata[:execution_result]),
87
90
  environment: fetch_environment(example),
88
91
  comment: comment(example.metadata),
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atm_formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.34
4
+ version: 0.1.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - azohra
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-09 00:00:00.000000000 Z
11
+ date: 2017-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: atm_ruby