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

haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 49c6deaaa67 Skip compiling cpp test code when using -DskipTests 
(#12944)
49c6deaaa67 is described below

commit 49c6deaaa678e9586249c31cc627f9cc4da664e2
Author: Haonan <[email protected]>
AuthorDate: Tue Jul 16 19:12:03 2024 +0800

    Skip compiling cpp test code when using -DskipTests (#12944)
---
 .github/workflows/multi-language-client.yml | 11 +++++------
 iotdb-client/client-cpp/pom.xml             | 28 +++++++++++++++++++++++++++-
 2 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/multi-language-client.yml 
b/.github/workflows/multi-language-client.yml
index de6fb4a0ce7..8e879c62fe8 100644
--- a/.github/workflows/multi-language-client.yml
+++ b/.github/workflows/multi-language-client.yml
@@ -60,16 +60,15 @@ jobs:
           path: ~/.m2
           key: client-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
           restore-keys: ${{ runner.os }}-m2-
-      - name: Build IoTDB server and client
+      - name: Build IoTDB server
         shell: bash
-        # Explicitly using mvnw here as the build requires maven 3.9 and the 
default installation is older
-        # Explicitly using "install" instead of package in order to be sure 
we're using libs built on this machine
-        # (was causing problems on windows, but could cause problem on linux, 
when updating the thrift module)
-        run: ./mvnw clean install -P with-cpp -pl 
distribution,example/client-cpp-example -am -DskipTests
+        run: ./mvnw clean install -pl distribution -am -DskipTests
       - name: Test with Maven
         shell: bash
         # Explicitly using mvnw here as the build requires maven 3.9 and the 
default installation is older
-        run: ./mvnw clean verify -P with-cpp -pl iotdb-client/client-cpp -am
+        # Explicitly using "install" instead of package in order to be sure 
we're using libs built on this machine
+        # (was causing problems on windows, but could cause problem on linux, 
when updating the thrift module)
+        run: ./mvnw clean verify -P with-cpp -pl 
iotdb-client/client-cpp,example/client-cpp-example -am
       - name: Upload Artifact
         if: failure()
         uses: actions/upload-artifact@v4
diff --git a/iotdb-client/client-cpp/pom.xml b/iotdb-client/client-cpp/pom.xml
index ca2440933da..d5999be9d5b 100644
--- a/iotdb-client/client-cpp/pom.xml
+++ b/iotdb-client/client-cpp/pom.xml
@@ -37,6 +37,7 @@
         <!-- Default value of cmake root -->
         
<cmake.root.dir>${project.build.directory}/dependency/cmake/</cmake.root.dir>
         
<thrift.exec.absolute.path>${project.build.directory}/thrift/bin/${thrift.executable}</thrift.exec.absolute.path>
+        <maven.test.skip>${ctest.skip.tests}</maven.test.skip>
     </properties>
     <dependencies>
         <dependency>
@@ -107,11 +108,12 @@
                         <goals>
                             <goal>wget</goal>
                         </goals>
-                        <phase>generate-resources</phase>
+                        <phase>generate-test-resources</phase>
                         <configuration>
                             <url>${catch2.url}</url>
                             <unpack>false</unpack>
                             
<outputDirectory>${project.build.directory}/build/test/catch2</outputDirectory>
+                            <skip>${ctest.skip.tests}</skip>
                         </configuration>
                     </execution>
                 </executions>
@@ -257,6 +259,7 @@
                         <phase>integration-test</phase>
                         <configuration>
                             
<buildDirectory>${project.build.directory}/build/test</buildDirectory>
+                            <skipTests>${ctest.skip.tests}</skipTests>
                         </configuration>
                     </execution>
                 </executions>
@@ -402,5 +405,28 @@
                 <os.suffix>win</os.suffix>
             </properties>
         </profile>
+        <profile>
+            <id>.skipTests</id>
+            <activation>
+                <property>
+                    <name>skipTests</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>com.googlecode.cmake-maven-project</groupId>
+                        <artifactId>cmake-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>cmake-compile-test</id>
+                                <phase>none</phase>
+                                <!-- This effectively skips the execution -->
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
 </project>

Reply via email to