This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/master by this push:
new 85deeccd6 [KYUUBI #6139] Expose env vars and sys props to JUnit tests
too
85deeccd6 is described below
commit 85deeccd609ebc4b2b293c8420c82d258c1ffd38
Author: Cheng Pan <[email protected]>
AuthorDate: Thu Mar 7 16:21:01 2024 +0800
[KYUUBI #6139] Expose env vars and sys props to JUnit tests too
# :mag: Description
## Issue References ๐
Currently, we leverage `maven-surefire-plugin` to run JUnit tests and
`scalatest-maven-plugin` to run Scalatest suites, we should make sure to expose
the same env vars and sys props to all tests.
## Describe Your Solution ๐ง
Repeat configuration of `scalatest-maven-plugin` to `maven-surefire-plugin`
## Types of changes :bookmark:
- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
## Test Plan ๐งช
No real affect yet. GA should pass as before.
---
# Checklist ๐
- [x] This patch was not authored or co-authored using [Generative
Tooling](https://www.apache.org/legal/generative-tooling.html)
**Be nice. Be informative.**
Closes #6139 from pan3793/test.
Closes #6139
31d039483 [Cheng Pan] nit
305fb499f [Cheng Pan] nit
d67bd268b [Cheng Pan] Expose env vars and sys props to JUnit tests too
Authored-by: Cheng Pan <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
---
pom.xml | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/pom.xml b/pom.xml
index 026ec6c6e..f7d63d209 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1683,14 +1683,30 @@
</executions>
</plugin>
- <!-- disable surefire -->
+ <!-- disable surefire globally, only enable it on pure Java
modules -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
+ <!-- Note config is repeated in scalatest config -->
<configuration>
<skipTests>true</skipTests>
<failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
<argLine>${maven.plugin.surefire.argLine}</argLine>
+ <environmentVariables>
+
<KYUUBI_WORK_DIR_ROOT>${project.build.directory}/work</KYUUBI_WORK_DIR_ROOT>
+ </environmentVariables>
+ <systemProperties>
+ <log4j.ignoreTCL>true</log4j.ignoreTCL>
+
<log4j.configuration>file:src/test/resources/log4j.properties</log4j.configuration>
+
<log4j2.configurationFile>src/test/resources/log4j2-test.xml</log4j2.configurationFile>
+
<java.io.tmpdir>${project.build.directory}/tmp</java.io.tmpdir>
+ <spark.driver.memory>1g</spark.driver.memory>
+
<kyuubi.metrics.json.location>${project.build.directory}/metrics</kyuubi.metrics.json.location>
+
<kyuubi.frontend.bind.host>localhost</kyuubi.frontend.bind.host>
+
<sun.security.krb5.debug>false</sun.security.krb5.debug>
+
<kyuubi.operation.log.dir.root>${project.build.directory}/server_operation_logs</kyuubi.operation.log.dir.root>
+
<kyuubi.engine.operation.log.dir.root>${project.build.directory}/engine_operation_logs</kyuubi.engine.operation.log.dir.root>
+ </systemProperties>
</configuration>
</plugin>
<!-- enable scalatest -->
@@ -1698,6 +1714,7 @@
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<version>${maven.plugin.scalatest.version}</version>
+ <!-- Note config is repeated in surefire config -->
<configuration>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<junitxml>.</junitxml>
@@ -1715,8 +1732,8 @@
<kyuubi.metrics.json.location>${project.build.directory}/metrics</kyuubi.metrics.json.location>
<kyuubi.frontend.bind.host>localhost</kyuubi.frontend.bind.host>
<sun.security.krb5.debug>false</sun.security.krb5.debug>
-
<kyuubi.operation.log.dir.root>target/server_operation_logs</kyuubi.operation.log.dir.root>
-
<kyuubi.engine.operation.log.dir.root>target/engine_operation_logs</kyuubi.engine.operation.log.dir.root>
+
<kyuubi.operation.log.dir.root>${project.build.directory}/server_operation_logs</kyuubi.operation.log.dir.root>
+
<kyuubi.engine.operation.log.dir.root>${project.build.directory}/engine_operation_logs</kyuubi.engine.operation.log.dir.root>
</systemProperties>
<tagsToExclude>${maven.plugin.scalatest.exclude.tags}</tagsToExclude>
<tagsToInclude>${maven.plugin.scalatest.include.tags}</tagsToInclude>