Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    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?
    Bill Venners
    @bvenners
    @ahmet_turk_gitlab Yes i think that intellij doesn't attempt diffs except on equality comparisons. 'should contain the same elements as' is not really an equality comparison.
    Aaron Schweiger
    @aschweig
    I am trying to use akka (2.6.14)'s ScalaTestWithActorTestKit with scala 3.0.0; when run I get the following error message: java.lang.NoSuchMethodError: 'void org.scalactic.TripleEqualsSupport.$init$(org.scalactic.TripleEqualsSupport)' I am using scalatest/scalactic 3.2.9 building with mill. Any help is appreciated.
    Bill Venners
    @bvenners
    @aschweig It looks like a version mismatch somewhere. You can look in the POM for ScalaTestWithActorTestKit and see what version of ScalaTest it is using. If you use the same version of ScalaTest you should be fine.
    Aaron Schweiger
    @aschweig
    @bvenners I downgraded to scala 2.13.6 and things are working as expected. I was using Akka_2.13. with Scala 3.
    vimalaguti
    @vimalaguti

    Hi, I upgraded to scalatest 3.2.9 from 3.0.9 and I get this compilation error:

    type mismatch;
     found   : ResultOfATypeInvocation[ScriptResult.ScriptResultFailure] (in org.scalatest.words) 
     required: ResultOfATypeInvocation[_]                                                         (in org.scalatest.matchers.dsl) 
        result.failed.get shouldBe a[ScriptResultFailure]

    but in the doc I read its supported the syntax smthg shouldBe a [Double] where am I wrong?

    Bill Venners
    @bvenners
    @vimalaguti I don't see anything you're doing wrong. Can you make an issue here: https://github.com/scalatest/scalatest/issues
    Jorge Adriano Branco Aires
    @jorgeadriano

    @jorgeadriano fyi i have uploaded an example project for supersafe here: https://github.com/scalatest/supersafe-sbt-example

    Thank you @cheeseng!

    Cristian Spinetta
    @cspinetta
    hi all,
    I'm Scala-2.12 and scalatest 3.0
    I built an async test using fixture.AsyncWordSpec which works properly. The problem comes when I try to change the default execution context (which is a serial execution context provided by ScalaTest) by the global (scala.concurrent.ExecutionContext.Implicits.global). The suite is completed almost immediately with 0 tests completed. is there anything additional that needs to be done so that inner futures can run in a multi-threading execution context like the global one?
    Bill Venners
    @bvenners
    @cspinetta Hmm. Can you paste in how you are changing the execution context?
    Cristian Spinetta
    @cspinetta
    sure! let me show you a more complete example:
    @RunWith(classOf[JUnitRunner])
    class TestWithFuturesSpec
      extends fixture.AsyncWordSpec
        with Matchers
        with Inside
        with EitherValues
        with Eventually
        with MockitoSugar {
    
      case class FixtureInstance(param: Int)
    
      implicit override def executionContext: ExecutionContext = scala.concurrent.ExecutionContext.Implicits.global
    
      type FixtureParam = FixtureInstance
    
      override def withFixture(test: OneArgAsyncTest): FutureOutcome = {
        withFixture(test.toNoArgAsyncTest(FixtureInstance(param = 1)))
      }
    
      def operate(value: Int): Int = ???
      def otherOperate(value1: Int, value2: Int): Future[Int] = ???
    
      "test 1" should {
        "run properly" when {
          "called" in { f =>
            val f1: Future[Int] = Future(operate(f.param)) // expensive operation
            val f2: Future[Int] = Future(operate(f.param)) // expensive operation
            for {
              r1 <- f1
              r2 <- f2
              r3 <- otherOperate(r1, r2)
            } yield {
              r3 shouldBe 9999
            }
          }
        }
      }
    }
    and the error message:
    [scalatest] Reporter completed abruptly with an exception after receiving event: SuiteCompleted(Ordinal(1, 10),TestSpec,xxxx.TestSpec,Some(xxxx.TestSpec),Some(11102),Some(MotionToSuppress),Some(TopOfClass(xxxx.TestSpec)),Some(xxxx.TestSpec),None,ScalaTest-main-running-DiscoverySuite,1624467770938).
    [scalatest] java.lang.RuntimeException: unexpected event [SuiteCompleted(Ordinal(1, 10),TestSpec,xxxx.TestSpec,Some(xxxx.TestSpec),Some(11102),Some(MotionToSuppress),Some(TopOfClass(xxxx.TestSpec)),Some(xxxx.TestSpec),None,ScalaTest-main-running-DiscoverySuite,1624467770938)]
    [scalatest]     at org.scalatest.tools.JUnitXmlReporter.unexpected(JUnitXmlReporter.scala:494)
    [scalatest]     at org.scalatest.tools.JUnitXmlReporter.processTest(JUnitXmlReporter.scala:324)
    [scalatest]     at org.scalatest.tools.JUnitXmlReporter.getTestsuite(JUnitXmlReporter.scala:166)
    [scalatest]     at org.scalatest.tools.JUnitXmlReporter.writeSuiteFile(JUnitXmlReporter.scala:76)
    [scalatest]     at org.scalatest.tools.JUnitXmlReporter.apply(JUnitXmlReporter.scala:59)
    [scalatest]     at org.scalatest.DispatchReporter$Propagator.$anonfun$run$10(DispatchReporter.scala:249)
    [scalatest]     at org.scalatest.DispatchReporter$Propagator.$anonfun$run$10$adapted(DispatchReporter.scala:248)
    [scalatest]     at org.scalatest.DispatchReporter$Propagator$$Lambda$2041/0x0000000000000000.apply(Unknown Source)
    [scalatest]     at scala.collection.immutable.List.foreach(List.scala:431)
    [scalatest]     at org.scalatest.DispatchReporter$Propagator.run(DispatchReporter.scala:248)
    [scalatest]     at java.lang.Thread.run(Thread.java:823)
    Bill Venners
    @bvenners
    @cspinetta Tnx for the detail. I'll research that a bit later today. I can't recall off the top of my head what the problem might be.
    @cspinetta But your code looks fine.
    Cristian Spinetta
    @cspinetta
    Thanks @bvenners ! seems to be related to using the Amazon SDK HTTP Client, because when I replaced it with a Thread.Sleep() the test run pretty well as expected
    later I will look for a work around. Any advice is more than welcome!
    caoilTe O'Connor
    @caoilte
    Hey @bvenners. I'd be really interested in your thoughts on the challenges with updating flexmark from 0.35.10 to 0.60+ as this is something I'd be interested with helping out on (issue from last year when someone first brought it up: scalatest/scalatest#1885)
    Raphaƫl Fromentin
    @Iltotore
    Hello, is there a way to check if a code desugars to another ?
    Something like:
    inline def log(inline x: Double): Double = Math.log(x)
    
    "log(1)" should desugarTo("Math.log(1)")
    Chua Chee Seng
    @cheeseng
    @caoilte fyi i submitted the following PR for flexmark version update: scalatest/scalatest#2050
    caoilTe O'Connor
    @caoilte
    @cheeseng just saw it and replied!
    I'm wondering whether flexmark-all no longer includes pegdown (ie you need to add it as extra dependency)
    Nicolas Rinaudo
    @nrinaudo
    I've just encoutered a weird, vicious little bug
    apparently, jpath can return null
    would a PR to fix this issue be accepted?
    seems like there are duplicated codes, i'll see if can do a DRY.
    Nicolas Rinaudo
    @nrinaudo
    daffydee13
    @daffydee13
    Hi All,
    I am writing a test case in Azure Databricks using Scalatest and running my test suite using "execute" method. (Code snippet attached below)
    Now I want to export the results as XML, but in execute method I could not find any option to pass "-u <target dir>"
    Do we have any workaround for this? Thanks in advance :)
    image.png
    Joseph Denman
    @JosephDenman

    Hi all. I'm trying to write a set of tests that are not run by default but can be run when desired. I've created a custom config (and looked at everything I can find on this problem on Google) that allows me to select or disselect tests with the tag IELE but I'm still running into an issue. This is my SBT project definition:

    val node = {
      val node = project
        .in(file("node/instance"))
        .dependsOn(
          ...
        )
        .settings(commonSettings("node"): _*)
        .settings(
          libraryDependencies ++= ...
        )
        .settings(
          buildInfoKeys := BuildInfoKey.ofN(
            name,
            version,
            scalaVersion,
            sbtVersion,
            gitHeadCommit,
            gitCurrentBranch,
            gitCurrentTags,
            gitDescribedVersion,
            gitUncommittedChanges,
            libraryDependencies in Compile
          ),
          buildInfoPackage := "...",
          buildInfoObject := "NodeBuildInfo",
          buildInfoOptions in Compile += BuildInfoOption.ToMap
        )
        .settings(
          (soliditySources in Compile) ++= Seq(
            baseDirectory.value / "src" / "evmTest" / "resources" / "solidity",
            baseDirectory.value / "src" / "test" / "resources" / "solidity",
            baseDirectory.value / "src" / "precompiledContracts" / "resources" / "solidity"
          )
        )
        .settings(
          executableScriptName := name.value,
          mainClass in Compile := Some("io.iohk.ethereum.App"),
          discoveredMainClasses in Compile := Seq(),
          // Requires the 'ant-javafx.jar' that comes with Oracle JDK
          // Enables creating an executable with the configuration files, has to be run on the OS corresponding to the desired version
          jdkPackagerType := "image",
          mappings in Universal += (resourceDirectory in Compile).value / "blockchain" / "development-genesis.json" -> "conf/development-genesis.json",
          mappings in Universal += (resourceDirectory in Compile).value / "logback.xml" -> "conf/logback.xml"
        )
    
      val Integration = config("it") extend Test
      scalastyleSources in Test ++= { (unmanagedSourceDirectories in Integration).value }
      val Benchmarks = config("benchmarks") extend Test
      val EvmTest = config("evmTest") extend Test
      val PrecompiledContracts = config("precompiledContracts") extend Test
    
      coverageExcludedPackages := "io\\.iohk\\.ethereum\\.extvm\\.msg.*"
    
      Test / testOptions += Tests.Argument("-l", "iele")
      val Iele = config("iele") extend Test
      Iele / testOptions -= Tests.Argument("-l", "iele")
      Iele / testOptions += Tests.Argument("-n", "iele")
    
      node
        .configs(Integration, Benchmarks, EvmTest, PrecompiledContracts, Iele)
        .settings(
          inConfig(Integration)(
            Defaults.testSettings ++ BloopDefaults.configSettings ++ Seq(parallelExecution in Test := false)
          ): _*
        )
        .settings(inConfig(Benchmarks)(Defaults.testSettings ++ BloopDefaults.configSettings): _*)
        .settings(inConfig(EvmTest)(Defaults.testSettings ++ BloopDefaults.configSettings): _*)
        .settings(inConfig(PrecompiledContracts)(Defaults.testSettings ++ BloopDefaults.configSettings): _*)
        .settings(inConfig(Iele)(Defaults.testSettings ++ BloopDefaults.configSettings): _*)

    When I run iele:test in SBT console it returns immediately saying no tests were run. Any ideas?

    Joseph Denman
    @JosephDenman
    My tag is object IELE extends Tag("iele")
    Carsten Saager
    @csar
    @aschweig I just copied ScalaTestWithActorTestKit and ActorTestKitBase into a package "testkit" in my test folder and compiled those under Scala 3.0.1 and it seems to work fine
    Steven Barnes
    @steven-barnes
    Hello, I am adding scalatest to a project that uses cucumber. Now, sbt test only runs the scalatest tests. I've looked into com.waioeka.sbt cucumber-runner, but it does not seem to support scala 2.13
    Eric Peters
    @er1c
    Is there any way to debug the scalatest runner, I'm running some with -- -n tags.Foo and it is running other classes (specifically through sbt)
    Matt Hicks
    @darkfrog26
    how do I run the same test suite multiple times iterating over a list of data values that should be used for each run? Shockingly, I've never had to do this before. :o
    1 reply