lazylead 0.11.4 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.0pdd.yml +3 -0
  3. data/.circleci/config.yml +0 -12
  4. data/.docs/accuracy.sql +35 -0
  5. data/.github/workflows/build.yml +39 -0
  6. data/.github/workflows/release.yml +15 -0
  7. data/.rubocop.yml +11 -2
  8. data/.rultor.yml +2 -2
  9. data/Gemfile +1 -1
  10. data/Rakefile +17 -9
  11. data/bin/lazylead +5 -5
  12. data/lazylead.gemspec +22 -25
  13. data/lib/lazylead/allocated.rb +1 -1
  14. data/lib/lazylead/cc.rb +1 -1
  15. data/lib/lazylead/cli/app.rb +3 -3
  16. data/lib/lazylead/confluence.rb +4 -3
  17. data/lib/lazylead/email.rb +1 -1
  18. data/lib/lazylead/exchange.rb +3 -3
  19. data/lib/lazylead/home.rb +2 -2
  20. data/lib/lazylead/log.rb +1 -1
  21. data/lib/lazylead/model.rb +4 -3
  22. data/lib/lazylead/opts.rb +1 -1
  23. data/lib/lazylead/os.rb +2 -1
  24. data/lib/lazylead/postman.rb +8 -7
  25. data/lib/lazylead/requires.rb +1 -1
  26. data/lib/lazylead/salt.rb +1 -1
  27. data/lib/lazylead/schedule.rb +5 -9
  28. data/lib/lazylead/smtp.rb +1 -1
  29. data/lib/lazylead/system/empty.rb +1 -1
  30. data/lib/lazylead/system/fake.rb +1 -1
  31. data/lib/lazylead/system/jira.rb +5 -3
  32. data/lib/lazylead/system/synced.rb +1 -1
  33. data/lib/lazylead/task/accuracy/accuracy.rb +3 -3
  34. data/lib/lazylead/task/accuracy/affected_build.rb +1 -1
  35. data/lib/lazylead/task/accuracy/attachment.rb +1 -1
  36. data/lib/lazylead/task/accuracy/environment.rb +1 -1
  37. data/lib/lazylead/task/accuracy/has_label.rb +1 -1
  38. data/lib/lazylead/task/accuracy/logs.rb +1 -1
  39. data/lib/lazylead/task/accuracy/logs_link.rb +1 -1
  40. data/lib/lazylead/task/accuracy/memes.rb +1 -1
  41. data/lib/lazylead/task/accuracy/onlyll.rb +1 -1
  42. data/lib/lazylead/task/accuracy/records.rb +9 -2
  43. data/lib/lazylead/task/accuracy/records_link.rb +1 -1
  44. data/lib/lazylead/task/accuracy/required.rb +1 -1
  45. data/lib/lazylead/task/accuracy/requirement.rb +1 -1
  46. data/lib/lazylead/task/accuracy/screenshots.rb +1 -1
  47. data/lib/lazylead/task/accuracy/servers.rb +1 -1
  48. data/lib/lazylead/task/accuracy/stacktrace.rb +2 -2
  49. data/lib/lazylead/task/accuracy/testcase.rb +1 -1
  50. data/lib/lazylead/task/accuracy/wiki.rb +1 -1
  51. data/lib/lazylead/task/accuracy/wiki_url.rb +1 -1
  52. data/lib/lazylead/task/alert/alert.rb +1 -1
  53. data/lib/lazylead/task/alert/alertif.rb +1 -1
  54. data/lib/lazylead/task/alert/changed_to.rb +1 -1
  55. data/lib/lazylead/task/assignment.rb +1 -1
  56. data/lib/lazylead/task/confluence_ref.rb +1 -1
  57. data/lib/lazylead/task/echo.rb +2 -2
  58. data/lib/lazylead/task/fix_version.rb +1 -1
  59. data/lib/lazylead/task/git/git.rb +82 -0
  60. data/lib/lazylead/task/loading.rb +2 -3
  61. data/lib/lazylead/task/micromanager.rb +1 -1
  62. data/lib/lazylead/task/missing_comment.rb +1 -1
  63. data/lib/lazylead/task/propagate_down.rb +3 -3
  64. data/lib/lazylead/task/savepoint.rb +1 -1
  65. data/lib/lazylead/task/svn/diff.rb +1 -1
  66. data/lib/lazylead/task/svn/grep.rb +1 -1
  67. data/lib/lazylead/task/svn/svn.rb +1 -1
  68. data/lib/lazylead/task/svn/touch.rb +42 -14
  69. data/lib/lazylead/version.rb +2 -2
  70. data/lib/lazylead.rb +1 -1
  71. data/license.txt +1 -1
  72. data/readme.md +20 -15
  73. data/test/lazylead/allocated_test.rb +1 -1
  74. data/test/lazylead/cc_test.rb +7 -7
  75. data/test/lazylead/cli/app_test.rb +1 -1
  76. data/test/lazylead/confluence_test.rb +1 -1
  77. data/test/lazylead/exchange_test.rb +10 -10
  78. data/test/lazylead/file_postman_test.rb +47 -0
  79. data/test/lazylead/model_test.rb +2 -2
  80. data/test/lazylead/opts_test.rb +1 -1
  81. data/test/lazylead/postman_test.rb +7 -39
  82. data/test/lazylead/retry_test.rb +12 -1
  83. data/test/lazylead/salt_test.rb +1 -1
  84. data/test/lazylead/smoke_test.rb +2 -2
  85. data/test/lazylead/smtp_test.rb +7 -7
  86. data/test/lazylead/stdout_postman_test.rb +48 -0
  87. data/test/lazylead/system/jira_test.rb +53 -54
  88. data/test/lazylead/task/accuracy/accuracy_test.rb +11 -11
  89. data/test/lazylead/task/accuracy/affected_build_test.rb +1 -1
  90. data/test/lazylead/task/accuracy/attachment_test.rb +4 -4
  91. data/test/lazylead/task/accuracy/environment_test.rb +1 -1
  92. data/test/lazylead/task/accuracy/has_label_test.rb +1 -1
  93. data/test/lazylead/task/accuracy/logs_link_test.rb +1 -1
  94. data/test/lazylead/task/accuracy/logs_test.rb +1 -1
  95. data/test/lazylead/task/accuracy/memes_test.rb +1 -1
  96. data/test/lazylead/task/accuracy/onlyll_test.rb +21 -21
  97. data/test/lazylead/task/accuracy/records_llink_test.rb +1 -1
  98. data/test/lazylead/task/accuracy/records_test.rb +35 -12
  99. data/test/lazylead/task/accuracy/score_test.rb +4 -4
  100. data/test/lazylead/task/accuracy/screenshots_test.rb +3 -3
  101. data/test/lazylead/task/accuracy/servers_test.rb +1 -1
  102. data/test/lazylead/task/accuracy/stacktrace_test.rb +1 -1
  103. data/test/lazylead/task/accuracy/testcase_test.rb +1 -1
  104. data/test/lazylead/task/accuracy/wiki_test.rb +1 -1
  105. data/test/lazylead/task/accuracy/wiki_url_test.rb +1 -1
  106. data/test/lazylead/task/alert/alertif_test.rb +5 -5
  107. data/test/lazylead/task/alert/assignee_alert_test.rb +1 -1
  108. data/test/lazylead/task/alert/changed_to_test.rb +5 -5
  109. data/test/lazylead/task/assignment_test.rb +5 -5
  110. data/test/lazylead/task/confluence_ref_test.rb +8 -8
  111. data/test/lazylead/task/created_recently_test.rb +4 -4
  112. data/test/lazylead/task/duedate_test.rb +14 -14
  113. data/test/lazylead/task/echo_test.rb +1 -1
  114. data/test/lazylead/task/fix_version_test.rb +6 -5
  115. data/test/lazylead/task/loading_test.rb +7 -7
  116. data/test/lazylead/task/micromanager_test.rb +5 -5
  117. data/test/lazylead/task/missing_comment_test.rb +4 -4
  118. data/test/lazylead/task/propagate_down_test.rb +1 -1
  119. data/test/lazylead/task/savepoint_test.rb +1 -1
  120. data/test/lazylead/task/svn/diff_test.rb +14 -15
  121. data/test/lazylead/task/svn/grep_test.rb +4 -3
  122. data/test/lazylead/task/svn/touch_test.rb +74 -6
  123. data/test/lazylead/version_test.rb +1 -1
  124. data/test/sqlite_test.rb +1 -1
  125. data/test/test.rb +10 -3
  126. metadata +49 -107
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 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"),
@@ -31,9 +31,9 @@ require_relative "../../../lib/lazylead/system/jira"
31
31
  module Lazylead
