dev-mode/sbt-plugin/src/sbt-test/README.md
This is a collection of sbt scripted tests for Play's sbt plugin.
They are all in the play-sbt-plugin directory so we can use scripted's "play-sbt-plugin/*1of3" feature to auto-split the tests into groups and run them in parallel build jobs.
But we'll discuss them by their logical groupings.
Prefix: maven-layout-
This holds a few regression tests. When Maven Layout becomes the default Layout for Play this test suite can be removed.
Prefix: evolutions-
Verifies that Play evolutions work as expected for the following scenarios:
DEV modeautoApply=false:
autoApply=true
autoApply=falseautoApply=false and the other one is autoApply=trueautoApply=falseautoApply=truePROD modeautoApply=trueautoApply=falsePrefix: shutdown-
This collection of scripted tests helps ensuring the correct resource de-alloc in as many scenarios as possible.
Tests are grouped in scripted suites to reduce the maintainability costs and time
to execute at the cost of loosing some visibility when a test fails.
Here's a list of scripted suites and what are the tests they exercise:
happy-path:
6-: Mode.Dev + file change causes dev mode reload5-: Mode.Dev + Ctrl-D stops dev mode3-: Mode.Test + non-forked tests1-: Mode.Prod finished on SIGTERMdowning:
7-: Mode.Dev + on Downing, stop dev mode4-: Mode.Test + forked tests2-: Mode.Prod finished on DowningOnly when running Play in Mode.Prod requires producing a pidfile that must be deleted when the
process completes.
That file must only exist during the life-span of a PROD process (never TEST nor DEV).
There's a first batch of use cases to be tested with default settings.
1- Process finishes on SIGTERM
2- Process finishes on programmatic event (e.g. cluster Downing event)
3- non-forked tests execute completely, run coordinated shutdown but don't exit the JVM
4- forked tests execute completely, run coordinated shutdown and exit the JVM
5- on user interaction (Ctrl-D): stop dev mode, run coordinated shutdown but don't exit the JVM
6- on file change: only the Application should die, run coordinated shutdown but don't exit the JVM
7- on programmatic event (e.g. Downing): only the Application should die, run coordinated shutdown but don't exit the JVM
There's a collection of settings with a certain impact on shutdown that deserve careful testing. Below is a
list of those settings. Using each of these settings may require on or many tests from the Using default settings list above.
a- Using pekko.coordinated-shutdown.exit-jvm is forbidden and Mode.Prod doesn't start
b- Using pekko.coordinated-shutdown.reason-overrides....exit-jvm for a custom reason is honored
c- (TODO) Using a custom exit-code is honored
d- (TODO) Using a custom exit-code for a custom reason is honored
Prefix: http-backend-
Provides a few test for custom behaviors depending on the HTTP backend used.
In Test mode, Play provides tools to handle the Server and Application lifecycles. These tools must create a server using the configured backend and the specified protocols: