Hi All,
I have deployed a second release candidate for ScalaTest 1.8. Info on
how to get it is here:
http://www.scalatest.org/download#18rc2
Scaladoc is here:
http://www.artima.com/docs-scalatest-1.8.RC2/#package
Release notes are here:
http://www.scalatest.org/release_notes#release18
I ended up making some more significant changes from RC1 than I
usually do during an RC phase based on user input. One of the main
questions I had for RC1 was what the default timeout and interval
should be for traits Eventually and AsyncAssertions. After feedback
from several users, I ended up changing these to 150 millisecond
timeout and 15 millisecond interval, values which are tuned for
keeping unit tests running quickly. I renamed the trait that provides
the defaults to PatienceConfiguration, because this configuration sets
how long the test suite is willing to wait for asynchronous operations
to complete (i.e., how "patient" it is). I added a trait
IntegrationPatience that changes the defaults to 15 second timeout and
150 millisecond interval, values tuned for integration testing. You
can of course override it to any other values that work for you.
I added a usage note to Eventually stating that it is intended more
for integration tests where you're using the real subsystems, and that
in unit tests you'd usually want to mock such things out. The default
"patience" is still for unit testing, because sometimes it will make
sense to use Eventually in unit tests, and users will do so even when
it doesn't make sense. I think it is important to have unit tests run
quickly.
I also added a new trait ScaledTimeSpans, and a -F option to Runner
(and similar options to ant and sbt) that allows a time span scale
factor to be specified for a run. Thus you can use -F to scale the
time spans, including the default patience values, up or down by a
Double factor, allowing further tuning. To get any Span other than the
defaults in PatienceConfiguration to scale, you'll need to explicitly
call scaled. For example, for a timeout you could write:
failAfter(scaled(150 millis)) { ... }
You can also override the manner in which the factor is obtained. For
example you could mix in a trait that takes it from Akka's time factor
configuration parameter.
I also added a trait Conductors and copied
org.scalatest.concurrent.Conductor into that trait, deprecating the
existing Conductor. The reason is so that Conductor can be configured
by PatienceConfiguration with spans scaled by ScaledTimeSpans, making
it consistent with Eventually and AsyncAssertions. The old Conductor
will continue to work during the deprecation phase, but give a
deprecation warning.
Lastly, I added trait AppendedClues. This was derived from a different
user request and already checked into the trunk and therefore part of
the 2.0 release, but the feature was again requested (in a round about
way) by a different user who wanted to use something like it with
Eventually in 1.8. So I back-ported it to 1.8. This allows you to put
a clue after a block of code, like this:
eventually { asyncCallSucceeded() should be true } withClue "clue
string comes after"
That's about it for 1.8.RC2. I think I'm done with 1.8. I probably
will give this two weeks to get tried out. The week after next I'll be
giving a Scala class in Atlanta and don't want to release 1.8 final
until after that to make sure I have sufficient time to fix any
issues. So if all goes well I'll release 1.8 final around May 29.
Please try it out if you have time. You should be able to upgrade from
1.7.2 to 1.8.RC2 with a simple recompile, so please let me know (via
scalatest-users) if anything breaks.
On a different subject, I also recently deployed a milestone 1 release
for ScalaTest 2.0 (ScalaTest 2.0.M1). I did this mainly so we'd have
something stable to use with the Eclipse Scala IDE enhancements we
submitted recently. It is more like a snapshot release but with an M1
instead of -SNAPSHOT. I only released it for Scala 2.9.x releases so
far, but plan to release one for Scala 2.10.M3 soon. You're welcome to
give that a try as well, but if you just have time to try one thing,
please try 1.8.RC2. I gave about a 10-minute demo of the Eclipse
integration at ScalaDays. Video is here:
http://skillsmatter.com/podcast/scala/scalatest-scalamock-subcut
Thanks.
Bill
----
Bill Venners
Artima, Inc.
http://www.artima.com