32
32
  class JiraTest < Lazylead::Test
33
33
  test "found issue by id" do
34
- assert_equal "DATAJDBC-480",
35
- NoAuthJira.new("https://jira.spring.io")
36
- .issues("key in ('DATAJDBC-480')")
34
+ assert_equal "JAVA-150",
35
+ NoAuthJira.new("https://jira.mongodb.org")
36
+ .issues("key in ('JAVA-150')")
37
37
  .first
38
38
  .key
39
39
  end
@@ -46,20 +46,20 @@ module Lazylead
46
46
  vcs4sql: "upgrades/sqlite",
47
47
  testdata: true
48
48
  )
49
- assert_equal "DATAJDBC-500",
49
+ assert_equal "JAVA-150",
50
50
  ORM::Task.find(4)
51
51
  .system
52
52
  .connect
53
- .issues("key in ('DATAJDBC-500')")
53
+ .issues("key in ('JAVA-150')")
54
54
  .first
55
55
  .key,
56
- "Id mismatch for https://jira.spring.io/browse/DATAJDBC-500"
56
+ "Id mismatch for https://jira.mongodb.org/browse/JAVA-150"
57
57
  end
58
58
 
59
59
  test "group by assignee" do
60
60
  assert_equal 2,
61
- NoAuthJira.new("https://jira.spring.io")
62
- .issues("filter=16743")
61
+ NoAuthJira.new("https://jira.mongodb.org")
62
+ .issues("filter=46202")
63
63
  .group_by(&:assignee)
64
64
  .min_by { |a| a.first.id }
65
65
  .length,
@@ -67,58 +67,58 @@ module Lazylead
67
67
  end
68
68
 
69
69
  test "issue reporter fetched successfully" do
70
- assert_equal "Mark Paluch",
71
- NoAuthJira.new("https://jira.spring.io")
72
- .issues("key in ('DATAJDBC-480')")
70
+ assert_equal "Joseph Wang",
71
+ NoAuthJira.new("https://jira.mongodb.org")
72
+ .issues("key in ('JAVA-150')")
73
73
  .first
74
74
  .reporter
75
75
  .name
76
76
  end
77
77
 
78
78
  test "issue url fetched successfully" do
79
- assert_equal "https://jira.spring.io/browse/DATAJDBC-480",
80
- NoAuthJira.new("https://jira.spring.io")
81
- .issues("key in ('DATAJDBC-480')")
79
+ assert_equal "https://jira.mongodb.org/browse/JAVA-150",
80
+ NoAuthJira.new("https://jira.mongodb.org")
81
+ .issues("key in ('JAVA-150')")
82
82
  .first
83
83
  .url
84
84
  end
85
85
 
86
86
  test "issue history found" do
87
- greater_or_eq 8,
88
- NoAuthJira.new("https://jira.spring.io")
89
- .issues("key='DATAJDBC-480'", expand: "changelog")
87
+ greater_or_eq 10,
88
+ NoAuthJira.new("https://jira.mongodb.org")
89
+ .issues("key='JAVA-150'", expand: "changelog")
90
90
  .first
91
91
  .history
92
92
  .size
93
93
  end
94
94
 
95
95
  test "issue history not found" do
96
- assert_empty NoAuthJira.new("https://jira.spring.io")
97
- .issues("key='DATAJDBC-480'")
96
+ assert_empty NoAuthJira.new("https://jira.mongodb.org")
97
+ .issues("key='JAVA-150'")
98
98
  .first
99
99
  .history
100
100
  end
101
101
 
102
102
  test "2nd issue history item is correct" do
103
- assert_equal "396918",
104
- NoAuthJira.new("https://jira.spring.io")
105
- .issues("key='DATAJDBC-480'", expand: "changelog")
103
+ assert_equal "24893",
104
+ NoAuthJira.new("https://jira.mongodb.org")
105
+ .issues("key='JAVA-150'", expand: "changelog")
106
106
  .first
