milou 0.0.9 → 1.0.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
  SHA256:
3
- metadata.gz: b91e278dc1d209668ca72eab28abd1fdad87d343fe5f741f1b9aae21f6688066
4
- data.tar.gz: cffbed557d71045ca7d3ec6264c24ea49821f2cedf15a46c721734fc3974fbf6
3
+ metadata.gz: 35c1b97511bd156f6c9f7fe78ae56c57548000ec02f9081ed9f71e1d5c71d84d
4
+ data.tar.gz: b6a63f15c3b513ab8810125b338487253281742de21c5c3ff81e24a5e16d721a
5
5
  SHA512:
6
- metadata.gz: 896af371c5aa516d979dfe5b9406fda18883c461cc4bae0dd544da0dea9968e2326d8af78b99de8098ea9e88304e5d93db614640dc1f4f2a481338a3af17dd6f
7
- data.tar.gz: 6423b6b1238ae97f152489c605692b648a55b99bc655a5ea5958cc2fa1c617037f11ee713493f5409b7e363b8520089f7407a5eabd0d5f5391cba771eb7f4753
6
+ metadata.gz: d3e4235616ed6020a1086101f55a9647212e8d7a3b5b7d41224a0f64a3294468b0d27af65459c1a71965fb9ca2ada113c14bdcea162a4bcadf80bbe5163584b1
7
+ data.tar.gz: 6652d5076db74480f1ddba263f706561b1009d1da7d0f724dfad5d350a9ff239481bcac32bc23aba04366728b7a74a019ecc4da6fd80863434d5950ea6b20f1e
@@ -10,15 +10,15 @@ module Watchdog
10
10
  def run
11
11
  build_detox
12
12
 
13
- detox_result = run_detox
13
+ detox_out, detox_err = run_detox
14
14
 
15
- run_watchdog(detox_result)
15
+ run_watchdog(detox_out, detox_err)
16
16
  end
17
17
 
18
18
  def build_detox
19
19
  detox_cmd = 'yarn run detox-build'
20
20
 
21
- Watchdog::Utils.run_cmd detox_cmd
21
+ Watchdog::Utils.run_cmd(detox_cmd)
22
22
 
23
23
  # %x[ #{detox_cmd} 2>&1 ]
24
24
  end
@@ -27,13 +27,13 @@ module Watchdog
27
27
  def run_detox
28
28
  detox_cmd = 'yarn run detox-test'
29
29
 
30
- Watchdog::Utils.run_cmd(detox_cmd).chomp
30
+ Watchdog::Utils.run_cmd(detox_cmd)
31
31
 
32
32
  # %x[ #{detox_cmd} 2>&1 ]
33
33
  end
34
34
 
35
35
  # Watchdog runner
36
- def run_watchdog(detox_result)
36
+ def run_watchdog(detox_out, detox_err)
37
37
 
38
38
  status_regex = /(FAIL|PASS) (.*\.js) \((.*)\)/
39
39
 
@@ -55,19 +55,23 @@ module Watchdog
55
55
  }
56
56
  }
57
57
 
58
- detox_result.each_line do |line|
59
- line_match = line.match(status_regex)
60
-
61
- if line_match
62
- run[:test_run][:test_results] << {
63
- status: line_match[1],
64
- test: line_match[2],
65
- time: line_match[3]
66
- }
67
- puts "Status: #{line_match[1]} | Test: #{line_match[2]} | Time: #{line_match[3]}"
58
+ [detox_out, detox_err].each do |output|
59
+ output&.chomp&.each_line do |line|
60
+ line_match = line.match(status_regex)
61
+
62
+ if line_match
63
+ run[:test_run][:test_results] << {
64
+ status: line_match[1],
65
+ test: line_match[2],
66
+ time: line_match[3]
67
+ }
68
+ puts "Status: #{line_match[1]} | Test: #{line_match[2]} | Time: #{line_match[3]}"
69
+ end
68
70
  end
69
71
  end
70
72
 
73
+
74
+
71
75
  headers = {
72
76
  'Content-Type' => 'application/json',
73
77
  'X-API-KEY' => ENV['WATCHDOG_AUTH_TOKEN']
@@ -6,12 +6,12 @@ module Watchdog
6
6
  if $watchdog_relative_dir
7
7
  Dir.chdir($watchdog_relative_dir){
8
8
  # %x[ #{cmd} ]
9
- _out, err, _sts = Open3.capture3(cmd)
10
- return _out
9
+ out, err, _sts = Open3.capture3(cmd)
10
+ return out, err
11
11
  }
12
12
  else
13
- _out, err, _sts = Open3.capture3(cmd)
14
- return _out
13
+ out, err, _sts = Open3.capture3(cmd)
14
+ return out, err
15
15
  end
16
16
  end
17
17
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Watchdog
4
- VERSION = "0.0.9".freeze
4
+ VERSION = "1.0.0".freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: milou
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Silva