Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    JoRo
    @fluxlife
    Is there a way to use futures and generators?
    Bill Venners
    @bvenners
    @fluxlife sorry not yet. We wrote a generator for which this is indeed possible. We were about to release it when I got an email suggesting we use RoseTrees for integrated shrinking. I thought that was a good idea, but it has taken a long time to get that change done. We are almost done. It will be in 3.3.0.
    1 reply
    Chua Chee Seng
    @cheeseng
    @jorgeadriano fyi i have uploaded an example project for supersafe here: https://github.com/scalatest/supersafe-sbt-example
    Bill Venners
    @bvenners
    ScalaTest and Scalactic 3.2.8 including support for Scala 3.0.0-RC3 are published according to Sonatype, though I don't yet see them on Maven Central. They should appear soon. The other artifacts (including the ScalaTest+ modules) will follow tonight.
    Bill Venners
    @bvenners
    The other 3.2.8 artifacts are now out the door.
    Donald McLean
    @dmclean62
    If Scalatest/Scalactic was the only Scala library I use, I would be happy to try it out, but alas, not yet.
    Donald McLean
    @dmclean62
    Is there a way to force a test to fail if it takes more than a certain amount of time?
    I have a test that is hanging forever and I would like it to fail, since it shouldn't be doing that.
    Mathieu Prevel
    @mprevel
    @dmclean62 I don't know if it is the good way to do it, but when using Future with ScalaFutures trait, there is a timeout for the future to be completed.
    Bill Venners
    @bvenners
    @dmclean62 yes, look for TimeLimitedTests.
    If you have a hanging test, though, I would suggest running VisualVM and taking a thread snapshot. One of ScalaTest's secret features is that we rename threads to indicate what suite and test is running. So you can find the thread running your hanging test (or figure out what test is causing a hang if you don't know), and see where in the test it is stuck.
    Donald McLean
    @dmclean62
    Oh, I know why it's breaking, sort of. This is my first time writing a library, and I'm trying to do a better job, write better code. And in the process of improving things, there are some higher level tests that have broken. I just haven't gotten a chance to fix them all yet.
    Maxime P
    @max-peroch
    Hi all, I was wondering if anyone tried to compile and run a suite of tests using native image from GraalVM? Is it technically possible or does reflection get in the way?
    Bill Venners
    @bvenners
    @max-peroch I haven't tried it, but that would be an interesting idea. There is some reflection scattered here and there, unfortunately. So it would be a subset. Mainly RefSpec, which can be cut out, and matchers. So if you just use a different style than RefSpec and use assertions, it might work fine.
    Maxime P
    @max-peroch
    Thanks for your reply Bill! I believe it is possible to use reflection as long as GraalVM knows what needs reflection access (from my limited understanding of it). I'll keep digging and report back if I manage to have something that works, but so far no luck ... :)
    Maxime P
    @max-peroch
    I made some progress regarding the above. Although, it seems that the native version fails to "discover" my test suite... ie when I do java -cp "lib/*" org.scalatest.tools.Runner -w "com.company" -eDF -R lib/my_tests.jar it works as expected, but ./scalatest-native -w "com.company" -eDF -R lib/my_tests.jar returns No tests were executed.. Am I missing something obvious? Adding -s com.company.MySuite fails with a ClassNotFoundException so it looks like the native version isn't even looking into my_tests.jar? At this point I am not sure yet if I did something wrong with the native image generation or if I don't use scalatest's runner properly, possibly both :)
    Bill Venners
    @bvenners
    @max-peroch just starting a meeting. Will look at your question a bit later.
    Chua Chee Seng
    @cheeseng
    @max-peroch interesting thing, we never tried native image with graalvm before to run native tests, would you mind sharing with us the steps you took to create the scalatest-native image? i would like to try that myself here. :)
    3 replies
    Chua Chee Seng
    @cheeseng
    @max-peroch fyi, the current scalatest-native support relies on TestUtils to instantiate the class, here: https://github.com/scalatest/scalatest/blob/3.2.x-new/native/core/src/main/scala/org/scalatest/tools/TaskRunner.scala#L80
    @max-peroch i wonder if you created the native image from our scalatest jar or the scalatest native jar file? i am not sure if graal will recognize scala-native produced jar 'special'. perhaps graal working with our jvm jar makes more sense.
    Chua Chee Seng
    @cheeseng
    @max-peroch fyi for the jvm version, it is just a java reflection call here: https://github.com/scalatest/scalatest/blob/3.2.x-new/jvm/core/src/main/scala/org/scalatest/tools/Framework.scala#L447
    Luís Campos
    @LLCampos
    Hello everyone :) I created a repo with a summary of the Scala testing libraries ecosystem: https://github.com/LLCampos/state-of-the-art-scala-testing/ Should I add/change anything regarding scalatest?
    Bill Venners
    @bvenners
    @LLCampos First of all, thanks for asking. And yes I think that's accurate about ScalaTest. I really appreciate you asking and doing the research work in the first place.
    Once I get PinS 5ed out the door, which is going to coincide with the Scala 3 release, which may coincide with this coming week, I'm going to focus on ScalaTest for a while before starting the Advanced Programming in Scala book.
    Bill Venners
    @bvenners
    Over time those three no's will likely transform into yeses.
    Luís Campos
    @LLCampos
    Ah, cool! :)
    ldeck
    @ldeck
    Hey all — would anyone happen to have a guide or example repo where the scalatest-maven-plugin results are included in the maven site plugin’s generated site?
    Donald McLean
    @dmclean62
    Anyone ever use Cats Effect?
    Bill Venners
    @bvenners
    @dmclean62 may want to ask on the typelevel/cats channel
    or is it called a "room"
    @ldeck I unfortunately don't know that answer so hopefully someone else does.
    Bill Venners
    @bvenners
    ScalaTest/Scalactic 3.2.9, which includes support for Scala 3.0.0, is now released!
    Objektwerks
    @objektwerks
    I just upgraded a Scala3 project to Scala3 3.0.0 and Scalatest 3.2.9 and received this odd error on AnyFunSuite:
    [error] |bad parameter reference Function.this.R at inlining [error] |the parameter is type R in trait Function but the prefix (Function.this : Function[V, R]) [error] |does not define any corresponding arguments. [error] |idx = 1, args = List()
    I have several other AnyFunSuite tests which do not throw this error. If it helps, the effected Scala3 project can be found here:
    https://github.com/objektwerks/scala3
    Bill Venners
    @bvenners
    @objektwerks there is a ticket for this already: scalatest/scalatest#2030
    We will look at it first thing Monday.
    Objektwerks
    @objektwerks
    @bvenners Thanks, Bill.
    Chua Chee Seng
    @cheeseng
    @objektwerks @bvenners fyi I replied to the ticket already: https://github.com/scalatest/scalatest/issues/2030#issuecomment-841963220
    Johan Walters
    @fourth44
    Any solutions to 'no implicit argument of type org.scalactic.source.Position was found for parameter pos...'? It has been brought up many times but never answered. Scala 3.0.0, scalatest 3.2.9.
    1 reply
    Chua Chee Seng
    @cheeseng
    @fourth44 following scalatest/scalatest#1950 , it seems @Sciss no longer able to reproduce it, but it reads like you are encountering it in again, are you able to reproduce it in a minimized project?
    @fourth44 the need to set an explicit scalactic version hint that you may have a different version of scalactic on your classpath.
    Hanns Holger Rutz
    @Sciss
    I don't know. I have recently compiled and published many projects for Scala 3.0.0 using ScalaTest 3.2.9, and didn't have any issues; but don't know off the top of my head if I had kept some work-arounds or not.
    At least in the project listed in the issue, ScalaOSC, it seems to be fine now.
    Loup
    @loup-fox
    Hi I still have the issue no implicit argument of type org.scalactic.source.Position was found for parameter pos...I'm not using withDottyCompat and the project is rather small. What can I do to debug this?
    Bill Venners
    @bvenners
    @loup-fox Sorry, I forgot to check gitter for a few days. Didn't see an email notification though it did come through. Was lost in my inbox. Anyway, Hmm. Did you by chance find a solution in the past two days? If not, I wonder if you can make a ticket with a bit more detail, here: https://github.com/scalatest/scalatest/issues Tnx.
    Bill Venners
    @bvenners
    @loup-fox I just got it myself.
    Bill Venners
    @bvenners
    @loup-fox ok this is totally weird. I noticed that I had my test under main not test. I moved it to test and it worked. So under main I got the Position not found for parameter pos problem. My build does not have ScalaTest in main, so I wonder if perhaps it just can't find ScalaTest (or its transitive dependency Scalactic) at all, and it just stops complaining after the first problem it encounters, which is for some reason Position.
    Ahmet Turk
    @ahmet_turk_gitlab
    Hi all, I realized following
    List(1, 2, 2, 3, 3, 3) should be (List(3, 2, 3, 1, 2, 3, 5))
    shows <Click to see difference> in Intellij which is nice.
    However, doing the same with following does not show <Click to see difference>
    List(1, 2, 2, 3, 3, 3) should contain theSameElementsAs List(3, 2, 3, 1, 2, 3, 5)
    I accept that they two test cases might look the same but they mean different things conceptually. I assume second one reports in a way that is not a standard so Intellij does not understand how to show diff?