Skip to content

Commit

Permalink
chore: adapt hg-pd-common tests
Browse files Browse the repository at this point in the history
  • Loading branch information
VGalaxies committed Feb 26, 2024
1 parent cd7d7fc commit a5fd93f
Show file tree
Hide file tree
Showing 46 changed files with 94 additions and 5,196 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/pd-store.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "pd-store"

on:
push:
branches:
- master
- 'release-*'
- 'test-*'
pull_request:

jobs:
pd:
runs-on: ubuntu-latest
env:
USE_STAGE: 'true' # Whether to include the stage repository.
TRAVIS_DIR: hugegraph-server/hugegraph-dist/src/assembly/travis
REPORT_DIR: target/site/jacoco

steps:
- name: Install JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'

- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: use staged maven repo settings
if: ${{ env.USE_STAGE == 'true' }}
run: |
cp $HOME/.m2/settings.xml /tmp/settings.xml
mv -vf .github/configs/settings.xml $HOME/.m2/settings.xml
- name: Run common test
run: |
mvn test -pl hugegraph-pd/hg-pd-test -am -P pd-common-test
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
file: ${{ env.REPORT_DIR }}/*.xml
122 changes: 11 additions & 111 deletions hugegraph-pd/hg-pd-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@

<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hg-pd-client</artifactId>
<artifactId>hg-pd-common</artifactId>
<version>${revision}</version>
</dependency>

Expand All @@ -105,11 +105,6 @@
<artifactId>gson</artifactId>
<version>2.8.9</version>
</dependency>
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hg-pd-grpc</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand All @@ -131,28 +126,6 @@
<version>2.13.0</version>
</dependency>


<!--dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.9.0</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.7.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.7.4</version>
<scope>test</scope>
</dependency-->

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand All @@ -164,46 +137,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hg-pd-clitools</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hg-pd-common</artifactId>
<version>${revision}</version>

</dependency>
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hg-pd-core</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hg-pd-dist</artifactId>
<version>${revision}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hg-pd-service</artifactId>
<version>${revision}</version>
</dependency>
<!--dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.7.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.7.4</version>
<scope>compile</scope>
</dependency-->


<dependency>
<groupId>org.powermock</groupId>
Expand All @@ -223,62 +156,31 @@
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>2.0.0-RC.3</version>
<version>${powermock.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>2.0.0-RC.3</version>
<version>${powermock.version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.14.0</version>
<scope>compile</scope>
</dependency>
</dependencies>


<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<executions>
<execution>
<id>pd-client-test</id>
<configuration>
<testSourceDirectory>${basedir}/src/main/java/
</testSourceDirectory>
<testClassesDirectory>${basedir}/target/classes/
</testClassesDirectory>
<includes>
<include>**/PDClientSuiteTest.java</include>
</includes>
</configuration>
</execution>
<execution>
<id>pd-core-test</id>
<configuration>
<testSourceDirectory>${basedir}/src/main/java/
</testSourceDirectory>
<testClassesDirectory>${basedir}/target/classes/
</testClassesDirectory>
<includes>
<include>**/PDCoreSuiteTest.java</include>
</includes>
</configuration>
</execution>
<execution>
<id>pd-cli-tools-test</id>
<configuration>
<testSourceDirectory>${basedir}/src/main/java/
</testSourceDirectory>
<testClassesDirectory>${basedir}/target/classes/
</testClassesDirectory>
<includes>
<include>**/CliToolsSuiteTest.java</include>
</includes>
</configuration>
</execution>
<execution>
<id>pd-common-test</id>
<configuration>
Expand All @@ -292,14 +194,14 @@
</configuration>
</execution>
<execution>
<id>pd-service-test</id>
<id>pd-client-test</id>
<configuration>
<testSourceDirectory>${basedir}/src/main/java/
</testSourceDirectory>
<testClassesDirectory>${basedir}/target/classes/
</testClassesDirectory>
<includes>
<include>**/ServerSuiteTest.java</include>
<include>**/PDClientSuiteTest.java</include>
</includes>
</configuration>
</execution>
Expand Down Expand Up @@ -343,7 +245,6 @@
<exclude>org/apache/hugegraph/pd/grpc/**/*.class</exclude>
<exclude>org/apache/hugegraph/pd/raft/*.class</exclude>
<exclude>**/RaftKVStore.class</exclude>

</excludes>
</configuration>
</plugin>
Expand All @@ -355,5 +256,4 @@
</resource>
</resources>
</build>

</project>

This file was deleted.

Loading

0 comments on commit a5fd93f

Please sign in to comment.