107
107
  .history[2]["id"]
108
108
  end
109
109
 
110
110
  test "issue has expected status" do
111
111
  assert_equal "Closed",
112
- NoAuthJira.new("https://jira.spring.io")
113
- .issues("key='DATAJDBC-480'")
112
+ NoAuthJira.new("https://jira.mongodb.org")
113
+ .issues("key='JAVA-150'")
114
114
  .first
115
115
  .status
116
116
  end
117
117
 
118
118
  test "issue has 1 field" do
119
119
  assert_equal 1,
120
- NoAuthJira.new("https://jira.spring.io")
121
- .issues("key='DATAJDBC-480'", fields: ["summary"])
120
+ NoAuthJira.new("https://jira.mongodb.org")
121
+ .issues("key='JAVA-150'", fields: ["summary"])
122
122
  .first
123
123
  .fields
124
124
  .size
@@ -143,47 +143,46 @@ module Lazylead
143
143
  end
144
144
 
145
145
  test "description is correct" do
146
- assert_words ["DATACMNS-1639 moved entity instantiators"],
147
- NoAuthJira.new("https://jira.spring.io")
148
- .issues("key=DATAJDBC-480")
146
+ assert_words ["We've multiple colos"],
147
+ NoAuthJira.new("https://jira.mongodb.org")
148
+ .issues("key=JAVA-150")
149
149
  .first
150
150
  .description
151
151
  end
152
152
 
153
153
  test "component is correct" do
154
- assert_equal ["Stream Module"],
155
- NoAuthJira.new("https://jira.spring.io")
156
- .issues("key=XD-3766")
154
+ assert_equal ["GridFS"],
155
+ NoAuthJira.new("https://jira.mongodb.org")
156
+ .issues("key=JAVA-192")
157
157
  .first
158
158
  .components
159
159
  end
160
160
 
161
- test "field found" do
162
- assert_includes NoAuthJira.new("https://jira.spring.io")
163
- .issues("key=DATAJDBC-480")
161
+ test "description available as field" do
162
+ assert_includes NoAuthJira.new("https://jira.mongodb.org")
163
+ .issues("key=JAVA-192")
164
164
  .first["description"],
165
- "DATACMNS-1639 moved "
165
+ ".files.drop() + .chunks.drop()"
166
166
  end
167
167
 
168
168
  test "field not found" do
169
- assert NoAuthJira.new("https://jira.spring.io")
170
- .issues("key=DATAJDBC-480")
171
- .first["absent field"]
172
- .blank?
169
+ assert_predicate NoAuthJira.new("https://jira.mongodb.org")
170
+ .issues("key=JAVA-150")
171
+ .first["absent field"], :blank?
173
172
  end
174
173
 
175
174
  test "labels found" do
176
- assert_includes NoAuthJira.new("https://jira.spring.io")
177
- .issues("key=XD-3766")
175
+ assert_includes NoAuthJira.new("https://jira.mongodb.org")
176
+ .issues("key=JAVA-295")
178
177
  .first
179
178
  .labels,
180
- "Spring"
179
+ "android"
181
180
  end
182
181
 
183
182
  test "bulk search in few iterations" do
184
183
  assert_equal 3,
185
- NoAuthJira.new("https://jira.spring.io")
186
- .issues("key>DATAJDBC-500 and key < DATAJDBC-504", max_results: 1)
184
+ NoAuthJira.new("https://jira.mongodb.org")
185
+ .issues("key>JAVA-150 and key < JAVA-154", max_results: 1)
187
186
  .size
188
187
  end
189
188
 
@@ -191,23 +190,23 @@ module Lazylead
191
190
  refute_empty Jira.new(
192
191
  "username" => nil,
193
192
  "password" => nil,
194
- "site" => "https://jira.spring.io",
193
+ "site" => "https://jira.mongodb.org",
195
194
  "context_path" => ""
196
- ).issues("key=DATAJDBC-480")
195
+ ).issues("key=JAVA-150")
197
196
  end
198
197
 
199
198
  test "sprint is found" do
