Skip to content

Commit 48f5884

Browse files
lins05ash211
authored andcommitted
Use "extraScalaTestArgs" to pass extra options to scalatest. (apache#52)
* Use "extraTestArgLine" to pass extra options to scalatest. Because the "argLine" option of scalatest is set in pom.xml and we can't overwrite it from the command line. Ref apache-spark-on-k8s#37 * Added a default value for extraTestArgLine * Use a better name. * Added a tip for this in the dev docs.
1 parent 27f3005 commit 48f5884

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@
223223
<PermGen>64m</PermGen>
224224
<MaxPermGen>512m</MaxPermGen>
225225
<CodeCacheSize>512m</CodeCacheSize>
226+
<extraScalaTestArgs></extraScalaTestArgs>
226227
</properties>
227228
<repositories>
228229
<repository>
@@ -2085,7 +2086,7 @@
20852086
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
20862087
<junitxml>.</junitxml>
20872088
<filereports>SparkTestSuite.txt</filereports>
2088-
<argLine>-ea -Xmx3g -XX:MaxPermSize=${MaxPermGen} -XX:ReservedCodeCacheSize=${CodeCacheSize}</argLine>
2089+
<argLine>-ea -Xmx3g -XX:MaxPermSize=${MaxPermGen} -XX:ReservedCodeCacheSize=${CodeCacheSize} ${extraScalaTestArgs}</argLine>
20892090
<stderr/>
20902091
<environmentVariables>
20912092
<!--

resource-managers/kubernetes/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,20 @@ Afterwards, the integration tests can be executed with Maven or your IDE. Note t
5151
`pre-integration-test` phase must be run every time the Spark main code changes. When running tests from the
5252
command line, the `pre-integration-test` phase should automatically be invoked if the `integration-test` phase is run.
5353

54+
# Preserve the Minikube VM
55+
56+
The integration tests make use of [Minikube](https://github.com/kubernetes/minikube), which fires up a virtual machine
57+
and setup a single-node kubernetes cluster within it. By default the vm is destroyed after the tests are finished.
58+
If you want to preserve the vm, e.g. to reduce the running time of tests during development, you can pass the property
59+
`spark.docker.test.persistMinikube` to the test process:
60+
61+
```sh
62+
build/mvn integration-test \
63+
-Pkubernetes -Pkubernetes-integration-tests \
64+
-pl resource-managers/kubernetes/integration-tests -am \
65+
-DextraScalaTestArgs=-Dspark.docker.test.persistMinikube=true
66+
```
67+
5468
# Usage Guide
5569

5670
See the [usage guide](../../docs/running-on-kubernetes.md) for more information.

0 commit comments

Comments
 (0)