Skip to content

Commit

Permalink
#671: We have to migrate to https://jira.mongodb.org for E2E testing …
Browse files Browse the repository at this point in the history
…purposes
  • Loading branch information
dgroup committed Aug 5, 2023
1 parent dabe0db commit bc607c4
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 61 deletions.
102 changes: 51 additions & 51 deletions test/lazylead/system/jira_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
module Lazylead
class JiraTest < Lazylead::Test
test "found issue by id" do
assert_equal "DATAJDBC-480",
NoAuthJira.new("https://jira.spring.io")
.issues("key in ('DATAJDBC-480')")
assert_equal "JAVA-150",
NoAuthJira.new("https://jira.mongodb.org")
.issues("key in ('JAVA-150')")
.first
.key
end
Expand All @@ -46,79 +46,79 @@ class JiraTest < Lazylead::Test
vcs4sql: "upgrades/sqlite",
testdata: true
)
assert_equal "DATAJDBC-500",
assert_equal "JAVA-150",
ORM::Task.find(4)
.system
.connect
.issues("key in ('DATAJDBC-500')")
.issues("key in ('JAVA-150')")
.first
.key,
"Id mismatch for https://jira.spring.io/browse/DATAJDBC-500"
"Id mismatch for https://jira.mongodb.org/browse/JAVA-150"
end

test "group by assignee" do
assert_equal 2,
NoAuthJira.new("https://jira.spring.io")
.issues("filter=16743")
NoAuthJira.new("https://jira.mongodb.org")
.issues("filter=46202")
.group_by(&:assignee)
.min_by { |a| a.first.id }
.length,
"Two issues found on remote Jira instance using filter"
end

test "issue reporter fetched successfully" do
assert_equal "Mark Paluch",
NoAuthJira.new("https://jira.spring.io")
.issues("key in ('DATAJDBC-480')")
assert_equal "Joseph Wang",
NoAuthJira.new("https://jira.mongodb.org")
.issues("key in ('JAVA-150')")
.first
.reporter
.name
end

test "issue url fetched successfully" do
assert_equal "https://jira.spring.io/browse/DATAJDBC-480",
NoAuthJira.new("https://jira.spring.io")
.issues("key in ('DATAJDBC-480')")
assert_equal "https://jira.mongodb.org/browse/JAVA-150",
NoAuthJira.new("https://jira.mongodb.org")
.issues("key in ('JAVA-150')")
.first
.url
end

test "issue history found" do
greater_or_eq 8,
NoAuthJira.new("https://jira.spring.io")
.issues("key='DATAJDBC-480'", expand: "changelog")
greater_or_eq 10,
NoAuthJira.new("https://jira.mongodb.org")
.issues("key='JAVA-150'", expand: "changelog")
.first
.history
.size
end

test "issue history not found" do
assert_empty NoAuthJira.new("https://jira.spring.io")
.issues("key='DATAJDBC-480'")
assert_empty NoAuthJira.new("https://jira.mongodb.org")
.issues("key='JAVA-150'")
.first
.history
end

test "2nd issue history item is correct" do
assert_equal "396918",
NoAuthJira.new("https://jira.spring.io")
.issues("key='DATAJDBC-480'", expand: "changelog")
assert_equal "24893",
NoAuthJira.new("https://jira.mongodb.org")
.issues("key='JAVA-150'", expand: "changelog")
.first
.history[2]["id"]
end

test "issue has expected status" do
assert_equal "Closed",
NoAuthJira.new("https://jira.spring.io")
.issues("key='DATAJDBC-480'")
NoAuthJira.new("https://jira.mongodb.org")
.issues("key='JAVA-150'")
.first
.status
end

test "issue has 1 field" do
assert_equal 1,
NoAuthJira.new("https://jira.spring.io")
.issues("key='DATAJDBC-480'", fields: ["summary"])
NoAuthJira.new("https://jira.mongodb.org")
.issues("key='JAVA-150'", fields: ["summary"])
.first
.fields
.size
Expand All @@ -143,70 +143,70 @@ def save!(body)
end

test "description is correct" do
assert_words ["DATACMNS-1639 moved entity instantiators"],
NoAuthJira.new("https://jira.spring.io")
.issues("key=DATAJDBC-480")
assert_words ["We've multiple colos"],
NoAuthJira.new("https://jira.mongodb.org")
.issues("key=JAVA-150")
.first
.description
end

test "component is correct" do
assert_equal ["Stream Module"],
NoAuthJira.new("https://jira.spring.io")
.issues("key=XD-3766")
assert_equal ["GridFS"],
NoAuthJira.new("https://jira.mongodb.org")
.issues("key=JAVA-192")
.first
.components
end

test "field found" do
assert_includes NoAuthJira.new("https://jira.spring.io")
.issues("key=DATAJDBC-480")
test "description available as field" do
assert_includes NoAuthJira.new("https://jira.mongodb.org")
.issues("key=JAVA-192")
.first["description"],
"DATACMNS-1639 moved "
".files.drop() + .chunks.drop()"
end

