lopata 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 370a12b687f515d5d78b16a0e84e9fd285b8c872
4
- data.tar.gz: 2ff110d2f967be06d0befd0dcf9f7435d07b786d
3
+ metadata.gz: 7ca8ead5daae424902ad6e48a52b6c9ba8acd244
4
+ data.tar.gz: ed0b266df95b2c21b5e32fe130b3acb1c6339d01
5
5
  SHA512:
6
- metadata.gz: 9eeeaf75bb966c6314d03bba5d4d59d1ab4e1beb084e6993aa4d362829d1686f1f76cbeade4db0bb8bf4ef99978a5c231ab8a9ae4dfb61ff0c6ca55ce6a279f5
7
- data.tar.gz: cfc09fead12a3c9b9c91154ec565799cee480732759d819182feaa9a494734020107ff775289f1067f540c9224359e8fceebd3b2694e3238433f694c7985809a
6
+ metadata.gz: 40237a54412d4572bc2850b020d11029c5a27c89be97e8f22a74ab0908b40d2e8661476438bf9bfddf0aeeb00f827774002ff35537a86698e5f9b3709cf6dceb
7
+ data.tar.gz: aeae7c68c728d41205b8ae5c708cf93ad9fe55d590e4f6e7878ba27253f572e4075cd229ad7f36875b122beea60316187ad612630e9182cbd4d6b15029ef2131
@@ -2,7 +2,7 @@ module Lopata
2
2
  module Config
3
3
  extend self
4
4
 
5
- attr_accessor :build_number, :lopata_host, :only_roles, :role_descriptions, :after_as, :ops
5
+ attr_accessor :build_number, :lopata_host, :lopata_code, :only_roles, :role_descriptions, :after_as, :ops
6
6
 
7
7
  def init(env)
8
8
  require 'yaml'
@@ -14,7 +14,7 @@ module Lopata
14
14
 
15
15
  %w{url name readonly}.each do |opt|
16
16
  define_method opt do
17
- raise "RstConfig unititlalized, use RstConfig#init(env) to set environment" unless @config
17
+ raise "Lopata::Config unititlalized, use Lopata::Config#init(env) to set environment" unless @config
18
18
  @config[opt]
19
19
  end
20
20
  end
@@ -32,6 +32,14 @@ module Lopata
32
32
  end
33
33
  end
34
34
 
35
+ def init_lopata_logging(build)
36
+ Lopata::Config.build_number = build
37
+ RSpec.configure do |c|
38
+ require 'lopata/rspec/formatter' # class cross-loading, avoid auto-loading
39
+ c.add_formatter Lopata::RSpec::Formatter
40
+ end
41
+ end
42
+
35
43
  def before_start(&block)
36
44
  @before_start = block
37
45
  end
@@ -75,7 +75,7 @@ module Lopata
75
75
  end
76
76
 
77
77
  def start(count)
78
- @launch_id = JSON.parse(post("/builds/#{build_number}/launches.json", body: {total: count}).body)['id']
78
+ @launch_id = JSON.parse(post("/projects/#{project_code}/builds/#{build_number}/launches.json", body: {total: count}).body)['id']
79
79
  end
80
80
 
81
81
  def add_attempt(example, status, msg = nil, backtrace = nil)
@@ -89,7 +89,8 @@ module Lopata
89
89
 
90
90
  def test_id(example)
91
91
  request = {
92
- find_or_create: {
92
+ test: {
93
+ project_code: project_code,
93
94
  title: example.full_description,
94
95
  scenario: example.metadata[:example_group][:full_description],
95
96
  build_number: build_number
@@ -100,11 +101,11 @@ module Lopata
100
101
  end
101
102
 
102
103
  def to_rerun
103
- get_json("/builds/#{build_number}/suspects.json")
104
+ get_json("/projects/#{project_code}/builds/#{build_number}/suspects.json")
104
105
  end
105
106
 
106
107
  def to_full_rescan
107
- to_rerun + get_json("/builds/#{build_number}/failures.json")
108
+ to_rerun + get_json("/projects/#{project_code}/builds/#{build_number}/failures.json")
108
109
  end
109
110
 
110
111
  private
@@ -124,7 +125,7 @@ module Lopata
124
125
  def inc_finished
125
126
  @finished ||= 0
126
127
  @finished += 1
127
- response = patch("/builds/#{build_number}/launches/#{@launch_id}",
128
+ response = patch("/launches/#{@launch_id}",
128
129
  body: { finished: @finished }.to_json,
129
130
  headers: { 'Content-Type' => 'application/json', 'Accept' => 'application/json' })
130
131
  if response.code == 404
@@ -132,6 +133,10 @@ module Lopata
132
133
  exit!
133
134
  end
134
135
  end
136
+
137
+ def project_code
138
+ Lopata::Config.lopata_code
139
+ end
135
140
  end
136
141
  end
137
142
 
@@ -1,7 +1,7 @@
1
1
  module Lopata
2
2
  module RSpec
3
3
  module Version
4
- STRING = '0.0.5'
4
+ STRING = '0.0.6'
5
5
  end
6
6
  end
7
7
  end
@@ -25,6 +25,7 @@ module Lopata
25
25
  }
26
26
  Lopata::Config.init(options[:env])
27
27
  Lopata::Config.initialize_test
28
+ Lopata::Config.init_rspec
28
29
 
29
30
  ::RSpec::Core::Runner.run ['spec']
30
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lopata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Volochnev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-27 00:00:00.000000000 Z
11
+ date: 2016-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -85,5 +85,5 @@ rubyforge_project:
85
85
  rubygems_version: 2.2.5
86
86
  signing_key:
87
87
  specification_version: 4
88
- summary: lopata-0.0.5
88
+ summary: lopata-0.0.6
89
89
  test_files: []