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

wuzhiguo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bigtop-manager.git


The following commit(s) were added to refs/heads/main by this push:
     new 28753ee  BIGTOP-4216: Add a ci job for Vue/Typescript unit testing 
(#60)
28753ee is described below

commit 28753eebc7c7929049b96a91ba9c8495beb78b1f
Author: pckinghao <[email protected]>
AuthorDate: Sun Sep 8 20:36:28 2024 +0800

    BIGTOP-4216: Add a ci job for Vue/Typescript unit testing (#60)
---
 .github/workflows/ci.yml       | 18 +++++++++++++++---
 bigtop-manager-ui/.gitignore   |  1 +
 bigtop-manager-ui/package.json |  4 ++--
 bigtop-manager-ui/pom.xml      | 14 +++++++++++++-
 4 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5c762d9..6822ade 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -23,8 +23,8 @@ jobs:
           cache: 'maven'
       - run: ./mvnw clean spotless:check
 
-  unit-tests:
-    name: "Run unit tests"
+  unit-tests-java:
+    name: "Run unit test(Java)"
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v4
@@ -33,7 +33,19 @@ jobs:
           distribution: 'temurin'
           java-version: '17'
           cache: 'maven'
-      - run: ./mvnw clean test -Dskip.pnpm -Dskip.installnodepnpm
+      - run: ./mvnw clean test -Dskip.pnpm -Dskip.installnodepnpm 
-Dskip.pnpm.test
+      
+  unit-tests-ts:
+    name: "Run unit tests(Vue/Typescript)"
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - uses: actions/setup-java@v4
+        with:
+          distribution: 'temurin'
+          java-version: '17'
+          cache: 'maven'
+      - run: ./mvnw -pl bigtop-manager-ui test
 
   build:
     name: "Build project"
diff --git a/bigtop-manager-ui/.gitignore b/bigtop-manager-ui/.gitignore
index 401fa52..d63b368 100644
--- a/bigtop-manager-ui/.gitignore
+++ b/bigtop-manager-ui/.gitignore
@@ -6,6 +6,7 @@ yarn-debug.log*
 yarn-error.log*
 pnpm-debug.log*
 lerna-debug.log*
+package-lock.json
 
 node
 node_modules
diff --git a/bigtop-manager-ui/package.json b/bigtop-manager-ui/package.json
index 6cf7536..71035f4 100644
--- a/bigtop-manager-ui/package.json
+++ b/bigtop-manager-ui/package.json
@@ -7,8 +7,8 @@
     "preview": "vite preview",
     "lint": "eslint src --fix --ext .ts,.tsx,.vue",
     "prettier": "prettier --write \"src/**/*.{vue,ts,tsx}\"",
-    "test:unit": "vitest",
-    "test": "vitest"
+    "test": "vitest",
+    "test:run": "vitest run"
   },
   "dependencies": {
     "@ant-design/icons-vue": "^6.1.0",
diff --git a/bigtop-manager-ui/pom.xml b/bigtop-manager-ui/pom.xml
index 010537f..23cc14a 100644
--- a/bigtop-manager-ui/pom.xml
+++ b/bigtop-manager-ui/pom.xml
@@ -34,6 +34,7 @@
         <node.version>v18.17.0</node.version>
         <pnpm.version>v8.6.9</pnpm.version>
         <frontend-maven-plugin.version>1.13.4</frontend-maven-plugin.version>
+        <skip.pnpm.test>false</skip.pnpm.test>
     </properties>
 
     <build>
@@ -63,7 +64,7 @@
                         </goals>
                         <phase>generate-resources</phase>
                         <configuration>
-                            <arguments>install --force</arguments>
+                            <arguments>install</arguments>
                         </configuration>
                     </execution>
                     <execution>
@@ -76,6 +77,17 @@
                             <arguments>build</arguments>
                         </configuration>
                     </execution>
+                    <execution>
+                        <id>pnpm test</id>
+                        <goals>
+                            <goal>pnpm</goal>
+                        </goals>
+                        <phase>test</phase>
+                        <configuration>
+                            <arguments>test:run</arguments>
+                            <skip>${skip.pnpm.test}</skip>
+                        </configuration>
+                    </execution>
                 </executions>
             </plugin>
         </plugins>

Reply via email to