test "field not found" do
assert_predicate NoAuthJira.new("https://jira.spring.io")
.issues("key=DATAJDBC-480")
assert_predicate NoAuthJira.new("https://jira.mongodb.org")
.issues("key=JAVA-150")
.first["absent field"], :blank?
end

test "labels found" do
assert_includes NoAuthJira.new("https://jira.spring.io")
.issues("key=XD-3766")
assert_includes NoAuthJira.new("https://jira.mongodb.org")
.issues("key=JAVA-295")
.first
.labels,
"Spring"
"android"
end

test "bulk search in few iterations" do
assert_equal 3,
NoAuthJira.new("https://jira.spring.io")
.issues("key>DATAJDBC-500 and key < DATAJDBC-504", max_results: 1)
NoAuthJira.new("https://jira.mongodb.org")
.issues("key>JAVA-150 and key < JAVA-154", max_results: 1)
.size
end

test "connected based on string properties" do
refute_empty Jira.new(
"username" => nil,
"password" => nil,
"site" => "https://jira.spring.io",
"site" => "https://jira.mongodb.org",
"context_path" => ""
).issues("key=DATAJDBC-480")
).issues("key=JAVA-150")
end

test "sprint is found" do
assert_equal "Sprint 68",
NoAuthJira.new("https://jira.spring.io")
.issues("key=XD-3744", fields: ["customfield_10480"])
assert_equal "Java Sprint 25",
NoAuthJira.new("https://jira.mongodb.org")
.issues("key=JAVA-192", fields: ["customfield_10557"])
.first
.sprint("customfield_10480")
.sprint("customfield_10557")
end

test "bulk search in few iterations with limit" do
assert_equal 3,
NoAuthJira.new("https://jira.spring.io")
.issues("key > DATAJDBC-500", max_results: 1, "limit" => 3)
NoAuthJira.new("https://jira.mongodb.org")
.issues("key > JAVA-150", max_results: 1, "limit" => 3)
.size
end
end
Expand Down
6 changes: 3 additions & 3 deletions test/lazylead/task/accuracy/attachment_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ def initialize
end

def matches?(attach)
"ConfigServerLogWithException.txt".eql? attach.attrs["filename"]
"Main.java".eql? attach.attrs["filename"]
end
end

test "attachment is present" do
assert Txt.new.passed(
NoAuthJira.new("https://jira.spring.io")
.issues("key=XD-3761", fields: ["attachment"])
NoAuthJira.new("https://jira.mongodb.org")
.issues("key=JAVA-8", fields: ["attachment"])
.first
)
end
Expand Down
8 changes: 4 additions & 4 deletions test/lazylead/task/micromanager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ class MicromanagerTest < Lazylead::Test
test "alert in case duedate changed by not authorized person" do
Lazylead::Smtp.new.enable
Task::Micromanager.new.run(
NoAuthJira.new("https://jira.spring.io"),
NoAuthJira.new("https://jira.mongodb.org"),
Postman.new,
Opts.new(
"to" => "lead@company.com",
"from" => "ll@company.com",
"jql" => "key in ('STS-3599','SPR-6541') and duedate is not empty",
"jql" => "duedate is not EMPTY and key in (DOCS-194, DOCS-144, DOCS-143)",
"fields" => "assignee,duedate,priority,created,summary,reporter",
"allowed" => "tom,mike,bob",
"allowed" => "matulef,mike,bob",
"period" => "86400",
"now" => "2009-12-10T00:04:00.000+0000",
"subject" => "DD: How dare you?",
"template" => "lib/messages/illegal_duedate_change.erb"
)
)
assert_email "DD: How dare you?",
"SPR-6541", "Major", "(kdonald)", "2009-12-10", "Spring's Maven Central", "tom,mike,bob"
"DOCS-144", "Major - P3", "2012-03-01", "New Documentation Review: Glossary", "matulef,mike,bob"
end

test "since for past 1 min" do
Expand Down
6 changes: 3 additions & 3 deletions test/lazylead/task/missing_comment_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ class MissingCommentTest < Lazylead::Test
test "alert in case missing comment" do
Lazylead::Smtp.new.enable
Task::MissingComment.new.run(
NoAuthJira.new("https://jira.spring.io"),
NoAuthJira.new("https://jira.mongodb.org"),
Postman.new,
Opts.new(
"to" => "lead@company.com",
"addressee" => "Tom",
"from" => "ll@company.com",
"jql" => "key=DATAJDBC-523",
"jql" => "key=JAVA-65",
"text" => "ftp.com/demo.avi",
"details" => "reference to <code>ftp.com/demo.avi</code>",
"subject" => "Expected ftp link is missing",
Expand All @@ -50,7 +50,7 @@ class MissingCommentTest < Lazylead::Test
)
)
assert_email "Expected ftp link is missing",
"DATAJDBC-523", "Major", "Mark Paluch", "https://github.com/spring-projects/spring-data-jdbc/commit/aadbb667ed1d61139d5ac51a06eb3dd1b39316db#diff-510a5041bb8a0575e97fedf105606b83R130"
"JAVA-65", "Minor - P4", "http://github.com/mongodb/mongo-java-driver/commit/729fc494e5305d362eea95b01c381f2a7daf2652"
end
end
end

0 comments on commit bc607c4

Please sign in to comment.