lazylead 0.7.0 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +7 -2
- data/.docker/Dockerfile +17 -6
- data/.docs/duedate_expired.md +1 -1
- data/.rubocop.yml +71 -2
- data/Gemfile +1 -1
- data/Rakefile +7 -4
- data/bin/lazylead +1 -1
- data/lazylead.gemspec +26 -25
- data/lib/lazylead.rb +2 -2
- data/lib/lazylead/allocated.rb +1 -1
- data/lib/lazylead/cc.rb +17 -23
- data/lib/lazylead/cli/app.rb +1 -1
- data/lib/lazylead/confluence.rb +2 -2
- data/lib/lazylead/email.rb +1 -1
- data/lib/lazylead/exchange.rb +1 -1
- data/lib/lazylead/home.rb +1 -1
- data/lib/lazylead/log.rb +1 -1
- data/lib/lazylead/model.rb +6 -8
- data/lib/lazylead/opts.rb +6 -3
- data/lib/lazylead/postman.rb +1 -1
- data/{Guardfile → lib/lazylead/requires.rb} +13 -8
- data/lib/lazylead/salt.rb +1 -1
- data/lib/lazylead/schedule.rb +1 -1
- data/lib/lazylead/smtp.rb +1 -1
- data/lib/lazylead/system/empty.rb +1 -1
- data/lib/lazylead/system/fake.rb +1 -1
- data/lib/lazylead/system/jira.rb +20 -18
- data/lib/lazylead/system/synced.rb +1 -1
- data/lib/lazylead/task/accuracy/accuracy.rb +24 -30
- data/lib/lazylead/task/accuracy/affected_build.rb +1 -1
- data/lib/lazylead/task/accuracy/attachment.rb +3 -3
- data/lib/lazylead/task/accuracy/environment.rb +1 -1
- data/lib/lazylead/task/accuracy/logs.rb +6 -3
- data/lib/lazylead/task/accuracy/onlyll.rb +7 -10
- data/lib/lazylead/task/accuracy/records.rb +2 -2
- data/lib/lazylead/task/accuracy/requirement.rb +1 -1
- data/lib/lazylead/task/accuracy/screenshots.rb +51 -0
- data/lib/lazylead/task/accuracy/servers.rb +3 -3
- data/lib/lazylead/task/accuracy/stacktrace.rb +1 -1
- data/lib/lazylead/task/accuracy/testcase.rb +3 -3
- data/lib/lazylead/task/accuracy/wiki.rb +1 -1
- data/lib/lazylead/task/{alert.rb → alert/alert.rb} +6 -6
- data/lib/lazylead/task/alert/alertif.rb +75 -0
- data/lib/lazylead/task/alert/changed_to.rb +58 -0
- data/lib/lazylead/task/assignment.rb +1 -1
- data/lib/lazylead/task/confluence_ref.rb +1 -1
- data/lib/lazylead/task/echo.rb +1 -1
- data/lib/lazylead/task/fix_version.rb +1 -1
- data/lib/lazylead/task/loading.rb +94 -0
- data/lib/lazylead/task/missing_comment.rb +1 -1
- data/lib/lazylead/task/propagate_down.rb +3 -3
- data/lib/lazylead/task/savepoint.rb +1 -1
- data/lib/lazylead/task/svn/diff.rb +29 -7
- data/lib/lazylead/task/svn/grep.rb +2 -2
- data/lib/lazylead/task/svn/touch.rb +2 -2
- data/lib/lazylead/version.rb +2 -2
- data/lib/messages/accuracy.erb +1 -1
- data/lib/messages/alertif.erb +134 -0
- data/lib/messages/created_recently.erb +110 -0
- data/lib/messages/loading.erb +117 -0
- data/readme.md +26 -18
- data/test/lazylead/allocated_test.rb +1 -1
- data/test/lazylead/cc_test.rb +1 -1
- data/test/lazylead/cli/app_test.rb +2 -2
- data/test/lazylead/confluence_test.rb +1 -1
- data/test/lazylead/exchange_test.rb +1 -1
- data/test/lazylead/model_test.rb +1 -1
- data/test/lazylead/opts_test.rb +1 -1
- data/test/lazylead/postman_test.rb +1 -1
- data/test/lazylead/salt_test.rb +1 -1
- data/test/lazylead/smoke_test.rb +1 -1
- data/test/lazylead/smtp_test.rb +2 -5
- data/test/lazylead/system/jira_test.rb +10 -1
- data/test/lazylead/task/accuracy/accuracy_test.rb +1 -1
- data/test/lazylead/task/accuracy/affected_build_test.rb +1 -1
- data/test/lazylead/task/accuracy/attachment_test.rb +2 -2
- data/test/lazylead/task/accuracy/environment_test.rb +1 -1
- data/test/lazylead/task/accuracy/logs_test.rb +13 -1
- data/test/lazylead/task/accuracy/onlyll_test.rb +1 -1
- data/test/lazylead/task/accuracy/records_test.rb +1 -1
- data/test/lazylead/task/accuracy/score_test.rb +29 -2
- data/test/lazylead/task/accuracy/screenshots_test.rb +84 -0
- data/test/lazylead/task/accuracy/servers_test.rb +1 -1
- data/test/lazylead/task/accuracy/stacktrace_test.rb +1 -1
- data/test/lazylead/task/accuracy/testcase_test.rb +28 -1
- data/test/lazylead/task/accuracy/wiki_test.rb +1 -1
- data/test/lazylead/task/alert/alertif_test.rb +54 -0
- data/test/lazylead/task/{assignee_alert_test.rb → alert/assignee_alert_test.rb} +10 -10
- data/test/lazylead/task/alert/changed_to_test.rb +42 -0
- data/test/lazylead/task/assignment_test.rb +1 -1
- data/test/lazylead/task/confluence_ref_test.rb +1 -1
- data/test/lazylead/task/created_recently_test.rb +53 -0
- data/test/lazylead/task/duedate_test.rb +5 -12
- data/test/lazylead/task/echo_test.rb +1 -1
- data/test/lazylead/task/fix_version_test.rb +1 -1
- data/test/lazylead/task/loading_test.rb +54 -0
- data/test/lazylead/task/missing_comment_test.rb +1 -1
- data/test/lazylead/task/propagate_down_test.rb +1 -1
- data/test/lazylead/task/savepoint_test.rb +3 -3
- data/test/lazylead/task/svn/diff_test.rb +8 -4
- data/test/lazylead/task/svn/grep_test.rb +1 -1
- data/test/lazylead/task/svn/touch_test.rb +1 -1
- data/test/lazylead/version_test.rb +1 -1
- data/test/sqlite_test.rb +1 -1
- data/test/test.rb +15 -5
- data/upgrades/sqlite/001-install-main-lazylead-tables.sql +1 -1
- data/upgrades/sqlite/999.testdata.sql +1 -1
- metadata +82 -51
data/readme.md
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
[![Hits-of-Code](https://hitsofcode.com/github/dgroup/lazylead)](https://hitsofcode.com/view/github/dgroup/lazylead)
|
8
8
|
[![License: MIT](https://img.shields.io/github/license/mashape/apistatus.svg)](./license.txt)
|
9
9
|
|
10
|
-
[![Build status circleci](https://circleci.com/gh/dgroup/lazylead.svg?style=shield)](https://circleci.com/gh/dgroup/lazylead)
|
10
|
+
[![Build status circleci](https://circleci.com/gh/dgroup/lazylead/tree/master.svg?style=shield)](https://circleci.com/gh/dgroup/lazylead/tree/master)
|
11
11
|
[![0pdd](http://www.0pdd.com/svg?name=dgroup/lazylead)](http://www.0pdd.com/p?name=dgroup/lazylead)
|
12
12
|
[![Dependency Status](https://requires.io/github/dgroup/lazylead/requirements.svg?branch=master)](https://requires.io/github/dgroup/lazylead/requirements/?branch=master)
|
13
13
|
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dgroup_lazylead&metric=alert_status)](https://sonarcloud.io/dashboard?id=dgroup_lazylead)
|
@@ -30,23 +30,31 @@ I think you remember how [static code analysis](https://en.wikipedia.org/wiki/St
|
|
30
30
|
|
31
31
|
Join our telegram group [lazylead.org](https://t.me/lazyleads) for discussions.
|
32
32
|
|
33
|
-
| Daily annoying task | Jira | Github | Trello |
|
34
|
-
| :---------------------------------------------------------------------------------- | :---: | :----: | :----: |
|
35
|
-
| [Notify ticket's assignee](lib/lazylead/task/alert.rb)
|
36
|
-
| [Notify ticket's reporter](lib/lazylead/task/alert.rb)
|
37
|
-
| [Notify ticket's manager](lib/lazylead/task/alert.rb)
|
38
|
-
| [Notify about illegal "Fix Version" modification](lib/lazylead/task/fix_version.rb) | ✅ | ❌ | ❌ |
|
39
|
-
| [Expected comment in ticket is missing](lib/lazylead/task/missing_comment.rb) | ✅ | ⌛ | ⌛ |
|
40
|
-
| [Propagate some fields from parent ticket into sub-tasks](.docs/propagate_down.md) | ✅ | ❌ | ❌ |
|
41
|
-
| [Evaluate the ticket formatting accuracy](.docs/accuracy.md) | ✅ | ⌛ | ⌛ |
|
42
|
-
| Print the current capacity of team into newly created tasks | ⌛ | ⌛ | ⌛ |
|
43
|
-
| Create/retrofit the defect automatically into latest release | ⌛ | ⌛ | ❌ |
|
44
|
-
| [Notify about expired(ing) due dates](.docs/duedate_expired.md) | ✅ | ❌ | ⌛ |
|
45
|
-
| Notify about absent original estimations | ⌛ | ⌛ | ⌛ |
|
46
|
-
| Notify about 'Hot potato' tickets | ⌛ | ⌛ | ⌛ |
|
47
|
-
| Notify about long live tickets (aging) | ⌛ | ⌛ | ⌛ |
|
48
|
-
|
|
49
|
-
|
|
33
|
+
| Daily annoying task | Jira | Github | Trello | SVN |
|
34
|
+
| :---------------------------------------------------------------------------------- | :---: | :----: | :----: | :----: |
|
35
|
+
| [Notify ticket's assignee](lib/lazylead/task/alert/alert.rb) | ✅ | ⌛ | ⌛ | ❌ |
|
36
|
+
| [Notify ticket's reporter](lib/lazylead/task/alert/alert.rb) | ✅ | ⌛ | ⌛ | ❌ |
|
37
|
+
| [Notify ticket's manager](lib/lazylead/task/alert/alert.rb) | ✅ | ⌛ | ⌛ | ❌ |
|
38
|
+
| [Notify about illegal "Fix Version" modification](lib/lazylead/task/fix_version.rb) | ✅ | ❌ | ❌ | ❌ |
|
39
|
+
| [Expected comment in ticket is missing](lib/lazylead/task/missing_comment.rb) | ✅ | ⌛ | ⌛ | ❌ |
|
40
|
+
| [Propagate some fields from parent ticket into sub-tasks](.docs/propagate_down.md) | ✅ | ❌ | ❌ | ❌ |
|
41
|
+
| [Evaluate the ticket formatting accuracy](.docs/accuracy.md) | ✅ | ⌛ | ⌛ | ❌ |
|
42
|
+
| Print the current capacity of team into newly created tasks | ⌛ | ⌛ | ⌛ | ❌ |
|
43
|
+
| Create/retrofit the defect automatically into latest release | ⌛ | ⌛ | ❌ | ❌ |
|
44
|
+
| [Notify about expired(ing) due dates](.docs/duedate_expired.md) | ✅ | ❌ | ⌛ | ❌ |
|
45
|
+
| Notify about absent original estimations | ⌛ | ⌛ | ⌛ | ❌ |
|
46
|
+
| Notify about 'Hot potato' tickets | ⌛ | ⌛ | ⌛ | ❌ |
|
47
|
+
| Notify about long live tickets (aging) | ⌛ | ⌛ | ⌛ | ❌ |
|
48
|
+
| Create a meeting(s) automatically in case some tickets appeared (group by assignee/reporters/component/ticket type/etc) | ⌛ | ⌛ | ⌛ | ❌ |
|
49
|
+
| Propogate fields from parent tickets to sub-tasks | ✅ | ⌛ | ⌛ | ❌ |
|
50
|
+
| Notify about tickets without comments with expected text | ✅ | ⌛ | ⌛ | ❌ |
|
51
|
+
| Notify about team loading (no tasks on teammates) | ✅ | ⌛ | ⌛ | ❌ |
|
52
|
+
| Notify about tickets matches predefined multiple conditions | ✅ | ⌛ | ⌛ | ❌ |
|
53
|
+
| Link automatically the ticket and Confluence page if link found in ticket's comments/description | ✅ | ⌛ | ⌛ | ❌ |
|
54
|
+
| Notify about tickets assigned to your team members not by effective managers| ✅ | ⌛ | ⌛ | ❌ |
|
55
|
+
| Notify about modifications of important files in VCS | ❌ | ⌛ | ❌ | ✅ |
|
56
|
+
| Notify about diff changes for past X period in VCS | ❌ | ⌛ | ❌ | ✅ |
|
57
|
+
| Notify about changes with some text for past X period in VCS | ❌ | ⌛ | ❌ | ✅ |
|
50
58
|
|
51
59
|
| Integration | Type | Status |
|
52
60
|
| :---------------------------------------------------- | :-----------: | :----: |
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
data/test/lazylead/cc_test.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
-
# of this software and associated documentation files (the "Software"
|
8
|
+
# of this software and associated documentation files (the "Software"),
|
9
9
|
# to deal in the Software without restriction, including without limitation
|
10
10
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
11
11
|
# and/or sell copies of the Software, and to permit persons to whom
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
data/test/lazylead/model_test.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
data/test/lazylead/opts_test.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
data/test/lazylead/salt_test.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
data/test/lazylead/smoke_test.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
data/test/lazylead/smtp_test.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -38,10 +38,7 @@ module Lazylead
|
|
38
38
|
subject "The fake!"
|
39
39
|
body "Fake body"
|
40
40
|
end
|
41
|
-
assert_equal
|
42
|
-
Mail::TestMailer.deliveries
|
43
|
-
.filter { |m| m.subject.eql? "The fake!" }
|
44
|
-
.length
|
41
|
+
assert_equal(1, Mail::TestMailer.deliveries.count { |m| m.subject.eql? "The fake!" })
|
45
42
|
end
|
46
43
|
|
47
44
|
# @todo #43/DEV email-related properties should be exported to the CI env
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -185,5 +185,14 @@ module Lazylead
|
|
185
185
|
.issues("key>DATAJDBC-500")
|
186
186
|
.size >= 118
|
187
187
|
end
|
188
|
+
|
189
|
+
test "connected based on string properties" do
|
190
|
+
refute_empty Jira.new(
|
191
|
+
"username" => nil,
|
192
|
+
"password" => nil,
|
193
|
+
"site" => "https://jira.spring.io",
|
194
|
+
"context_path" => ""
|
195
|
+
).issues("key=DATAJDBC-480")
|
196
|
+
end
|
188
197
|
end
|
189
198
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -34,7 +34,7 @@ module Lazylead
|
|
34
34
|
super "", 0, ""
|
35
35
|
end
|
36
36
|
|
37
|
-
def
|
37
|
+
def matches?(attach)
|
38
38
|
"ConfigServerLogWithException.txt".eql? attach.attrs["filename"]
|
39
39
|
end
|
40
40
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -134,5 +134,17 @@ module Lazylead
|
|
134
134
|
)
|
135
135
|
)
|
136
136
|
end
|
137
|
+
|
138
|
+
test "filename contain word logs" do
|
139
|
+
assert Logs.new.passed(
|
140
|
+
OpenStruct.new(
|
141
|
+
attachments: [
|
142
|
+
OpenStruct.new(
|
143
|
+
attrs: { "size" => 10_241, "filename" => "the some logs]here.gz" }
|
144
|
+
)
|
145
|
+
]
|
146
|
+
)
|
147
|
+
)
|
148
|
+
end
|
137
149
|
end
|
138
150
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -24,6 +24,7 @@
|
|
24
24
|
|
25
25
|
require_relative "../../../test"
|
26
26
|
require_relative "../../../../lib/lazylead/task/accuracy/accuracy"
|
27
|
+
require_relative "../../../../lib/lazylead/task/accuracy/affected_build"
|
27
28
|
|
28
29
|
module Lazylead
|
29
30
|
class ScoreTest < Lazylead::Test
|
@@ -39,8 +40,34 @@ module Lazylead
|
|
39
40
|
"100": "100"
|
40
41
|
}.each do |k, v|
|
41
42
|
assert_equal v.to_f,
|
42
|
-
Lazylead::Score.new({}, {}
|
43
|
+
Lazylead::Score.new({}, {}).grade(k.to_s.to_f)
|
43
44
|
end
|
44
45
|
end
|
46
|
+
|
47
|
+
test "comment has proper structure" do
|
48
|
+
assert_words %w[triage accuracy is 100.0%],
|
49
|
+
Score.new(
|
50
|
+
Struct.new(:key) do
|
51
|
+
def reporter
|
52
|
+
OpenStruct.new(id: "userid")
|
53
|
+
end
|
54
|
+
|
55
|
+
def fields
|
56
|
+
{ "versions" => ["0.1.0"] }
|
57
|
+
end
|
58
|
+
end.new("DATAJDBC-493"),
|
59
|
+
Opts.new(
|
60
|
+
rules: [Lazylead::AffectedBuild.new],
|
61
|
+
total: 0.5,
|
62
|
+
"colors" => {
|
63
|
+
"0" => "#FF4F33",
|
64
|
+
"35" => "#FF9F33",
|
65
|
+
"57" => "#19DD1E",
|
66
|
+
"90" => "#0FA81A"
|
67
|
+
}.to_json.to_s,
|
68
|
+
"docs" => "https://github.com/dgroup/lazylead/blob/master/.github/ISSUE_TEMPLATE/bug_report.md"
|
69
|
+
)
|
70
|
+
).evaluate.comment
|
71
|
+
end
|
45
72
|
end
|
46
73
|
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# The MIT License
|
4
|
+
#
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
|
+
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"),
|
9
|
+
# to deal in the Software without restriction, including without limitation
|
10
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
11
|
+
# and/or sell copies of the Software, and to permit persons to whom
|
12
|
+
# the Software is furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included
|
15
|
+
# in all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
22
|
+
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
23
|
+
# OR OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
|
25
|
+
require_relative "../../../test"
|
26
|
+
require_relative "../../../../lib/lazylead/task/accuracy/screenshots"
|
27
|
+
require_relative "../../../../lib/lazylead/system/jira"
|
28
|
+
|
29
|
+
module Lazylead
|
30
|
+
class ScreenshotsTest < Lazylead::Test
|
31
|
+
test "issue has two .png files with reference in description" do
|
32
|
+
assert Screenshots.new.passed(
|
33
|
+
OpenStruct.new(
|
34
|
+
description: "Hi,\n here are snapshots !img1.jpg|thumbnail!\n!img2.jpg|thumbnail!\n",
|
35
|
+
fields: {
|
36
|
+
"description" => "Hi,\n here are snapshots !img1.jpg|thumbnail!\n!img2.jpg|thumbnail!\n"
|
37
|
+
},
|
38
|
+
attachments: [
|
39
|
+
OpenStruct.new("filename" => "img1.jpg"),
|
40
|
+
OpenStruct.new("filename" => "img2.jpg")
|
41
|
+
]
|
42
|
+
)
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
test "issue has several .png attachments mentioned using !xxx|thumbnail! option" do
|
47
|
+
assert Screenshots.new.passed(
|
48
|
+
NoAuthJira.new("https://jira.spring.io")
|
49
|
+
.issues("key=SPR-15729", fields: %w[attachment description])
|
50
|
+
.first
|
51
|
+
)
|
52
|
+
end
|
53
|
+
|
54
|
+
test "issue has only one .png file however minimum 2 are required" do
|
55
|
+
refute Screenshots.new.passed(
|
56
|
+
OpenStruct.new(
|
57
|
+
description: "Hi,\n here are snapshots !img1.jpg|thumbnail!\n",
|
58
|
+
fields: {
|
59
|
+
"description" => "Hi,\n here are snapshots !img1.jpg|thumbnail!\n"
|
60
|
+
},
|
61
|
+
attachments: [
|
62
|
+
OpenStruct.new("filename" => "img1.jpg"),
|
63
|
+
OpenStruct.new("filename" => "img2.jpg")
|
64
|
+
]
|
65
|
+
)
|
66
|
+
)
|
67
|
+
end
|
68
|
+
|
69
|
+
test "issue has two .png files with reference in description but with extension mismatch" do
|
70
|
+
refute Screenshots.new.passed(
|
71
|
+
OpenStruct.new(
|
72
|
+
description: "Hi,\n here are snapshots !img1.jpg|thumbnail!\n!img2.jpg|thumbnail!\n",
|
73
|
+
fields: {
|
74
|
+
"description" => "Hi,\n here are snapshots !img1.jpg|thumbnail!\n!img2.jpg|thumbnail!\n"
|
75
|
+
},
|
76
|
+
attachments: [
|
77
|
+
OpenStruct.new("filename" => "img1.JPG"),
|
78
|
+
OpenStruct.new("filename" => "img2.jpg")
|
79
|
+
]
|
80
|
+
)
|
81
|
+
)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|