200
- assert_equal "Sprint 68",
201
- NoAuthJira.new("https://jira.spring.io")
202
- .issues("key=XD-3744", fields: ["customfield_10480"])
199
+ assert_equal "Java Sprint 25",
200
+ NoAuthJira.new("https://jira.mongodb.org")
201
+ .issues("key=JAVA-192", fields: ["customfield_10557"])
203
202
  .first
204
- .sprint("customfield_10480")
203
+ .sprint("customfield_10557")
205
204
  end
206
205
 
207
206
  test "bulk search in few iterations with limit" do
208
207
  assert_equal 3,
209
- NoAuthJira.new("https://jira.spring.io")
210
- .issues("key > DATAJDBC-500", max_results: 1, "limit" => 3)
208
+ NoAuthJira.new("https://jira.mongodb.org")
209
+ .issues("key > JAVA-150", max_results: 1, "limit" => 3)
211
210
  .size
212
211
  end
213
212
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 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"),
@@ -35,7 +35,7 @@ module Lazylead
35
35
  test "detect affected build" do
36
36
  Lazylead::Smtp.new.enable
37
37
  Task::Accuracy.new.run(
38
- NoAuthJira.new("https://jira.spring.io"),
38
+ NoAuthJira.new("https://jira.mongodb.org"),
39
39
  Postman.new,
40
40
  Opts.new(
41
41
  "from" => "ll@fake.com",
@@ -54,14 +54,14 @@ module Lazylead
54
54
  "90-100" => "https://meme.com?id=wow.gif"
55
55
  }.to_json.to_s,
56
56
  "docs" => "https://github.com/dgroup/lazylead/blob/master/.github/ISSUE_TEMPLATE/bug_report.md",
57
- "jql" => "key in (DATAJDBC-490, DATAJDBC-492, DATAJDBC-493)",
57
+ "jql" => "key=JAVA-151",
58
58
  "max_results" => 200,
59
59
  "subject" => "[LL] Raised tickets",
60
60
  "template" => "lib/messages/accuracy.erb"
61
61
  )
62
62
  )
63
63
  assert_email "[LL] Raised tickets",
64
- "DATAJDBC-493", "0.5", "100%", "MyeongHyeonLee", "Deadlock occurs"
64
+ "JAVA-151", "0.5", "100%", "Tsz Ming Wong", "Dot allowed in key names"
65
65
  end
66
66
 
67
67
  test "construct accuracy from orm" do
@@ -79,7 +79,7 @@ module Lazylead
79
79
  Lazylead::Smtp.new.enable
80
80
  assert_equal 1,
81
81
  Task::Accuracy.new.run(
82
- NoAuthJira.new("https://jira.spring.io"),
82
+ NoAuthJira.new("https://jira.mongodb.org"),
83
83
  Postman.new,
84
84
  Opts.new(
85
85
  "from" => "ll@fake.com",
@@ -90,7 +90,7 @@ module Lazylead
90
90
  "0" => "#FF4F33",
91
91
  "57" => "#19DD1E"
92
92
  }.to_json.to_s,
93
- "jql" => "key > DATAJDBC-490",
93
+ "jql" => "key > JAVA-500",
94
94
  "limit" => "1",
95
95
  "subject" => "[LL] Raised tickets",
96
96
  "template" => "lib/messages/accuracy.erb"
@@ -101,7 +101,7 @@ module Lazylead
101
101
  test "score is correct" do
102
102
  Lazylead::Smtp.new.enable
103
103
  Task::Accuracy.new.run(
104
- NoAuthJira.new("https://jira.spring.io"),
104
+ NoAuthJira.new("https://jira.mongodb.org"),
105
105
  Postman.new,
106
106
  Opts.new(
107
107
  "from" => "ll@fake.com",
@@ -113,14 +113,14 @@ module Lazylead
113
113
  "30" => "#FEC15E",
114
114
  "50" => "#19DD1E"
115
115
  }.to_json.to_s,
116
- "jql" => "key=DATAMONGO-1532",
116
+ "jql" => "key=JAVA-4344",
117
117
  "silent" => "true",
118
- "subject" => "[LL] Check DATAMONGO-1532",
118
+ "subject" => "[LL] Check JAVA-4344",
119
119
  "template" => "lib/messages/accuracy.erb"
120
120
  )
121
121
  )
