Skip to content

Commit

Permalink
JPERF-273: Check Jira HTML when upgrade fails
Browse files Browse the repository at this point in the history
  • Loading branch information
dagguh committed Jun 25, 2021
1 parent 961107c commit 27b9bc4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.atlassian.performance.tools.infrastructure.api.jira.report.FileListin
import com.atlassian.performance.tools.infrastructure.api.jira.report.Reports
import com.atlassian.performance.tools.infrastructure.api.jira.start.StartedJira
import com.atlassian.performance.tools.infrastructure.api.jvm.ThreadDump
import com.atlassian.performance.tools.infrastructure.jira.report.JiraLandingPage
import com.atlassian.performance.tools.ssh.api.SshConnection
import java.net.URI
import java.time.Duration
Expand Down Expand Up @@ -70,6 +71,7 @@ class RestUpgrade(
if (deadline < Instant.now()) {
reports.add(JiraLogs().report(jira.installed), jira)
reports.add(FileListing("thread-dumps/*"), jira)
reports.add(JiraLandingPage(jira), jira)
throw Exception("$upgradesEndpoint failed to get out of $statusQuo status within $timeout")
}
threadDump.gather(ssh, "thread-dumps")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.atlassian.performance.tools.infrastructure.jira.report

import com.atlassian.performance.tools.infrastructure.api.jira.report.Report
import com.atlassian.performance.tools.infrastructure.api.jira.start.StartedJira
import com.atlassian.performance.tools.infrastructure.api.os.Ubuntu
import com.atlassian.performance.tools.ssh.api.SshConnection

internal class JiraLandingPage(
private val started: StartedJira
) : Report {
override fun locate(ssh: SshConnection): List<String> {
Ubuntu().install(ssh, listOf("curl"))
val landingPage = started.installed.http.addressPrivately()
val html = "jira-landing-page.html"
val headers = "jira-landing-page-headers.txt"
ssh.execute("curl $landingPage --location --output $html --dump-header $headers --silent")
return listOf(html, headers)
}
}

0 comments on commit 27b9bc4

Please sign in to comment.