You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm in a scenario where unittests and fluentlenium integration tests are placed in the same module but need to be run seperately at different stages of deployment in different environments.
To be able to seperate the test executions, this configuration in build.sbt was created:
lazyvalITest= config("i").extend(Test)
lazyvalUTest= config("u").extend(Test)
testOptions in ITest+=Tests.Argument(TestFrameworks.ScalaTest, "-l","foo.bar.UnitTesttestOptions in UTest += Tests.Argument(TestFrameworks.ScalaTest, "-l","foo.bar.IntegrationTest")
This way i can run sbt u:test and all suits annotated with @IntegrationTest will be skipped due to the exclude flag -l.
But still, whenever test execution reaches a Test annotated with IntegrationSpec, a browser gets started and closes immediately without doing anything, because all tests in this Suite get skipped. Since there is no browser installed in the environment where u:test is meant to be executed, this attempt to start a browser breaks test execution. Which is unfortunate because it wouldn't be necessary to start a browser at all. Am i doing something wrong in my attempt to skip the Testsuits?
The text was updated successfully, but these errors were encountered:
So right now my last resort was to extend the OneBrowserPerSuite trait, override run, check for excludedTags and just return SucceededStatus if the suite should be skipped due to its annotations.
@marcospereira Would it make sense to do something similar for org.scalatestplus.play.OneBrowserPerSuite? I'm aware tests get skipped even without this hack, and most people wouldn't care about the browser startup, but i think it would make sense to prevent the startup, since it's unnecessary when the suite shall be skipped anyway.
having poked around to trying to decouple from the async tests, I believe the issue is that the current hooks use:
abstract override def run(testName: Option[String], args: Args): Status
which gets executed even if a test is filtered out. A course of action may be to use BeforeAndAfterAll to start/stop (I'll be opening a PR for the non-browser suites with this), and override either:
I'm in a scenario where unittests and fluentlenium integration tests are placed in the same module but need to be run seperately at different stages of deployment in different environments.
A Fluentlenium Spec might look like this
and a unit test like this
To be able to seperate the test executions, this configuration in
build.sbt
was created:This way i can run
sbt u:test
and all suits annotated with@IntegrationTest
will be skipped due to the exclude flag-l
.But still, whenever test execution reaches a Test annotated with
IntegrationSpec
, a browser gets started and closes immediately without doing anything, because all tests in this Suite get skipped. Since there is no browser installed in the environment whereu:test
is meant to be executed, this attempt to start a browser breaks test execution. Which is unfortunate because it wouldn't be necessary to start a browser at all. Am i doing something wrong in my attempt to skip the Testsuits?The text was updated successfully, but these errors were encountered: