Skip to content

Commit

Permalink
Add testcase for publishing without docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostbuster91 committed Feb 18, 2025
1 parent 511084b commit 917fcdb
Showing 1 changed file with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,52 @@ abstract class PublishLocalTestDefinitions extends ScalaCliSuite with TestScalaV
}
}

test("publish local without docs") {
val expectedFiles = {
val modName = s"${PublishTestInputs.testName}_$testedPublishedScalaVersion"
val base = os.rel / PublishTestInputs.testOrg / modName / testPublishVersion
val baseFiles = Seq(
base / "jars" / s"$modName.jar",
base / "srcs" / s"$modName-sources.jar",
base / "poms" / s"$modName.pom",
base / "ivys" / "ivy.xml"
)
baseFiles
.flatMap { f =>
val md5 = f / os.up / s"${f.last}.md5"
val sha1 = f / os.up / s"${f.last}.sha1"
Seq(f, md5, sha1)
}
.toSet
}

PublishTestInputs.inputs()
.fromRoot { root =>
os.proc(
TestUtil.cli,
"--power",
"publish",
"local",
".",
"--ivy2-home",
os.rel / "ivy2",
extraOptions,
"--doc=false"
)
.call(cwd = root)
val ivy2Local = root / "ivy2" / "local"
val foundFiles = os.walk(ivy2Local)
.filter(os.isFile(_))
.map(_.relativeTo(ivy2Local))
.toSet
val missingFiles = expectedFiles -- foundFiles
val unexpectedFiles = foundFiles -- expectedFiles
if (missingFiles.nonEmpty)
pprint.err.log(missingFiles)
if (unexpectedFiles.nonEmpty)
pprint.err.log(unexpectedFiles)
expect(missingFiles.isEmpty)
expect(unexpectedFiles.isEmpty)
}
}
}

0 comments on commit 917fcdb

Please sign in to comment.