Multi-jvm testing docs improved #23954 (#23957)

* multi-jvm testing docs improved #23954
This commit is contained in:
Kirill Yankov 2017-11-10 16:16:35 +03:00 committed by Martynas Mickevičius
parent 08106243ac
commit 31db13a99c

View file

@ -6,21 +6,24 @@ Useful for integration testing where multiple systems communicate with each othe
## Setup ## Setup
The multi-JVM testing is an sbt plugin that you can find at [https://github.com/sbt/sbt-multi-jvm](https://github.com/sbt/sbt-multi-jvm). The multi-JVM testing is an sbt plugin that you can find at [https://github.com/sbt/sbt-multi-jvm](https://github.com/sbt/sbt-multi-jvm).
To configure it in your project you should do the following steps:
You can add it as a plugin by adding the following to your project/plugins.sbt: 1. Add it as a plugin by adding the following to your project/plugins.sbt:
@@snip [plugins.sbt]($akka$/project/plugins.sbt) { #sbt-multi-jvm } @@snip [plugins.sbt]($akka$/project/plugins.sbt) { #sbt-multi-jvm }
You can then add multi-JVM testing to `build.sbt` or `project/Build.scala` by including the `MultiJvm` 2. Add multi-JVM testing to `build.sbt` or `project/Build.scala` by enabling `MultiJvmPlugin` and
settings and config. Please note that MultiJvm test sources are located in `src/multi-jvm/...`, setting the `MultiJvm` config.
```none
lazy val root = (project in file("."))
.enablePlugins(MultiJvmPlugin)
.configs(MultiJvm)
```
**Please note** that by default MultiJvm test sources are located in `src/multi-jvm/...`,
and not in `src/test/...`. and not in `src/test/...`.
You can specify JVM options for the forked JVMs:
```
jvmOptions in MultiJvm := Seq("-Xmx256M")
```
Here is an example of a @extref[sample project](samples:akka-sample-multi-node-scala) that uses the `sbt-multi-jvm` plugin. Here is an example of a @extref[sample project](samples:akka-sample-multi-node-scala) that uses the `sbt-multi-jvm` plugin.
## Running tests ## Running tests
@ -113,6 +116,12 @@ spawned, one for each node. It will look like this:
## Changing Defaults ## Changing Defaults
You can specify JVM options for the forked JVMs:
```
jvmOptions in MultiJvm := Seq("-Xmx256M")
```
You can change the name of the multi-JVM test source directory by adding the following You can change the name of the multi-JVM test source directory by adding the following
configuration to your project: configuration to your project: