Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 97 additions & 20 deletions .github/workflows/pd-store-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
with:
fetch-depth: 5

- name: Run JaCoCo report validator tests
run: hugegraph-server/hugegraph-dist/src/assembly/travis/test-check-jacoco-report.sh

- name: Use staged maven repo settings
run: |
cp $HOME/.m2/settings.xml /tmp/settings.xml || true
Expand Down Expand Up @@ -65,7 +68,8 @@ jobs:
USE_STAGE: 'false' # Whether to include the stage repository.
# TODO: remove outdated env
TRAVIS_DIR: hugegraph-server/hugegraph-dist/src/assembly/travis
REPORT_DIR: target/site/jacoco
REPORT_FILE: hugegraph-pd/hg-pd-test/target/site/jacoco/jacoco.xml
TEST_REPORT_DIR: hugegraph-pd/hg-pd-test/target/surefire-reports

steps:
- name: Install JDK 11
Expand All @@ -92,20 +96,26 @@ jobs:
cp $HOME/.m2/settings.xml /tmp/settings.xml
mv -vf .github/configs/settings.xml $HOME/.m2/settings.xml

- name: Run common test
- name: Package
# todo remove --fail-at-end after test
run: |
mvn test -pl hugegraph-pd/hg-pd-test -am -P pd-common-test
mvn clean package -U -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -ntp --fail-at-end

- name: Run core test
- name: Check source formatting
run: |
mvn test -pl hugegraph-pd/hg-pd-test -am -P pd-core-test
mvn editorconfig:check -pl hugegraph-pd/hg-pd-test -am -ntp

# The above tests do not require starting a PD instance.
# These tests do not require starting a PD instance. Run them after the
# clean package so their JaCoCo data survives until the final report.
- name: Run common test
run: |
mvn test -pl hugegraph-pd/hg-pd-test -am \
-P pd-common-test -Djacoco.sessionId=pd-common-test

- name: Package
# todo remove --fail-at-end after test
- name: Run core test
run: |
mvn clean package -U -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -ntp --fail-at-end
mvn test -pl hugegraph-pd/hg-pd-test -am \
-P pd-core-test -Djacoco.sessionId=pd-core-test

- name: Check startup test prerequisites (PD)
id: pd-preflight
Expand Down Expand Up @@ -139,16 +149,41 @@ jobs:

- name: Run client test
run: |
mvn test -pl hugegraph-pd/hg-pd-test -am -P pd-client-test
mvn test -pl hugegraph-pd/hg-pd-test -am \
-P pd-client-test -Djacoco.sessionId=pd-client-test

- name: Run rest test
run: |
mvn test -pl hugegraph-pd/hg-pd-test -am -P pd-rest-test
mvn test -pl hugegraph-pd/hg-pd-test -am \
-P pd-rest-test -Djacoco.sessionId=pd-rest-test

- name: Generate aggregate coverage report
run: |
mvn verify -pl hugegraph-pd/hg-pd-test -am -P jacoco \
-DskipTests -Deditorconfig.skip=true -ntp

