milou 0.0.9 → 1.0.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.
- checksums.yaml +4 -4
- data/lib/watchdog/detox.rb +19 -15
- data/lib/watchdog/utils.rb +4 -4
- data/lib/watchdog/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35c1b97511bd156f6c9f7fe78ae56c57548000ec02f9081ed9f71e1d5c71d84d
|
4
|
+
data.tar.gz: b6a63f15c3b513ab8810125b338487253281742de21c5c3ff81e24a5e16d721a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3e4235616ed6020a1086101f55a9647212e8d7a3b5b7d41224a0f64a3294468b0d27af65459c1a71965fb9ca2ada113c14bdcea162a4bcadf80bbe5163584b1
|
7
|
+
data.tar.gz: 6652d5076db74480f1ddba263f706561b1009d1da7d0f724dfad5d350a9ff239481bcac32bc23aba04366728b7a74a019ecc4da6fd80863434d5950ea6b20f1e
|
data/lib/watchdog/detox.rb
CHANGED
@@ -10,15 +10,15 @@ module Watchdog
|
|
10
10
|
def run
|
11
11
|
build_detox
|
12
12
|
|
13
|
-
|
13
|
+
detox_out, detox_err = run_detox
|
14
14
|
|
15
|
-
run_watchdog(
|
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
|
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)
|
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(
|
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
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
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']
|
data/lib/watchdog/utils.rb
CHANGED
@@ -6,12 +6,12 @@ module Watchdog
|
|
6
6
|
if $watchdog_relative_dir
|
7
7
|
Dir.chdir($watchdog_relative_dir){
|
8
8
|
# %x[ #{cmd} ]
|
9
|
-
|
10
|
-
return
|
9
|
+
out, err, _sts = Open3.capture3(cmd)
|
10
|
+
return out, err
|
11
11
|
}
|
12
12
|
else
|
13
|
-
|
14
|
-
return
|
13
|
+
out, err, _sts = Open3.capture3(cmd)
|
14
|
+
return out, err
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
data/lib/watchdog/version.rb
CHANGED