Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMazur committed Oct 26, 2024
1 parent 03a2ceb commit ad9183a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 22 deletions.
2 changes: 1 addition & 1 deletion project-builder/build-revision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function buildForScalaVersion(){
echo "started" > build-status.txt
# Mill
# We check either for mill boostrap script or one of valid root build files
if [ -f "repo/mill" ] || [ -f "repo/build.mill" ] || [ -f "repo/build.mill.scala"] || [ -f "repo/build.sc"]; then
if [ -f "repo/mill" ] || [ -f "repo/build.mill" ] || [ -f "repo/build.mill.scala" ] || [ -f "repo/build.sc" ]; then
echo "Mill project found: ${isMillProject}"
echo "mill" > $buildToolFile
$scriptDir/mill/prepare-project.sh "$project" repo "$scalaVersion" "$projectConfig"
Expand Down
21 changes: 10 additions & 11 deletions project-builder/mill/MillCommunityBuild.sc
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,9 @@ private def collectCompileResults(evalResult: EvalResult[CompilationResult]): Co

private def collectTestResults(evalResult: EvalResult[Seq[TestResult]]): TestsResult = {
import sbt.testing.Status
val empty = TestsResult(
val default = TestsResult(
status = evalResult.toStatus,
passed = 0,
failed = 0,
ignored = 0,
skipped = 0,
overall = TestStats.empty,
tookMs = evalResult.evalTime
)
evalResult match {
Expand All @@ -352,13 +349,15 @@ private def collectTestResults(evalResult: EvalResult[Seq[TestResult]]): TestsRe

def countOf(selected: Status*) = selected.foldLeft(0)(_ + resultsStatus.getOrElse(_, 0))

empty.copy(
passed = countOf(Status.Success),
failed = countOf(Status.Error, Status.Failure, Status.Canceled),
ignored = countOf(Status.Ignored),
skipped = countOf(Status.Skipped)
default.copy(
overall = TestStats(
passed = countOf(Status.Success),
failed = countOf(Status.Error, Status.Failure, Status.Canceled),
ignored = countOf(Status.Ignored),
skipped = countOf(Status.Skipped)
)
)
case _ => empty.copy(failureContext = evalResult.toBuildError)
case _ => default.copy(failureContext = evalResult.toBuildError)
}
}

Expand Down
2 changes: 0 additions & 2 deletions project-builder/sbt/CommunityBuildPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,6 @@ object CommunityBuildPlugin extends AutoPlugin {
val default = TestsResult(
evalResult.toStatus,
failureContext = evalResult.toBuildError,
overall = TestStats.empty,
byFramework = Map.empty,
tookMs = evalResult.evalTime
)

Expand Down
5 changes: 1 addition & 4 deletions project-builder/scala-cli/build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ import os.CommandResult
testsExecute = TestsResult(
status = testsExecuteResults.toStatus,
failureContext = testsExecuteResults.toBuildError,
passed = 0,
failed = 0,
ignored = 0,
skipped = 0,
overall = TestStats.empty,
tookMs = testsExecuteResults.evalTime
),
publish = publishResult
Expand Down
8 changes: 4 additions & 4 deletions project-builder/shared/CommunityBuildCore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ object Scala3CommunityBuild {
case class TestStats(passed: Int, failed: Int, ignored: Int, skipped: Int){
val total: Int = passed + failed + ignored + skipped
def toJson(inlined: Boolean = false) = {
val raw = s""""passed": ${passed}, "failed": ${failed}, "ignored": ${ignored}, "skipped": ${skipped}", "total": ${total}"""
val raw = s""""passed": ${passed}, "failed": ${failed}, "ignored": ${ignored}, "skipped": ${skipped}, "total": ${total}"""
if (inlined) raw
else s"{$raw}"
}
Expand All @@ -146,10 +146,10 @@ object Scala3CommunityBuild {
}
case class TestsResult(
status: Status,
tookMs: Int,
failureContext: Option[FailureContext] = None,
overall: TestStats,
byFramework: Map[String, TestStats],
tookMs: Int
overall: TestStats = TestStats.empty,
byFramework: Map[String, TestStats] = Map.empty
) extends StepResult {
def toJson = {
val byFrameworkJson = byFramework.toSeq.sortBy(_._1).map{
Expand Down

0 comments on commit ad9183a

Please sign in to comment.