- name: Validate aggregate coverage report
run: |
$TRAVIS_DIR/check-jacoco-report.sh \
--require-test-report \
"$TEST_REPORT_DIR/TEST-org.apache.hugegraph.pd.common.CommonSuiteTest.xml" \
--require-test-report \
"$TEST_REPORT_DIR/TEST-org.apache.hugegraph.pd.core.PDCoreSuiteTest.xml" \
--require-test-report \
"$TEST_REPORT_DIR/TEST-org.apache.hugegraph.pd.client.PDClientSuiteTest.xml" \
--require-test-report \
"$TEST_REPORT_DIR/TEST-org.apache.hugegraph.pd.rest.PDRestSuiteTest.xml" \
--require-session pd-common-test \
--require-session pd-core-test \
--require-session pd-client-test \
--require-session pd-rest-test \
"$REPORT_FILE" \
hg-pd-grpc hg-pd-common hg-pd-client hg-pd-core hg-pd-service hg-pd-dist

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.0.0
with:
file: ${{ env.REPORT_DIR }}/*.xml
files: ${{ env.REPORT_FILE }}

store:
needs: struct
Expand All @@ -157,7 +192,8 @@ jobs:
USE_STAGE: 'false' # Whether to include the stage repository.
# TODO: remove outdated env
TRAVIS_DIR: hugegraph-server/hugegraph-dist/src/assembly/travis
REPORT_DIR: target/site/jacoco
REPORT_FILE: hugegraph-store/hg-store-test/target/site/jacoco/jacoco.xml
TEST_REPORT_DIR: hugegraph-store/hg-store-test/target/surefire-reports

steps:
- name: Install JDK 11
Expand Down Expand Up @@ -189,6 +225,10 @@ jobs:
run: |
mvn clean package -U -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -ntp --fail-at-end

- name: Check source formatting
run: |
mvn editorconfig:check -pl hugegraph-store/hg-store-test -am -ntp

- name: Check startup test prerequisites (Store)
id: store-preflight
run: |
Expand Down Expand Up @@ -228,32 +268,69 @@ jobs:

- name: Run common test
run: |
mvn test -pl hugegraph-store/hg-store-test -am -P store-common-test
mvn test -pl hugegraph-store/hg-store-test -am \
-P store-common-test -Djacoco.sessionId=store-common-test

- name: Run client test
run: |
mvn test -pl hugegraph-store/hg-store-test -am -P store-client-test
mvn test -pl hugegraph-store/hg-store-test -am \
-P store-client-test -Djacoco.sessionId=store-client-test

- name: Run core test
run: |
mvn test -pl hugegraph-store/hg-store-test -am -P store-core-test
mvn test -pl hugegraph-store/hg-store-test -am \
-P store-core-test -Djacoco.sessionId=store-core-test

- name: Run rocksdb test
run: |
mvn test -pl hugegraph-store/hg-store-test -am -P store-rocksdb-test
mvn test -pl hugegraph-store/hg-store-test -am \
-P store-rocksdb-test -Djacoco.sessionId=store-rocksdb-test

- name: Run server test
run: |
mvn test -pl hugegraph-store/hg-store-test -am -P store-server-test
mvn test -pl hugegraph-store/hg-store-test -am \
-P store-server-test -Djacoco.sessionId=store-server-test

- name: Run raft-core test
run: |
mvn test -pl hugegraph-store/hg-store-test -am -P store-raftcore-test
mvn test -pl hugegraph-store/hg-store-test -am \
-P store-raftcore-test -Djacoco.sessionId=store-raftcore-test

- name: Generate aggregate coverage report
Comment thread
contrueCT marked this conversation as resolved.
run: |
mvn verify -pl hugegraph-store/hg-store-test -am -P jacoco \
-DskipTests -Deditorconfig.skip=true -ntp

- name: Validate aggregate coverage report
run: |
# CoreSuiteTest and ServerSuiteTest are existing placeholders with zero tests.
$TRAVIS_DIR/check-jacoco-report.sh \
--require-test-report \
"$TEST_REPORT_DIR/TEST-org.apache.hugegraph.store.common.CommonSuiteTest.xml" \
--require-test-report \
"$TEST_REPORT_DIR/TEST-org.apache.hugegraph.store.client.ClientSuiteTest.xml" \
--require-suite-report \
"$TEST_REPORT_DIR/TEST-org.apache.hugegraph.store.core.CoreSuiteTest.xml" \
--require-test-report \
"$TEST_REPORT_DIR/TEST-org.apache.hugegraph.store.rocksdb.RocksDbSuiteTest.xml" \
--require-suite-report \
"$TEST_REPORT_DIR/TEST-org.apache.hugegraph.store.service.ServerSuiteTest.xml" \
--require-test-report \
"$TEST_REPORT_DIR/TEST-org.apache.hugegraph.store.raftcore.RaftSuiteTest.xml" \
--require-session store-common-test \
--require-session store-client-test \
--require-session store-core-test \
--require-session store-rocksdb-test \
--require-session store-server-test \
--require-session store-raftcore-test \
"$REPORT_FILE" \
hg-store-grpc hg-store-common hg-store-client hg-store-rocksdb \
hg-store-core hg-store-node

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.0.0
with:
file: ${{ env.REPORT_DIR }}/*.xml
files: ${{ env.REPORT_FILE }}

hstore:
needs: struct
Expand Down
37 changes: 10 additions & 27 deletions hugegraph-pd/hg-pd-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,19 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<configuration>
<excludes>
<exclude>**/grpc/**.*</exclude>
<exclude>**/config/**.*</exclude>
</excludes>
</configuration>
<version>0.8.8</version>
<executions>
<execution>
<id>coverage-report</id>
<phase>verify</phase>
<goals>
<goal>prepare-agent</goal>
<goal>report-aggregate</goal>
</goals>
<configuration>
<outputDirectory>
${project.basedir}/target/site/jacoco
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
Expand Down Expand Up @@ -258,25 +259,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<executions>
<execution>
<id>pre-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>post-test</id>
<phase>test</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/site/jacoco</outputDirectory>
</configuration>
</execution>
</executions>
<version>0.8.8</version>
<configuration>
<excludes>
<exclude>org/apache/hugegraph/pd/rest/*.class</exclude>
Expand Down
3 changes: 2 additions & 1 deletion hugegraph-pd/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.8</version>
<configuration>
<append>true</append>
<excludes>
<exclude>**/grpc/**.*</exclude>
<exclude>**/config/**.*</exclude>
Expand Down
Loading
Loading