semaphore_test_boosters 1.1.0 → 1.2.0

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: de11355f9b3609986d8302b9bc0619371bd28ef2
4
- data.tar.gz: 142b0c79b6ff473d3743df0da109287f200778b5
3
+ metadata.gz: ecef37c40d654424df9f099343e0c2533049369d
4
+ data.tar.gz: bb39ced89d7afdc98ba669a645ea34f16a2bbbff
5
5
  SHA512:
6
- metadata.gz: bf7b88817b12d5716046646cd1fd2c6f613deba3b27ac1a8c228d050724a91dae8bb13d3b2c8620bf892a36d36bc75291e307b6efe9c4cae5f7e0ee68f43e063
7
- data.tar.gz: 666f07b3aa17dc5eeece0777f6cbfde7bba6552dd1f75295a14bf4780eec7b7f45f713cd0eb532615941ddffc212c76639aff40b1778812da48cfe755c3c68d7
6
+ metadata.gz: 2d86ed628bbbbf169b9cde1918084d56a94ec670c58c5f95f97b966127b278dd02360b486d9213692c50d1c5fe82653367fd025614a2436c061fc37866f6886f
7
+ data.tar.gz: 8d29a0e68562a94dabda9b1c93c30e6c1f845a297a2611dcf14fad85b6f4b00305299d947088c8cb3d5b02793466a1736780e1c4c23a95e0ebcc64a99d80c601
data/exe/rspec_booster CHANGED
@@ -1,9 +1,13 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "test_boosters/rspec_booster"
3
+ require 'test_boosters'
4
4
 
5
5
  cli_options = Semaphore::parse
6
6
  thread_index = cli_options[:index] - 1
7
7
  rspec_booster = Semaphore::RspecBooster.new(thread_index)
8
8
  exit_status = rspec_booster.run
9
+
10
+ report_path = rspec_booster.report_path
11
+ Semaphore::InsightsUploader.new.upload("rspec", report_path)
12
+
9
13
  exit(exit_status)
@@ -0,0 +1,21 @@
1
+ module Semaphore
2
+ module_function
3
+
4
+ class InsightsUploader
5
+ def initialize
6
+ @project_hash_id = ENV["SEMAPHORE_PROJECT_UUID"]
7
+ @build_hash_id = ENV["SEMAPHORE_EXECUTABLE_UUID"]
8
+ @job_hash_id = ENV["SEMAPHORE_JOB_UUID"]
9
+ end
10
+
11
+ def upload(booster_type, file)
12
+ url = "https://insights-receiver.semaphoreci.com/job_reports" +
13
+ "?job_hash_id=#{@job_hash_id}" +
14
+ "&build_hash_id=#{@build_hash_id}" +
15
+ "&project_hash_id=#{@project_hash_id}"
16
+ cmd = "http POST '#{url}' #{booster_type}:=@#{file}"
17
+
18
+ Semaphore.execute(cmd)
19
+ end
20
+ end
21
+ end
@@ -7,6 +7,8 @@ module Semaphore
7
7
  require "test_boosters/leftover_files"
8
8
 
9
9
  class RspecBooster
10
+ attr_reader :report_path
11
+
10
12
  def initialize(thread_index)
11
13
  @thread_index = thread_index
12
14
  @rspec_split_configuration_path = ENV["RSPEC_SPLIT_CONFIGURATION_PATH"] || "#{ENV["HOME"]}/rspec_split_configuration.json"
@@ -1,3 +1,3 @@
1
1
  module TestBoosters
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
data/lib/test_boosters.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "test_boosters/version"
2
2
  require "test_boosters/rspec_booster"
3
3
  require "test_boosters/cucumber_booster"
4
+ require "test_boosters/insights_uploader"
4
5
 
5
6
  module TestBoosters
6
7
  # Your code goes here...
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semaphore_test_boosters
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - MAINTAINER Rendered Text
@@ -105,6 +105,7 @@ files:
105
105
  - lib/test_boosters/cucumber_booster.rb
106
106
  - lib/test_boosters/display_files.rb
107
107
  - lib/test_boosters/executor.rb
108
+ - lib/test_boosters/insights_uploader.rb
108
109
  - lib/test_boosters/leftover_files.rb
109
110
  - lib/test_boosters/logger.rb
110
111
  - lib/test_boosters/rspec_booster.rb