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 +4 -4
- data/lib/lopata/config.rb +10 -2
- data/lib/lopata/rspec/formatter.rb +10 -5
- data/lib/lopata/rspec/version.rb +1 -1
- data/lib/lopata/runner.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ca8ead5daae424902ad6e48a52b6c9ba8acd244
|
4
|
+
data.tar.gz: ed0b266df95b2c21b5e32fe130b3acb1c6339d01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40237a54412d4572bc2850b020d11029c5a27c89be97e8f22a74ab0908b40d2e8661476438bf9bfddf0aeeb00f827774002ff35537a86698e5f9b3709cf6dceb
|
7
|
+
data.tar.gz: aeae7c68c728d41205b8ae5c708cf93ad9fe55d590e4f6e7878ba27253f572e4075cd229ad7f36875b122beea60316187ad612630e9182cbd4d6b15029ef2131
|
data/lib/lopata/config.rb
CHANGED
@@ -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 "
|
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
|
-
|
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("/
|
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
|
|
data/lib/lopata/rspec/version.rb
CHANGED
data/lib/lopata/runner.rb
CHANGED
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.
|
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-
|
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.
|
88
|
+
summary: lopata-0.0.6
|
89
89
|
test_files: []
|