Skip to content

Commit

Permalink
remove past 2 changes, Was not able to remove in previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rahat2134 committed Nov 7, 2024
1 parent 01c705c commit 914a151
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 36 deletions.
14 changes: 2 additions & 12 deletions main/api/src/mill/api/PathRef.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,14 @@ object PathRef {

def normalizePath(path: os.Path, isTest: Boolean = false): String = {
if (serializationContext.get() || isTest) {

if (sys.env.contains("GITHUB_WORKSPACE")) {
println(s"Debug: GITHUB_WORKSPACE detected: ${sys.env("GITHUB_WORKSPACE")}")
println(s"Debug: Input path: $path")
}

// First normalize the path for worker.json files
if (path.toString().contains("/test/test.dest/")) {
return path.toString()
}
val normalizedPath = NonDeterministicFiles.normalizeWorkerJson(path)

val workspaceRoot = sys.env.get("GITHUB_WORKSPACE") match {
case Some(workspace) if path.toString().startsWith(workspace) =>
os.Path(workspace)
case _ if isTest => testUserHome / "projects" / "myproject"
case _ => os.Path(WorkspaceRoot.workspaceRoot.toIO)
}
val workspaceRoot = if (isTest) testUserHome / "projects" / "myproject"
else os.Path(WorkspaceRoot.workspaceRoot.toIO)

val coursierCache = if (isTest) Some(testUserHome / ".coursier" / "cache")
else sys.env.get("COURSIER_CACHE").map(os.Path(_))
Expand Down
26 changes: 2 additions & 24 deletions testrunner/src/mill/testrunner/TestRunnerUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ import scala.jdk.CollectionConverters.IteratorHasAsScala
ctx: Ctx.Log with Ctx.Home
): (String, Iterator[TestResult]) = {
val events = new ConcurrentLinkedQueue[Event]()
var hasFailures = false

val doneMessage = {
val taskQueue = tasks.to(mutable.Queue)
while (taskQueue.nonEmpty) {
Expand All @@ -143,18 +141,6 @@ import scala.jdk.CollectionConverters.IteratorHasAsScala
def handle(event: Event) = {
testReporter.logStart(event)
events.add(event)

// Fixed throwable handling
if (event.status() == Status.Failure) {
hasFailures = true
val throwableMsg =
if (event.throwable().isDefined) event.throwable().get().getMessage
else ""
ctx.log.debug(
s"Test failure detected: ${event.fullyQualifiedName()} - $throwableMsg"
)
}

testReporter.logFinish(event)
}
},
Expand All @@ -179,12 +165,9 @@ import scala.jdk.CollectionConverters.IteratorHasAsScala
ctx.log.outputStream.println(doneMessage)
}

ctx.log.debug(s"Test execution completed. Total events: ${events.size()}")

val results = for (e <- events.iterator().asScala) yield {
ctx.log.debug(s"Test result: ${e.fullyQualifiedName()} - Status: ${e.status()}")

val ex = if (e.throwable().isDefined) Some(e.throwable().get()) else None
val ex =
if (e.throwable().isDefined) Some(e.throwable().get) else None
mill.testrunner.TestResult(
e.fullyQualifiedName(),
e.selector() match {
Expand All @@ -201,11 +184,6 @@ import scala.jdk.CollectionConverters.IteratorHasAsScala
ex.map(_.getStackTrace.toIndexedSeq)
)
}

if (hasFailures) {
ctx.log.debug("Test failures detected, ensuring proper result propagation")
}

(doneMessage, results)
}

Expand Down

0 comments on commit 914a151

Please sign in to comment.