Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    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
    Leif Warner
    @LeifW
    The should contain inOrder helps don't seem to support duplicates? List(5,2,3) should contain inOrder (5,2) passes, List(5,2,5) should contain inOrder (5,2) does not.
    1 reply
    Jason Pickens
    @steinybot:matrix.org
    [m]
    MOHIT PRASANTH KALAHASTHI
    @mohitprasanth
    I want to use scala test for my integration tests (DAO calls) where each call returns a future.
    Which spec is recommended for this ?
    I am sure, I cannot run two test cases at a time because it would ruin my test database.
    can some one help me to figure out which Spec suits here ? and any examples around it would be helpful.
    Carlos Eduardo de Paula
    @carlosedp:matrix.org
    [m]
    Hi all, I'm writing a test for a funtion that returns Any, depending on it's input... I'm seeing a problem with "should be" matcher
    This is a sample:
      def dummy(): Any = true
    
      it should "test Any as bool" in {
        dummy() should be (true) // <- doesn't work
        dummy() should be (true.asInstanceOf[Any]) // <- works fine
      }
    the first statement gives me overloaded method error...
    Carlos Eduardo de Paula
    @carlosedp:matrix.org
    [m]
    I've opened an issue: scalatest/scalatest#2077 ... seems like an error since other types work fine.
    Carlos Eduardo de Paula
    @carlosedp:matrix.org
    [m]
    :point_up: Edit: This is a sample:
      def dummy(): Any = true
    
      it should "test Any as bool" in {
        dummy() should be (true) // <- doesn't compile
        dummy() should be (true.asInstanceOf[Any]) // <- works fine
        dummy() should be (1) // <- compiles fine, fails as expected
      }
    Kilic Ali-Firat
    @alifirat

    Hey I just migrated from scalatest 3.2.0 to 3.2.1 and I see a weird behaviour in the output.
    In the 3.2.0, I see in the stdout my suite tests something like :

    MyTests
    Test1Spec 
    - test1 
    - test2 
    ...
    All tests passed

    While in 3.2.1, I have some tests that do no passed but I only get :

    info] *** 24 TESTS FAILED ***
    [error] Failed tests:
    [error]     FunctionalTestSpec
    [error] (functional-test / Test / test) sbt.TestsFailedException: Tests unsuccessful
    [error] Total time: 87 s (01:27), completed 20 déc. 2021, 14:08:05

    I don't see now which tests are not passing which is a bit hard to debug :-D
    I've checked the releases notes and I don't have the feeling to miss something but maybe you can help me ?

    Kilic Ali-Firat
    @alifirat
    So I've tried the 3.2.3 and now I get the output so let's say that I will forget the 3.2.1
    Mark Dixon
    @mnd999:matrix.org
    [m]
    abstract class Test extends Suite with FunSuiteLike with Matchers {}
    This has me stumped, does anyone know why this does not compile in 2.13 when it does in 2.12 (Scalatest 3.0.9):
    illegal trait super target found for method withFixture required by trait TimeLimitedTests;
    abstract class Context {}
    abstract class TestTest[CONTEXT <: Context] extends Test with TimeLimitedTests {
       }
    expected: protected def withFixture: ((test: _1.NoArgTest): org.scalatest.Outcome) forSome { val _1: [CONTEXT <: Context]TestTest[CONTEXT] } in trait TestSuiteMixin
        override def timeLimit: Span = Span.Max
    found : protected def withFixture: ((test: _1.NoArgTest): org.scalatest.Outcome) forSome { val _1: [CONTEXT <: Context]TestTest[CONTEXT] } in trait TestSuite;
    Shawn Garner
    @BusyByte
    Hello, I'm using ScalaCheckDrivenPropertyChecks from scalatestplus and when a property based test it displays the inputs but not the seed.
    Is there a way to display the seed and also run the tests with a given seed?
    This is when a property based test fails
    Henri Cook
    @henricook
    Hi everyone. Has 3.2.11 been released? Scala steward has raised an MR for me but I can't see it on the github releases page. Checking the releases page is part of my standard defence against supply chain attack (or is there a better source??)
    Chua Chee Seng
    @cheeseng
    @henricook Yes i am working on the release notes, will get it up ASAP.
    Henri Cook
    @henricook
    Thanks! Sorry to bother :-)
    nafg
    @naftoligug:matrix.org
    [m]
    Does Scalatest have a way to get diffs in the output?
    If you compare two values and they are similar but it's hard to see exactly where they differ
    Everton Eckert Schneider
    @evertones
    I would like to see 2 things in my suites of tests running using ScalaTest.
    1. Is it possible to count the number of assertions? One test may in some cases have more than one assertion, so instead of counting the number of tests, I wonder if I could get the total of assertions.
    2. Is there a kind of checkstyle to ensure that each test (it in FunAnySpec) has at least one assertion? In a group of suites of ~10K tests, I have already found in some cases a test without any assertion, so I'd like to know if I could have a way to check that.
    Carlos Eduardo de Paula
    @carlosedp:matrix.org
    [m]
    I recently joined the Scala server on Discord and thought it would be beneficial to the community to maybe have a Scalatest channel over there. Since the server already have more than 700 users online, it's a great place to gather the community and discuss issues on the Scala ecosystem. What are the opinions of the scalatest users and maintainers about this?
    I asked the maintainers over there and they are open to create a new scalatest channel on the Community category, as long as scalatest community is ok with that avoiding fragmentation
    Ondřej Španěl
    @OndrejSpanel
    My code inside of pendingUntilFixed throws NotImplementedError. This causes the test to be marked as failed. When I change it to UnsupportedOperationException, it works fine. Is this expected? If it is, what is the rationale? NotImplementedError is commonly used for unfinished code, for which pendingUntilFixed looks like a perfect solution.
    Matthew de Detrich
    @mdedetrich
    Just created a PR at scalatest/scalatest#2155 which makes Prettifier.truncateAt work for collections within case classes