Reputation: 791
I've a cloned setup of Spark. It has a microbenchmark suite which is located here. If I browse to a particular file e.g. AggregateBenchmark.scala, I see the instructions in the comments to perform the benchmarks.
* To run this:
* build/sbt "sql/test-only *benchmark.AggregateBenchmark"
I did try the above command in the project folder but it ignores the benchmarks everytime. The following is the output of the above issued command.
[info] AggregateBenchmark:
[info] - aggregate without grouping !!! IGNORED !!!
[info] - stat functions !!! IGNORED !!!
[info] - aggregate with linear keys !!! IGNORED !!!
[info] - aggregate with randomized keys !!! IGNORED !!!
[info] - aggregate with string key !!! IGNORED !!!
[info] - aggregate with decimal key !!! IGNORED !!!
[info] - aggregate with multiple key types !!! IGNORED !!!
[info] - cube !!! IGNORED !!!
[info] - hash and BytesToBytesMap !!! IGNORED !!!
[info] ScalaCheck
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0
[info] Warning: Unknown ScalaCheck args provided: -oDF
[info] ScalaTest
[info] Run completed in 1 second, 393 milliseconds.
[info] Total number of tests run: 0
[info] Suites: completed 1, aborted 0
[info] Tests: succeeded 0, failed 0, canceled 0, ignored 9, pending 0
[info] No tests were executed.
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0, Ignored 9
[success] Total time: 94 s, completed Feb 17, 2017 2:57:21 PM
Is there something I'm missing here? What extra flags, command needs to be passed for the tests to be run?
Upvotes: 0
Views: 189
Reputation: 406
Unfortunately there is no method to run ignored tests from the CLI without changing the source.
The micro-benchmark tests you're referencing are written using FunSuite and use the Ignore tagging system. There is no capability in that API to unignore the tests. For more about FunSuite and ignoring tests, see here: http://doc.scalatest.org/3.0.1/#org.scalatest.Ignore
Ignoring a test is somewhat similar to just commenting the test out in source code, but it has the advantage of keeping the source code visible to the compiler so that tests can be maintained and kept up to date with the source that they test. Developers choose to ignore tests for many reasons, though in this case it's because running micro-benchmarks is somewhat expensive to do as part of a unit test suite.
The only way to run the tests is to use an editor of your choice to go in and change the method calls for the tests from ignore(...)
to test(...)
, recompile, and then run the benchmarks.
Upvotes: 1