Skip to content

Commit

Permalink
remove warning for 404ing index.html - it's too flaky
Browse files Browse the repository at this point in the history
  • Loading branch information
aSemy committed Nov 30, 2023
1 parent 3c114b8 commit e85a9d9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,6 @@ constructor(
val link = URI(serverUri).appendPath(indexHtmlPath)

logger.lifecycle("Generated Dokka HTML publication: $link")

val statusCode = httpGet(link).statusCode()
if (statusCode !in 200..299) {
logger.warn(
"Warning: $link returned unsuccessful status code $statusCode. " +
"Does the index.html file exist, or is the server misconfigured?"
)
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,11 @@ class LogHtmlPublicationLinkTaskTest : FunSpec({
val serverPort = server.resolvedConnectors().first().port

val validServerUri = "http://localhost:$serverPort"
val invalidServerUri = "http://localhost:$serverPort/wrong/path/"
val validServerUriParam = `-P`("testServerUri=$validServerUri")
val invalidServerUriParam = `-P`("testServerUri=$invalidServerUri")

context("and a Kotlin project") {
val project = initDokkatooProject()

context("when generate task is run with incorrect server URI") {
project.runner
.addArguments(
"clean",
"dokkatooGeneratePublicationHtml",
"--stacktrace",
"--info",
invalidServerUriParam,
)
.forwardOutput()
.build {
test("expect project builds successfully") {
output shouldContain "BUILD SUCCESSFUL"
}
test("LogHtmlPublicationLinkTask should run") {
shouldHaveTasksWithAnyOutcome(
":logLinkDokkatooGeneratePublicationHtml" to listOf(SUCCESS)
)
}
test("expect invalid link is logged, with warning") {
output shouldContain "Generated Dokka HTML publication: $invalidServerUri"
output shouldContain "Warning: ${invalidServerUri}log-html-publication-link-task/build/dokka/html/index.html returned unsuccessful status code 404"
output shouldContain "Does the index.html file exist, or is the server misconfigured?"
}
}
}

context("when generate task is run with correct server URI") {
project.runner
.addArguments(
Expand Down

0 comments on commit e85a9d9

Please sign in to comment.