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 6, 2023
1 parent bc607c4 commit 2c02b98
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 2 additions & 0 deletions lib/lazylead/system/jira.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ def name
end

def email
return @usr["emailAddress"] unless @usr["emailAddress"].nil?
return id if id.include?("@")
@usr["emailAddress"]
end

Expand Down
26 changes: 13 additions & 13 deletions test/lazylead/task/duedate_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ class DuedateTest < Lazylead::Test
test "issues were fetched" do
Smtp.new.enable
Task::AssigneeAlert.new.run(
NoAuthJira.new("https://jira.spring.io"),
NoAuthJira.new("https://jira.mongodb.org"),
Postman.new,
Opts.new(
"from" => "fake@email.com",
"sql" => "filter=16743",
"sql" => "key in (JAVA-151,JAVA-469,JAVA-468,JAVA-500)",
"subject" => "[DD] PDTN!",
"template" => "lib/messages/due_date_expired.erb"
)
)
assert_equal(2, Mail::TestMailer.deliveries.count { |m| m.subject.eql? "[DD] PDTN!" })
greater_or_eq(1, Mail::TestMailer.deliveries.count { |m| m.subject.eql? "[DD] PDTN!" })
end

test "configuration properties merged successfully" do
Expand All @@ -72,45 +72,45 @@ class DuedateTest < Lazylead::Test
test "html msg has ticket details" do
Smtp.new.enable
Task::AssigneeAlert.new.run(
NoAuthJira.new("https://jira.spring.io"),
NoAuthJira.new("https://jira.mongodb.org"),
Postman.new,
Opts.new(
"from" => "fake@email.com",
"sql" => "key in ('STS-3599')",
"sql" => "key=VSCODE-333",
"subject" => "[DD] HMCHT!",
"template" => "lib/messages/due_date_expired.erb"
)
)
assert_email "[DD] HMCHT!",
"STS-3599", "2013-11-08", "Major", "Miles Parker", "Use JavaFX WebView"
"VSCODE-333", "2023-06-28", "Major - P3", "Rhys Howell", "Renew VSCODE automated publishing token"
end

test "send notification about bunch of tickets" do
Smtp.new.enable
Task::Alert.new.run(
NoAuthJira.new("https://jira.spring.io"),
NoAuthJira.new("https://jira.mongodb.org"),
Postman.new,
Opts.new(
"from" => "fake@email.com",
"sql" => "key in ('STS-3599')",
"sql" => "key=DOCS-19",
"subject" => "ALRT: Frozen",
"template" => "lib/messages/due_date_expired.erb",
"to" => "big.boss@example.com",
"addressee" => "Boss"
)
)
assert_email "ALRT: Frozen",
"Hi Boss", "STS-3599", "2013-11-08", "Major", "Miles Parker", "Use JavaFX WebView"
"Hi Boss", "DOCS-19", "2012-09-28", "Major - P3", "Michael Conigliaro", "MongoDB exit code reference"
end

test "cc got notification" do
Smtp.new.enable
Task::Alert.new.run(
NoAuthJira.new("https://jira.spring.io"),
NoAuthJira.new("https://jira.mongodb.org"),
Postman.new,
Opts.new(
"from" => "fake@email.com",
"sql" => "key in ('STS-3599')",
"sql" => "key=JAVA-295",
"subject" => "CC: Watching",
"template" => "lib/messages/due_date_expired.erb",
"to" => "big.boss@example.com",
Expand All @@ -126,11 +126,11 @@ class DuedateTest < Lazylead::Test
test "reporter got alert about his/her tickets with expired DD" do
Smtp.new.enable
Task::ReporterAlert.new.run(
NoAuthJira.new("https://jira.spring.io"),
NoAuthJira.new("https://jira.mongodb.org"),
Postman.new,
Opts.new(
"from" => "fake@email.com",
"sql" => "filter=16743",
"sql" => "key in (JAVA-151,JAVA-469,JAVA-468,JAVA-500)",
"subject" => "DD Expired!",
"template" => "lib/messages/due_date_expired.erb"
)
Expand Down

0 comments on commit 2c02b98

Please sign in to comment.