122
- assert_email "[LL] Check DATAMONGO-1532",
123
- "DATAMONGO-1532", "3", "42.86%"
122
+ assert_email "[LL] Check JAVA-4344",
123
+ "JAVA-4344", "3", "42.86%"
124
124
  end
125
125
  end
126
126
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 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-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 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"),
@@ -35,14 +35,14 @@ module Lazylead
35
35
  end
36
36
 
37
37
  def matches?(attach)
38
- "ConfigServerLogWithException.txt".eql? attach.attrs["filename"]
38
+ "Main.java".eql? attach.attrs["filename"]
39
39
  end
40
40
  end
41
41
 
42
42
  test "attachment is present" do
43
43
  assert Txt.new.passed(
44
- NoAuthJira.new("https://jira.spring.io")
45
- .issues("key=XD-3761", fields: ["attachment"])
44
+ NoAuthJira.new("https://jira.mongodb.org")
45
+ .issues("key=JAVA-8", fields: ["attachment"])
46
46
  .first
47
47
  )
48
48
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 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-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 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-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 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-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 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-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 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-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 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,34 +34,34 @@ module Lazylead
34
34
  # In current tests the grid label is 'PullRequest'.
35
35
  # The default grid labels are 0%, 10%, 20%, etc., the reason why
36
36
  # 'PullRequest' label is used here as we don't have 0%, 10%, etc.
37
- # on https://jira.spring.io.
37
+ # on https://jira.mongodb.org.
38
38
  test "grid label found" do
39
- assert Labels.new(
40
- NoAuthJira.new("https://jira.spring.io").issues("key=XD-3725").first,
41
- Opts.new("grid" => "PullRequest, ,")
42
- ).exists?
39
+ assert_predicate Labels.new(
40
+ NoAuthJira.new("https://jira.mongodb.org").issues("key=JAVA-295").first,
41
+ Opts.new("grid" => "android, ,")
42
+ ), :exists?
43
43
  end
44
44
 
45
45
  test "grid label set by ll" do
46
- assert Labels.new(
47
- NoAuthJira.new("https://jira.spring.io")
48
- .issues("key=XD-3725", expand: "changelog")
46
+ assert_predicate Labels.new(
47
+ NoAuthJira.new("https://jira.mongodb.org")
48
+ .issues("key=JAVA-4190", expand: "changelog")
49
49
  .first,
50
- Opts.new("grid" => "PullRequest", "author" => "grussell")
51
- ).valid?
50
+ Opts.new("grid" => "QP-priority", "author" => "JIRAUSER1263031")
51
+ ), :valid?
52
52
  end
53
53
 
54
54
  test "email notification" do
55
55
  Lazylead::Smtp.new.enable
56
56
  Lazylead::Task::OnlyLL.new.run(
57
- NoAuthJira.new("https://jira.spring.io"),
57
+ NoAuthJira.new("https://jira.mongodb.org"),
58
58
  Postman.new,
59
59
  Opts.new(
60
60
  "from" => "ll@fake.com",
61
61
  "to" => "lead@fake.com",
62
- "grid" => "PullRequest",
62
+ "grid" => "android",
63
63
  "author" => "LL",
64
- "jql" => "key=XD-3725",
64
+ "jql" => "key=JAVA-295",
65
65
  "max_results" => 200,
66
66
  "subject" => "[LL] Only",
67
67
  "fields" => "priority,summary,reporter,labels",
@@ -69,18 +69,18 @@ module Lazylead
69
69
  )
70
70
  )
71
71
  assert_email "[LL] Only",
72
- "XD-3725", "Blocker", "EmbeddedHeadersMessageConverter"
72
+ "JAVA-295", "Major - P3", "Support Android platform"
73
73
  end
74
74
 
75
- test "detect score" do
76
- assert_equal "PullRequest",
75
+ test "detect score label" do
76
+ assert_equal "QP-priority",
77
77
  Labels.new(
78
- NoAuthJira.new("https://jira.spring.io")
79
- .issues("key=XD-3725", expand: "changelog")
78
+ NoAuthJira.new("https://jira.mongodb.org")
79
+ .issues("key=JAVA-4190", expand: "changelog")
80
80
  .first,
81
81
  Opts.new(
82
- "grid" => "PullRequest",
83
- "author" => "grussell"
82
+ "grid" => "QP-priority",
83
+ "author" => "JIRAUSER1263031"
84
84
  )
85
85
  ).score
