diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 151250e..7d67178 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,7 +20,6 @@ jobs: runs-on: [self-hosted, nix, general, arm64-linux, small] timeout-minutes: 5 env: - IMAGE_REPOSITORY: public.ecr.aws/shopstic RELEASE_VERSION: ${{ github.event.inputs.releaseVersion }} NEXT_VERSION: ${{ github.event.inputs.nextVersion }} steps: diff --git a/toothpick-runner/src/main/scala/dev/toothpick/reporter/TpReporter.scala b/toothpick-runner/src/main/scala/dev/toothpick/reporter/TpReporter.scala index 46bbcfe..efdf892 100644 --- a/toothpick-runner/src/main/scala/dev/toothpick/reporter/TpReporter.scala +++ b/toothpick-runner/src/main/scala/dev/toothpick/reporter/TpReporter.scala @@ -258,6 +258,15 @@ object TpReporter { } } + private def truncateMessage(message: String, length: Int): String = { + if (message.length <= length) { + message + } + else { + message.take(length) + s" ... [${message.length - length} more chars truncated]" + } + } + def reportSuite( uuid: ULID, suite: TpTestSuite, @@ -285,10 +294,14 @@ object TpReporter { } } - def reportNext(maybeTestName: Option[String], outcome: TestOutcome, time: Instant) = { + def reportNext( + maybeTestName: Option[String], + outcome: TestOutcome, + time: Instant + ): ZIO[Any, IllegalStateException, Chunk[TestReport]] = { pendingTests.modify { case test :: tail => - for { + val t: ZIO[Any, IllegalStateException, (Chunk[TestReport], List[TpTest])] = for { startTime <- startTimeRef.getAndSet(time) testOutcome = TestReport( nodeId = test.id, @@ -317,7 +330,20 @@ object TpReporter { out -> tail } - case Nil => ZIO.fail(new IllegalStateException("Received extra test report")) + t + + case Nil => + val suiteName = suite.name + val truncatedOutcome = outcome match { + case TestPassed => outcome + case TestIgnored => outcome + case TestFailed(message, details) => + TestFailed(truncateMessage(message, 2048), truncateMessage(details, 2048)) + } + + zlogger + .warn(s"Received extra test report $suiteName $maybeTestName $truncatedOutcome") + .as(Chunk.empty -> Nil) } }