milou 0.0.7 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/watchdog/detox.rb +19 -15
- data/lib/watchdog/utils.rb +6 -4
- data/lib/watchdog/version.rb +1 -1
- metadata +16 -2
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
@@ -1,15 +1,17 @@
|
|
1
|
+
require 'open3'
|
2
|
+
|
1
3
|
module Watchdog
|
2
4
|
class Utils
|
3
5
|
def self.run_cmd(cmd)
|
4
6
|
if $watchdog_relative_dir
|
5
7
|
Dir.chdir($watchdog_relative_dir){
|
6
8
|
# %x[ #{cmd} ]
|
7
|
-
|
8
|
-
return
|
9
|
+
out, err, _sts = Open3.capture3(cmd)
|
10
|
+
return out, err
|
9
11
|
}
|
10
12
|
else
|
11
|
-
|
12
|
-
return
|
13
|
+
out, err, _sts = Open3.capture3(cmd)
|
14
|
+
return out, err
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
data/lib/watchdog/version.rb
CHANGED
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
|
4
|
+
version: 1.0.0
|
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-
|
11
|
+
date: 2022-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.20.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: open3
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.1.1
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.1.1
|
41
55
|
description: Watchdog SDK to communicate with the Watchdog API
|
42
56
|
email:
|
43
57
|
- ops@gaspardbruno.com
|