86
86
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 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-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 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"),
@@ -32,7 +32,10 @@ module Lazylead
32
32
  assert Records.new.passed(
33
33
  OpenStruct.new(
34
34
  attachments: [
35
- OpenStruct.new(attrs: { "filename" => "failed case 1.mp4" })
35
+ OpenStruct.new(attrs: {
36
+ "filename" => "failed case 1.mp4",
37
+ "size" => 6 * 1024
38
+ })
36
39
  ]
37
40
  )
38
41
  )
@@ -42,7 +45,10 @@ module Lazylead
42
45
  assert Records.new.passed(
43
46
  OpenStruct.new(
44
47
  attachments: [
45
- OpenStruct.new(attrs: { "filename" => "failed case 2.avi" })
48
+ OpenStruct.new(attrs: {
49
+ "filename" => "failed case 2.avi",
50
+ "size" => 6 * 1024
51
+ })
46
52
  ]
47
53
  )
48
54
  )
@@ -52,7 +58,10 @@ module Lazylead
52
58
  refute Records.new.passed(
53
59
  OpenStruct.new(
54
60
  attachments: [
55
- OpenStruct.new(attrs: { "filename" => "failed case 2.txt" })
61
+ OpenStruct.new(attrs: {
62
+ "filename" => "failed case 2.txt",
63
+ "size" => 6 * 1024
64
+ })
56
65
  ]
57
66
  )
58
67
  )
@@ -62,25 +71,39 @@ module Lazylead
62
71
  assert Records.new.passed(
63
72
  OpenStruct.new(
64
73
  attachments: [
65
- OpenStruct.new(
66
- attrs: {
67
- "filename" => "snapshot.png",
68
- "mimeType" => "image/gif"
69
- }
70
- )
74
+ OpenStruct.new(attrs: {
75
+ "filename" => "snapshot.png",
76
+ "mimeType" => "image/gif",
77
+ "size" => 6 * 1024
78
+ })
71
79
  ]
72
80
  )
73
81
  )
74
82
  end
75
83
 
76
84
  test "mime type is xlsx" do
85
+ refute Records.new.passed(
86
+ OpenStruct.new(
87
+ attachments: [
88
+ OpenStruct.new(attrs: {
89
+ "filename" => "snapshot.xlsx",
90
+ "mimeType" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
91
+ "size" => 6 * 1024
92
+ })
93
+ ]
94
+ )
95
+ )
96
+ end
97
+
98
+ test "empty gif" do
77
99
  refute Records.new.passed(
78
100
  OpenStruct.new(
79
101
  attachments: [
80
102
  OpenStruct.new(
81
103
  attrs: {
82
- "filename" => "snapshot.xlsx",
83
- "mimeType" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
104
+ "filename" => "steps.gif",
105
+ "mimeType" => "image/gif",
106
+ "size" => "0"
84
107
  }
85
108
  )
86
109
  ]
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 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"),
@@ -79,10 +79,10 @@ module Lazylead
79
79
  end
80
80
 
81
81
  test "detect non-system reporter" do
82
- assert_equal "grussell",
82
+ assert_equal "tszming",
83
83
  Score.new(
84
- NoAuthJira.new("https://jira.spring.io")
85
- .issues("key=INT-4116", expand: "changelog")
84
+ NoAuthJira.new("https://jira.mongodb.org")
85
+ .issues("key=JAVA-151", expand: "changelog")
86
86
  .first,
87
87
  Opts.new("system-users" => "abilan")
88
88
  ).reporter
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 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"),
@@ -47,8 +47,8 @@ module Lazylead
47
47
 
48
48
  test "issue has several .png attachments mentioned using !xxx|thumbnail! option" do
49
49
  assert Screenshots.new.passed(
50
- NoAuthJira.new("https://jira.spring.io")
51
- .issues("key=SPR-15729", fields: %w[attachment description])
50
+ NoAuthJira.new("https://jira.mongodb.org")
51
+ .issues("key=JAVA-4903", fields: %w[attachment description])
52
52
  .first
53
53
  )
54
54
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 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-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 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-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 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"),