results_keeper_rspec 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/results_keeper_rspec.rb +6 -5
  3. metadata +8 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5860ce352ce9a87317b8bbeadb08396c02fb3dc9
4
- data.tar.gz: e584da173faf1d1ab3f631177c0fb6ea8f78e5a9
3
+ metadata.gz: 4b2013033048ff95c8e4fcab9c5a5024342d3c3d
4
+ data.tar.gz: a33904ff0636b364139ca2a7e084cee0ad03c30c
5
5
  SHA512:
6
- metadata.gz: ee9ddcafe3d4823699043a6dc3664f893b257cf38b3a0c209905260ec8038877da6f77cc8e9c7210719689af2f47849ec40eeea491c7a2db1a19774f6a1ada98
7
- data.tar.gz: 2f436010241e21c804aa492661e5aa8002abf3279d41a5cbd87fe21f96521cfac452d507770488b36105ae0c78a1399cf6c1a3a469004429df6164224fbfc9e9
6
+ metadata.gz: 021939909037c75687d96f1ceb9d3b9e9e0b82681d89f63370b747cbd0aa017338aa7ec0d7ad2c50f30580cfce6fee877727a77f2da8ffca19c854af3c5a486c
7
+ data.tar.gz: 69cdf1a84f5fece3e71d99c78067b66d5a3b6022bc7ecf65a2c65363bba33573a4e83037d545efbe67560b2c626dfaf9fb12f2643ab54ff242271fc84030a314
@@ -28,7 +28,8 @@ class ResultsKeeperRspec
28
28
  end
29
29
 
30
30
  def send_test(scenario)
31
- @screenshot_path = save_screenshot(scenario) if ENV['SEND_SCREENSHOTS']
31
+ test_duration = Time.now - scenario.metadata[:execution_result].started_at
32
+ @screenshot_path = save_screenshot(scenario) if ENV['SEND_SCREENSHOT']
32
33
  status = scenario.exception ? 'failed' : 'passed'
33
34
  scenario_error = scenario.exception.message if scenario.exception
34
35
  run_path = "rspec #{scenario.location}"
@@ -38,7 +39,8 @@ class ResultsKeeperRspec
38
39
  feature_name: scenario.example_group.description,
39
40
  run_path: run_path,
40
41
  error: scenario_error,
41
- revision_id: @revision['revision_id']
42
+ revision_id: @revision['revision_id'],
43
+ duration: test_duration
42
44
  }
43
45
  @test = send_json(data, 'tests')
44
46
  send_screenshot(@screenshot_path) if @screenshot_path
@@ -70,14 +72,14 @@ class ResultsKeeperRspec
70
72
  end
71
73
 
72
74
  def send_screenshot(screenshot_path)
73
- if ENV['SEND_SCREENSHOTS']
75
+ if ENV['SEND_SCREENSHOT']
74
76
  t1 = Thread.new do
75
77
  params = { project: @revision['project_id'], revision: @revision['revision_id'], test: @test['id'] }
76
78
  RestClient.post("http://#{@host}:#{@port}/api/tests/upload_screenshot",
77
79
  :name_of_file_param => File.new(screenshot_path), :body => params)
78
- File.delete(screenshot_path)
79
80
  end
80
81
  t1.join
82
+ File.delete(screenshot_path)
81
83
  end
82
84
  end
83
85
 
@@ -89,4 +91,3 @@ class ResultsKeeperRspec
89
91
  puts " RK: #{text}".blue
90
92
  end
91
93
  end
92
-
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: results_keeper_rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Kozakov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-16 00:00:00.000000000 Z
11
+ date: 2016-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: flickraw
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rest-client
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: Results Keeper is a application which can help you to track and manage
@@ -57,12 +57,12 @@ require_paths:
57
57
  - lib
58
58
  required_ruby_version: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - '>='
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  requirements: []