results_keeper 0.1.1 → 0.2.0

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/results_keeper.rb +11 -8
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f9cba0cb43303df14050652717b1646a5f5e4c0
4
- data.tar.gz: 2b888ee657372a056e93e1eb8220491ba4d128ce
3
+ metadata.gz: eb4cf39674ea7612498d4dbda377da0959fa1b14
4
+ data.tar.gz: a5664c58b6f4f159537187531f042324a3bc343d
5
5
  SHA512:
6
- metadata.gz: ef1f6c4cf745b5996bd87c96256f353754e679da4a35f2eb2139160b9350bc3fcedfed86d3a2c5877cb7cf210295971b63782e5b1da6ed30489b1c4455fbf761
7
- data.tar.gz: 62a26d7e8a5ca962abc842556c868ae07a044479313c6f0ec92c6453c0724567aef6218518a801a98b1514dd2a0b229613f63d9f59c41066e7fb591f2a43da5a
6
+ metadata.gz: a336ef86192ec2aade0989cb2ac4cf932a2488bbd9a737eb8ead91c379d323264f2a77c6cbbe20354187c7191e4120663dff8b8556befd1877c7b41aafc62ded
7
+ data.tar.gz: 119823bf5d6ecfc2637e388209f70f1a7b21acad2210226ec769b5d44eadee3e3a910c7aa7550910c4756002f21b34c3a6f15e046d7f90cb52fb9bb846645506
@@ -10,7 +10,7 @@ class ResultsKeeper
10
10
  attr_reader :revision_name, :revision_project
11
11
 
12
12
  DEFAULT_PORT = 80
13
- DEFAULT_HOST = 'results-keeper.herokuapp.com'
13
+ DEFAULT_HOST = 'results-keeper-api.herokuapp.com'
14
14
 
15
15
  def initialize
16
16
  @revision_name = ENV['REVISION_NAME'] || "Result for #{Time.now}"
@@ -27,7 +27,12 @@ class ResultsKeeper
27
27
  send_json(data, 'revisions')
28
28
  end
29
29
 
30
+ def test_started(scenarion)
31
+ @test_started_at = Time.now
32
+ end
33
+
30
34
  def send_test(scenario)
35
+ test_duration = Time.now - @test_started_at
31
36
  @screenshot_path = save_screenshot(scenario) if ENV['SEND_SCREENSHOTS']
32
37
  scenario_steps = scenario.test_steps.map(&:name) unless ENV['NO_STEPS']
33
38
  scenario_error = scenario.exception.message if scenario.exception
@@ -38,6 +43,7 @@ class ResultsKeeper
38
43
  run_path: run_path,
39
44
  error: scenario_error,
40
45
  revision_id: @revision['revision_id'],
46
+ duration: test_duration,
41
47
  steps: scenario_steps
42
48
  }
43
49
  @test = send_json(data, 'tests')
@@ -71,13 +77,10 @@ class ResultsKeeper
71
77
 
72
78
  def send_screenshot(screenshot_path)
73
79
  if ENV['SEND_SCREENSHOTS']
74
- t1 = Thread.new do
75
- params = { project: @revision['project_id'], revision: @revision['revision_id'], test: @test['id'] }
76
- RestClient.post("http://#{@host}:#{@port}/api/tests/upload_screenshot",
77
- :name_of_file_param => File.new(screenshot_path), :body => params)
78
- File.delete(screenshot_path)
79
- end
80
- t1.join
80
+ params = { project: @revision['project_id'], revision: @revision['revision_id'], test: @test['id'] }
81
+ RestClient.post("http://#{@host}:#{@port}/api/tests/upload_screenshot",
82
+ :name_of_file_param => File.new(screenshot_path), :body => params)
83
+ File.delete(screenshot_path)
81
84
  end
82
85
  end
83
86
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: results_keeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.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-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: flickraw