watchdoge 0.1.19 → 0.1.20
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/watchdoge/notification/gitlab_repo.rb +25 -21
- data/lib/watchdoge/pixel_test.rb +3 -1
- data/lib/watchdoge/regression/dsl.rb +1 -1
- data/lib/watchdoge/version.rb +1 -1
- data/watchdoge.gemspec +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: 94ab733da6b7c8dc51f47429c260cdf4561d0d88b172bdd4c2673aaed9807c92
|
|
4
|
+
data.tar.gz: 513c7fea1c874ee1bb2261fce89f324167e0d3406af9dc2d3901b34b69ff3ffa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fd7bfd0aae9723c77b12ed1a23464806811984f49499762b26b664f1f5b8d40554e389326d6178e6252cd38f789262e8730a8e88fbf31c06c59c72c4c9702bb6
|
|
7
|
+
data.tar.gz: d61967144fb7b46ac59b7a9262c17ed6d343c32899f580dbd59ff397be3df428d019898b937a76f73b0aedcbc12016980827ed74dc2c279219dd0ee8dd138b09
|
|
@@ -31,7 +31,7 @@ module WatchDoge
|
|
|
31
31
|
|
|
32
32
|
raise RuntimeError, "Can't find any target to pushing message" if target_id.nil?
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
thread = disscussion_thread do |thread_context|
|
|
35
35
|
meesages_to_flush.each do |message|
|
|
36
36
|
case message
|
|
37
37
|
when String
|
|
@@ -42,18 +42,20 @@ module WatchDoge
|
|
|
42
42
|
|
|
43
43
|
post_discussion target_id, message: link
|
|
44
44
|
when WatchDoge::PixelTest
|
|
45
|
+
filename = message.opt[:filename]
|
|
46
|
+
|
|
45
47
|
before = md_img_link upload_image(message.before)
|
|
46
48
|
after = md_img_link upload_image(message.after)
|
|
47
49
|
diff = md_img_link upload_image(message.diff)
|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
thread_context << markdown_table(before, after, diff, filename)
|
|
50
52
|
end
|
|
51
53
|
end
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
thread_context
|
|
54
56
|
end
|
|
55
57
|
|
|
56
|
-
post_discussion target_id, message:
|
|
58
|
+
post_discussion target_id, message: thread
|
|
57
59
|
end
|
|
58
60
|
|
|
59
61
|
def post_discussion target_iid, message:
|
|
@@ -129,28 +131,30 @@ module WatchDoge
|
|
|
129
131
|
""
|
|
130
132
|
end
|
|
131
133
|
|
|
132
|
-
#
|
|
133
|
-
def
|
|
134
|
+
# disscussion_thread do |context|
|
|
135
|
+
def disscussion_thread
|
|
134
136
|
<<~MARKDOWN
|
|
135
137
|
#### Detail: #{ENV['CI_PIPELINE_URL']}
|
|
136
|
-
|
|
137
|
-
<table>
|
|
138
|
-
<tr>
|
|
139
|
-
<th>before</th>
|
|
140
|
-
<th>after</th>
|
|
141
|
-
<th>diff</th>
|
|
142
|
-
</tr>
|
|
143
|
-
#{yield("")}
|
|
144
|
-
</table>
|
|
138
|
+
#{yield("")}
|
|
145
139
|
MARKDOWN
|
|
146
140
|
end
|
|
147
141
|
|
|
148
|
-
def
|
|
149
|
-
"
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
<
|
|
153
|
-
|
|
142
|
+
def markdown_table before, after, diff, filename
|
|
143
|
+
"
|
|
144
|
+
<h5>#{filename}</h5>
|
|
145
|
+
<table>
|
|
146
|
+
<tr>
|
|
147
|
+
<th>Reference</th>
|
|
148
|
+
<th>Test</th>
|
|
149
|
+
<th>Diff</th>
|
|
150
|
+
</tr>
|
|
151
|
+
<tr>
|
|
152
|
+
<td>#{before}</td>
|
|
153
|
+
<td>#{after}</td>
|
|
154
|
+
<td>#{diff}</td>
|
|
155
|
+
</tr>
|
|
156
|
+
</table>
|
|
157
|
+
"
|
|
154
158
|
end
|
|
155
159
|
|
|
156
160
|
def project_uri path
|
data/lib/watchdoge/pixel_test.rb
CHANGED
|
@@ -47,10 +47,12 @@ module WatchDoge
|
|
|
47
47
|
attr_reader :before
|
|
48
48
|
attr_reader :after
|
|
49
49
|
|
|
50
|
-
def initialize input, reference
|
|
50
|
+
def initialize input, reference, **kwargs
|
|
51
51
|
@before = reference
|
|
52
52
|
@after = input
|
|
53
53
|
|
|
54
|
+
@opt = kwargs
|
|
55
|
+
|
|
54
56
|
@diff = self.class.diff input, reference
|
|
55
57
|
end
|
|
56
58
|
|
|
@@ -64,7 +64,7 @@ module WatchDoge
|
|
|
64
64
|
puts " -> compare reference images on worker #{@worker}"
|
|
65
65
|
reference_image = WatchDoge::Regression::Utils.load_png self.reference_image
|
|
66
66
|
input_image = WatchDoge::Regression::Utils.load_png @worker.screenshot.png
|
|
67
|
-
pixel_test = WatchDoge::PixelTest.new(input_image, reference_image)
|
|
67
|
+
pixel_test = WatchDoge::PixelTest.new(input_image, reference_image, filename: @reference_file_name)
|
|
68
68
|
|
|
69
69
|
WatchDoge::Notification.push pixel_test if pixel_test.diff?
|
|
70
70
|
end
|
data/lib/watchdoge/version.rb
CHANGED
data/watchdoge.gemspec
CHANGED