Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignored tests doesn't produce output on Scala.js #549

Closed
FabioPinheiro opened this issue Jul 8, 2022 · 5 comments · Fixed by #766
Closed

ignored tests doesn't produce output on Scala.js #549

FabioPinheiro opened this issue Jul 8, 2022 · 5 comments · Fixed by #766

Comments

@FabioPinheiro
Copy link

FabioPinheiro commented Jul 8, 2022

On a crossProject(JSPlatform, JVMPlatform) my ignored tests doesn't produce output on Scala.js
scalaVersion := "3.1.3",
munit = "1.0.0-M4" (same on 1.0.0-M4)

class MyTest extends FunSuite {
  test("this_is_a_ignored_test".ignored) {}
}

Output when running the tests on JVM:

fmgp.MyTest:
==> i fmgp.crypto.ECKeySuite.this_is_a_ignored_test ignored 0.0s
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0, Ignored 1

Output when running the tests on JS:

fmgp.MyTest:
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0, Ignored 1

Can someone try to reproduce to double check? Or should I create a minimized project?

@armanbilge
Copy link
Contributor

armanbilge commented Jul 17, 2022

Thanks for reporting, I was able to reproduce with scala-cli.

//> using scala "3.1.3"
//> using lib "org.scalameta::munit::1.0.0-M6"

import munit._

class MySuite extends FunSuite {
  test("this_is_a_ignored_test".ignore) {}
}
$ scala-cli test bug.scala 
Picked up JAVA_TOOL_OPTIONS:  -Xmx3435m
MySuite:
==> i MySuite.this_is_a_ignored_test ignored 0.001s
$ scala-cli test --js bug.scala 
MySuite:

@armanbilge
Copy link
Contributor

I was also able to replicate on Scala Native.

$ scala-cli test --native bug.scala 
MySuite:

So it's probably a bug in here:
https://github.com/scalameta/munit/tree/main/munit/non-jvm/

Which I understand is a re-implementation of the sources here:
https://github.com/scalameta/munit/tree/main/junit-interface

IIRC Olafur had de-duped these sources in the JUnit 5 branch. Actually, I don't think that's specific to JUnit 5. @valencik maybe something to consider before 1.0.0, to reduce the maintenance burden of two separate impls?

@keynmol
Copy link

keynmol commented Apr 15, 2024

I was sent here by @valencik for similar reasons:

import munit.*

class Tst extends FunSuite {
  test("hello") {
    assume(false, "oh noes")
    fail("")
  }
}
> scli test . --dep org.scalameta::munit:0.7.29
Tst:
  + hello 0.016s

> scli test . --dep org.scalameta::munit:1.0.0-M11
Tst:

Outptu differs between major versions.
The output on 1.x makes a bit more sense, as the test is not run at all, but I think the best option would be to properly render test as ignored, and with reason:

Tst:
==> i hello ignored: oh noes

@tgodzik
Copy link
Contributor

tgodzik commented Apr 15, 2024

The output on 1.x makes a bit more sense, as the test is not run at all, but I think the best option would be to properly render test as ignored, and with reason:

Tst:
==> i hello ignored: oh noes

That would probably be the best output yeah.

Would you say it's blocking for 1.0.0? I intend (or try to find someone) to help when possible.

@keynmol
Copy link

keynmol commented Apr 15, 2024

I don't see it as blocking - semantically it does what you'd expect - ignores the tests. Just a matter of rendering. Can always be adjusted later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants