This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch branch-1.8
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/branch-1.8 by this push:
     new 495f0742f [KYUUBI #6139] Expose env vars and sys props to JUnit tests 
too
495f0742f is described below

commit 495f0742fdd093a365f352ff8204b4b7d9b65ece
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
    
    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.
    
    Repeat configuration of `scalatest-maven-plugin` to `maven-surefire-plugin`
    
    - [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)
    
    No real affect yet. GA should pass as before.
    
    ---
    
    - [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]>
    (cherry picked from commit 85deeccd609ebc4b2b293c8420c82d258c1ffd38)
    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 62b4ff268..c5596f14a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1672,14 +1672,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>${extraJavaTestArgs}</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 -->
@@ -1687,6 +1703,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>
@@ -1704,8 +1721,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>

Reply via email to