-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
Run tagged ScalaTest tests also runs all others tests (500USD Bounty) #3440
Comments
mill version 0.11.12 have also been tested, the results is the same. |
@Readon It's probably a scam bot, don't click the link, please. |
Thanks, fortunately I do not have account for MediaFire. |
@Readon The issue is really strange since the arguments should be handled by the the test runner which is not part of Mill and they seem to be passed correctly. Stranger is the fact that the |
I did not check the arguments inside mill. is that possible sbt have done some extra ops on this arguments? |
I can reproduce it in the test directory with the bundled mill script. But when I'm trying to reproduce with the current mill build:
It failed to find any tests:
Am I running the correct command? |
Fixes com-lihaoyi#3440 The problem is mill define all the test tasks with `explicitlySpecified` to be `true`. This result this test always be included. [Code](https://github.com/scalatest/scalatest/blob/main/jvm/core/src/main/scala/org/scalatest/tools/Framework.scala#L267) in Scalatest for related logic.
Fixes com-lihaoyi#3440 The problem is mill define all the test tasks with `explicitlySpecified` to be `true`. This result this test always be included. [Code](https://github.com/scalatest/scalatest/blob/main/jvm/core/src/main/scala/org/scalatest/tools/Framework.scala#L267) in Scalatest for related logic.
I created a PR that I think can fix the issue, but I cannot really test it since the testing command above doesn't work. @lihaoyi or anyone else, could you help me figure out the command to run tests with the dev build? |
@wb14123 that command is for manually exercising the example tests, which I think isn't what we want for your PR. For your PR, a unit test added in https://github.com/com-lihaoyi/mill/blob/main/scalalib/test/src/mill/scalalib/TestModuleTests.scala, with the code-under-test in a subfolder of scalalib/test/resources, which you can run via |
@lihaoyi Yeah agreed on unit test. But I also want to manually run the |
@wb14123 your command looks correct. What's the content of |
The content is the code mentioned in the issue at the beginning: https://github.com/Readon/mill/tree/main/example/scalalib/testing/4-test-tag . Running |
Anyway, added tests in the PR. The tests failed without my change and succeed with the change. So the fix should be good. |
Fixes #3440 The problem is mill defines all the test tasks with `explicitlySpecified` to be `true`. This makes all the tests always be included. [Related code](https://github.com/scalatest/scalatest/blob/main/jvm/core/src/main/scala/org/scalatest/tools/Framework.scala#L267) in Scalatest.
From the maintainer Li Haoyi: I'm putting a 500USD bounty on this issue, payable by bank transfer on a merged PR fixing this.
When running testOnly with "-- -n [tag]" by mill it would run all tests including the tagged test.
However, this option is used normally only run the tagged test without more, just as sbt doing.
I have create a minimum example at my fork.
Just run the run.sh, the results would be as below in 0.11.11.
Cmd:
sbt 'testOnly -- -n tagged'
works good, only run the tagged test.
Cmd:
sbt 'testOnly -- -l tagged'
works good, only run tests without specified tag.
Cmd:
mill __.testOnly -- -n tagged
Wrong this command should not run tests with tag.
Cmd:
mill __.testOnly -- -l tagged
works good, only run tests without specified tag.
The text was updated successfully, but these errors were encountered: