milou 0.0.5 → 0.0.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df8b2e6b7a85a2840174f7b33010a9a7aae8dfb24276a76b117d3d5c13c10a65
4
- data.tar.gz: 488b2fe44ba43dfab84f0ea9b788956f0efac358e76704b78edffb41b68e7fd1
3
+ metadata.gz: df81326dc5e5454d15d4ed6611611fffc3d2f00723b5bdf584702828e68eb702
4
+ data.tar.gz: b958f56028ebac211ce2414a1a511e0c2116bd6a11831aa33e4ae7a2e419b7ef
5
5
  SHA512:
6
- metadata.gz: 35555388d2874afa1459e2ddb924729c0ce1c059d007f41beede722de97dc3d30473e4103b1ef445aa38e0cf3519587299246598a23130ff73eb8a947e2ea50f
7
- data.tar.gz: 72eb5fad96f891bd2e60401c5adfb753257dbd3d12572db57e60c8e517537659c3564564f7aaff1a5c44566ed28739f7accb3f19f051a51ef15c0e55095f2a28
6
+ metadata.gz: 9d4fdc65b08a6b465173f8b1cd4766b4acd98956ab928ce6a97e1162c8709ac5ccbbb62c75af06dbc621111f90468a08f65f186f9bc7a289dd13cf244f432a54
7
+ data.tar.gz: db0c028274f4dac4709e2b3ac3388936139fab7a83cc935fe9092d824f7abd071635dca1b0aaf35e691d5045df9a9bada03f317fe5f08edaa2803204d8e4cae5
data/bin/watchdog CHANGED
@@ -7,6 +7,8 @@ when 'detox'
7
7
  puts Watchdog::run_detox
8
8
  when 'jest'
9
9
  puts 'JEST'
10
+ when 'hackerman'
11
+ puts Watchdog::run_hacker
10
12
  else
11
13
  puts 'need to specify which runner'
12
14
  end
@@ -52,13 +52,15 @@ module Watchdog
52
52
  end
53
53
  end
54
54
 
55
+ headers = {
56
+ 'Content-Type' => 'application/json',
57
+ 'X-API-KEY' => ENV['WATCHDOG_AUTH_TOKEN']
58
+ }
59
+
55
60
  response = HTTParty.post(
56
61
  ENV['WATCHDOG_API_URL'],
57
- body: run.to_json,
58
- headers: {
59
- 'Content-Type' => 'application/json',
60
- 'X-API-KEY' => ENV['WATCHDOG_AUTH_TOKEN']
61
- }
62
+ :body => run.to_json,
63
+ :headers => headers
62
64
  )
63
65
 
64
66
  puts "Watchdog response: #{response}"
@@ -0,0 +1,46 @@
1
+ require 'httparty'
2
+
3
+ module Watchdog
4
+ class Hacker
5
+ def initialize()
6
+ end
7
+
8
+ def run
9
+ send_test
10
+ end
11
+
12
+ # Watchdog runner
13
+ def send_test
14
+ run = {
15
+ test_run: {
16
+ commit_branch: "main",
17
+ commit_sha: "awugdadba",
18
+ commit_timestamp: "2022-05-27 17:42:31 +0100",
19
+ test_suite_name: "Test Suite v3",
20
+ test_results: [
21
+ { status: "FAIL", test: "TEST-1", time: "50.028" },
22
+ { status: "PASS", test: "TEST-2", time: "31.363" },
23
+ ]
24
+ }
25
+ }
26
+
27
+ puts "ENV"
28
+ puts ENV['WATCHDOG_TEST_SUIT_NAME']
29
+ puts ENV['WATCHDOG_AUTH_TOKEN']
30
+ puts ENV['WATCHDOG_API_URL']
31
+
32
+ headers = {
33
+ 'Content-Type' => 'application/json',
34
+ 'X-API-KEY' => ENV['WATCHDOG_AUTH_TOKEN']
35
+ }
36
+ puts headers
37
+ response = HTTParty.post(
38
+ ENV['WATCHDOG_API_URL'],
39
+ :body => run.to_json,
40
+ :headers => headers
41
+ )
42
+
43
+ puts "Watchdog response: #{response}"
44
+ end
45
+ end
46
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Watchdog
4
- VERSION = "0.0.5".freeze
4
+ VERSION = "0.0.6".freeze
5
5
  end
data/lib/watchdog.rb CHANGED
@@ -2,10 +2,16 @@ require 'dotenv'
2
2
  Dotenv.load
3
3
 
4
4
  require_relative 'watchdog/detox'
5
+ require_relative 'watchdog/hacker'
5
6
 
6
7
  module Watchdog
7
8
  def self.run_detox
8
9
  runner = Watchdog::Detox.new
9
10
  runner.run
10
11
  end
12
+
13
+ def self.run_hacker
14
+ runner = Watchdog::Hacker.new
15
+ runner.run
16
+ end
11
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: milou
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
  - Carlos Silva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-04 00:00:00.000000000 Z
11
+ date: 2022-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv
@@ -49,6 +49,7 @@ files:
49
49
  - bin/watchdog
50
50
  - lib/watchdog.rb
51
51
  - lib/watchdog/detox.rb
52
+ - lib/watchdog/hacker.rb
52
53
  - lib/watchdog/version.rb
53
54
  homepage: https://github.com/Gaspard-Bruno/watchdog-ruby-gem
54
55
  licenses: