Console output (e.g., println) not redirected to sbt client
See original GitHub issueWas: Logs of test
not redirected to sbt client
Reproduction Steps
# project/build.properties
sbt.version = 1.5.5
// plugins.sbt
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.0")
// build.sbt
lazy val example = project.in(file("."))
.enablePlugins(ScalaJSPlugin)
.settings(
scalaVersion := "3.0.2",
libraryDependencies ++= Seq(
"org.scalameta" %%% "munit" % "0.7.29" % Test
),
Test / scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule))
)
// src/test/scala/example/ExampleTest.scala
package example
class ExampleTest extends munit.FunSuite {
test("test 1") {
assertEquals("123".size, 3)
}
}
- Start sbt client with
sbt -client
- Run
test
The output is:
sbt:example> test
[info] Passed: Total 1, Failed 0, Errors 0, Passed 1
[success] Total time: 1 s, completed Sep 29, 2021 10:37:06 AM
Expected output
sbt:example> test
example.ExampleTest:
+ test 1 0.00s
[info] Passed: Total 1, Failed 0, Errors 0, Passed 1
[success] Total time: 0 s, completed Sep 29, 2021 10:37:16 AM
Notes
We probably need to investigate the code in the sbt-scalajs
to determine if the cause of the bug is there or in sbt.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (10 by maintainers)
Top Results From Across the Web
Strange issue with SBT, println, and scala console application
It seems like it's stacking up the print() statements and only displaying them when it runs a different command. If I use println()...
Read more >Remove forced background log · Issue #8 · sbt/sbt-core-next
My guess is System.err (used BackgroundRunPlugin) is replaced to another one which redirects the error message to java.util.loging.Logger. And ...
Read more >Why does the ">" command in a Windows console not redirect ...
I am trying to build a Scala project with sbt, so I run a command: sbt clean test ...
Read more >sbt Reference Manual — Combined Pages
Running sbt with no command line arguments starts sbt shell. sbt shell has a command prompt (with tab completion and history!). For example,...
Read more >Scala: How to handle the STDOUT and STDERR of external ...
Solution. The simplest way to do this is to run your commands as shown in previous recipes, and then capture the output with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would like to point out that both the
ExternalJSEnv
and theSeleniumJSEnv
behave correctly according to the specification of the interface: https://github.com/scala-js/scala-js-js-envs/blob/f0dc9bdcdeb5eb9b40032df3e2d1528b83b457db/js-envs/src/main/scala/org/scalajs/jsenv/RunConfig.scala#L31-L32More seriously: Since we actually won’t need different behavior from any JSEnv (we’ll always use
onOutputStream
), we might simply not touch it.I agree that #4580 is the cleaner solution and it seems that we can actually make it work. So we probably want to go with that one.