Skip to content
This repository was archived by the owner on Dec 28, 2025. It is now read-only.

Commit 322c848

Browse files
fixed wrong formats and descriptions
1 parent d46b0a3 commit 322c848

File tree

7 files changed

+216
-97
lines changed

7 files changed

+216
-97
lines changed

.github/workflows/auto-pr-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
name: "Auto PR Commenter"
18+
name: "Auto PR AI Review""
1919
2020
on:
2121
pull_request_target:

content/cn/docs/guides/toolchain-local-test.md

Lines changed: 116 additions & 58 deletions
Large diffs are not rendered by default.

content/en/docs/guides/toolchain-local-test.md

Lines changed: 99 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This guide aims to help developers efficiently run tests for the HugeGraph toolc
1111

1212
### 1.1 Core Dependency: HugeGraph Server
1313

14-
In the testing of the HugeGraph toolchain, **HugeGraph Server is the core dependency for the vast majority of integration and functional tests**. It provides the core services of the graph database, and many components in the toolchain (such as Client, Loader, Hubble, Spark Connector, Tools) need to interact with the Server to perform their functions and be tested. Therefore, a properly configured and running HugeGraph Server is a prerequisite for complete functional testing. This guide will explain how to install/build HugeGraph Server in the sections below.
14+
In the testing of the HugeGraph toolchain, **HugeGraph Server is the core dependency for most integration and functional tests**. It provides the core services of the graph database, and many components in the toolchain (such as Client, Loader, Hubble, Spark Connector, Tools) need to interact with the Server to perform their functions and be tested. Therefore, a properly configured and running HugeGraph Server is a prerequisite for complete functional testing. This guide will explain how to install/build HugeGraph Server in the sections below.
1515

1616
### 1.2 Explanation of Test Suite Types
1717

@@ -25,7 +25,7 @@ In the testing of the HugeGraph toolchain, you may encounter the following commo
2525
* **Characteristics**: Requires a running server (like HugeGraph Server) to respond to API requests.
2626

2727
* **Functional Tests (Functional Tests / FuncTestSuite)**:
28-
* **Goal**: To verify that a specific function of a system or component works as required. They are used to simulate user scenarios or business processes, involve the interaction of multiple components, and are end-to-end tests.
28+
* **Goal**: To verify that a specific function of a system or component works as required. They simulate user scenarios or business processes and involve interactions between multiple components, and are end-to-end tests.
2929
* **Characteristics**: They take a relatively long time to execute, require a complete system environment (including all dependent services) to run, and can identify issues at the integration level.
3030

3131
## 2. Pre-Test Preparation
@@ -67,13 +67,18 @@ This method allows you to compile and install a specific version of HugeGraph Se
6767
* **`$DB_DATABASE` & `$DB_PASS`**
6868
* Specify the name of the MySQL database and the root user password for the connection used in HugeGraph-Loader's JDBC tests. Providing this database connection information allows the Loader to read and write data correctly. Pass them directly as parameters to the `install-mysql.sh` script.
6969

70-
#### 3.1.2 Test Processing
70+
#### 3.1.2 Execution Process
7171

7272
**Install and Start HugeGraph Server**
7373

7474
If you choose to install manually, you can use the following script to install HugeGraph Server. The script is located in the `/assembly/travis/` directory of any tool's repository. It is used to pull the HugeGraph Server source code from a specified commit ID, compile it, unzip it, and start the service via both http and https.
7575
```bash
76-
hugegraph-*/assembly/travis/install-hugegraph-from-source.sh $COMMIT_ID
76+
# Example: Set the HugeGraph Server version to install
77+
export COMMIT_ID="master" # Use the latest code from the master branch
78+
# or
79+
export COMMIT_ID="8b90977" # Use a specific commit hash (please adjust based on compatibility)
80+
# Then execute the installation
81+
hugegraph-client/assembly/travis/install-hugegraph-from-source.sh $COMMIT_ID
7782
```
7883

7984
* `$COMMIT_ID`: Specifies the Git Commit ID of HugeGraph Server.
@@ -103,14 +108,18 @@ By using the officially released `hugegraph-server` Docker image, you can quickl
103108
#### Quick Start with Docker
104109

105110
```bash
106-
docker run -itd --name=server -p 8080:8080 hugegraph/hugegraph:latest
111+
# 1. First, create the network
112+
docker network create hugegraph-net
113+
114+
# 2. Start the server and join the network
115+
docker run -itd --name=server -p 8080:8080 --network hugegraph-net hugegraph/hugegraph:latest
107116
```
108117

109118
This quickly starts a HugeGraph server with built-in RocksDB, which meets the requirements for most tests and toolchain components.
110119

111120
#### Example `docker-compose.yml` File
112121

113-
The following is an example `docker-compose.yml` file that defines the HugeGraph Server, MySQL, and Hadoop (HDFS) services. You can adjust it according to your actual testing needs.
122+
The following is an example `docker-compose.yml` file that defines the HugeGraph Server, MySQL, and Hadoop (HDFS) services. You can adjust it according to your actual testing needs. Please use Docker Compose V2.
114123

115124
```yaml
116125
version: '3.8'
@@ -202,6 +211,9 @@ services:
202211
networks:
203212
hugegraph-net:
204213
driver: bridge
214+
volumes:
215+
namenode_data:
216+
datanode_data:
205217
```
206218
207219
#### Hadoop Configuration Mounts
@@ -265,7 +277,7 @@ networks:
265277
lsof -i:3306 # mysql port
266278
```
267279

268-
4. **Stop Services**: After testing is complete, you can stop and remove all containers:
280+
4. **Stop Services**: After testing is complete, you can stop and remove all services:
269281

270282
```bash
271283
docker compose down
@@ -276,7 +288,7 @@ networks:
276288
Generally, the local testing process for each tool is as follows, which will be explained in detail below.
277289

278290
<div style="text-align: center;">
279-
<img src="/docs/images/toolchain-test-mermaid-4.png" alt="HugeGraph Toolchain Testing Process">
291+
<img src="./../images/toolchain-test-mermaid-2.png" alt="HugeGraph Toolchain Testing Process">
280292
</div>
281293

282294

@@ -300,28 +312,45 @@ mvn -e compile -pl hugegraph-client -Dmaven.javadoc.skip=true -ntp
300312

301313
Follow the instructions in [Deploying the Test Environment](#3-deploying-the-test-environment) to start `hugegraph-server`.
302314

303-
##### Server Authentication Settings (Authentication tests are not supported for Docker image versions <= 1.5.0)
315+
##### Server Authentication Settings
304316

317+
> **Warning:** Authentication tests are **not supported** for Docker image versions <= 1.5.0. Please ensure you are using a newer version if you intend to run authentication-related tests.
305318
Since the client's ApiTest includes authentication tests, you must ensure that the server's password is the same as in the test code; otherwise, data transfer between the client and server will fail. If you use the client's built-in script to install and start the server, you can skip this step.
306319
However, if you start the server using other methods, you must perform the following authentication settings, as the default server does not have them set. For example, enter the container environment with `docker exec -it server bash` to make modifications.
307320

308321
```bash
309-
# Step 1: Modify the authentication mode
310-
vi conf/rest-server.properties
311-
```
312-
Change line 23 from `auth.authenticator=` to `auth.authenticator=org.apache.hugegraph.auth.StandardAuthenticator`
322+
# Step 1: Modify Authentication Mode
323+
# 1. Backup the original configuration file
324+
cp conf/rest-server.properties conf/rest-server.properties.backup
313325
314-
```bash
315-
# Step 2: Set the password
326+
# Find the line `auth.authenticator=` and change it to `auth.authenticator=org.apache.hugegraph.auth.StandardAuthenticator`
327+
sed -i '/^auth.authenticator=/c\auth.authenticator=org.apache.hugegraph.auth.StandardAuthenticator' conf/rest-server.properties
328+
329+
# 3. Confirm the modification was successful
330+
grep auth.authenticator conf/rest-server.properties
331+
332+
# Step 2: Set Password
316333
bin/stop-hugegraph.sh
317-
echo -e "pa" | bin/init-store.sh # This script initializes the HugeGraph store and sets default user credentials, including the password for authentication tests
334+
echo -e "pa" | bin/init-store.sh # This script initializes the HugeGraph store and sets default user credentials, including the password for authentication testing
318335
bin/start-hugegraph.sh
319336
```
320337

321338
#### 4.1.3 Run Tests
322339

323340
Go to the `hugegraph-client` module directory and run the tests:
324341

342+
**Pre-condition Check**:
343+
```bash
344+
# 1. Confirm that you are in the hugegraph-toolchain root directory
345+
pwd # Should display .../hugegraph-toolchain
346+
347+
# 2. Confirm that HugeGraph Server has been started
348+
curl -s http://localhost:8080/graphs
349+
350+
# 3. If authentication is used, confirm the configuration is correct
351+
curl -u admin:pa http://localhost:8080/graphs
352+
```
353+
325354
```bash
326355
cd hugegraph-client
327356
mvn test -Dtest=UnitTestSuite -ntp
@@ -331,6 +360,7 @@ mvn test -Dtest=FuncTestSuite -ntp
331360

332361
* The unit test mainly depends on the compilation of `hugegraph-client` itself and is used to test the internal logic of the client.
333362
* Other test modules require a running HugeGraph-Server service.
363+
* Please check server log if tests failed: logs/hugegraph-server.log
334364

335365
### 4.2 hugegraph-loader Local Testing
336366

@@ -349,7 +379,7 @@ mvn install -pl hugegraph-client,hugegraph-loader -am -Dmaven.javadoc.skip=true
349379
Follow the instructions in [Deploying the Test Environment](#3-deploying-the-test-environment) to start `hugegraph-server`, `Hadoop (HDFS)` (only required when running HDFS tests), and `MySQL` (only required when running JDBC tests).
350380

351381
<div style="text-align: center;">
352-
<img src="/docs/images/toolchain-test-mermaid-3.png" alt="HugeGraph Loader Testing Process">
382+
<img src="./../images/toolchain-test-mermaid-1.png" alt="HugeGraph Loader Testing Process">
353383
</div>
354384

355385
#### 4.2.3 Run Tests
@@ -390,38 +420,69 @@ mvn -e compile -Dmaven.javadoc.skip=true -ntp
390420

391421
#### 4.3.2 Dependent Service Installation
392422

423+
**1. Start HugeGraph Server**
424+
393425
Follow the instructions in [Deploying the Test Environment](#3-deploying-the-test-environment) to start `hugegraph-server`.
394426

395-
**Install Other Hubble Dependencies**
427+
**2. Install Python Dependencies**
396428

397-
* **Python Dependencies**:
398-
```bash
399-
python -m pip install -r hubble-dist/assembly/travis/requirements.txt
400-
```
401-
* **Note**: Hubble tests require Python >= 3.11. It is recommended to use a virtual environment: `python -m venv venv && source venv/bin/activate`.
429+
Hubble's certain features require Python support:
402430

403-
* **Hubble Packaging**:
404-
```bash
405-
mvn package -Dmaven.test.skip=true
406-
cd apache-hugegraph-hubble-incubating-${version}/bin/bin
407-
./start-hubble.sh -d
408-
./stop-hubble.sh
409-
```
410-
Package Hubble, verify that it can start and stop normally to ensure it is built correctly and executable, preparing for subsequent tests.
431+
```bash
432+
# Recommended to use virtual environment
433+
python -m venv venv
434+
source venv/bin/activate # Windows: venv\Scripts\activate
435+
436+
# Install dependencies
437+
cd hugegraph-hubble
438+
python -m pip install -r hubble-dist/assembly/travis/requirements.txt
439+
```
440+
441+
**3. Build Hubble Package**
442+
443+
```bash
444+
# In hugegraph-hubble directory
445+
mvn package -Dmaven.test.skip=true
446+
447+
# Verify build artifacts
448+
ls apache-hugegraph-hubble-incubating-*/
449+
```
450+
451+
**4. Verify Hubble Executability (Optional, for confirming environment correctness)**
452+
453+
```bash
454+
# When version is 1.5.0
455+
cd apache-hugegraph-hubble-incubating-1.5.0/bin
456+
./start-hubble.sh -d
457+
sleep 10
458+
curl http://localhost:8088/api/health # Check Hubble health status
459+
./stop-hubble.sh
460+
```
411461

412462
#### 4.3.3 Run Tests
413463

414464
Go to the `hugegraph-hubble` module directory and run the tests:
415465

416466
```bash
417467
mvn test -P unit-test -pl hugegraph-hubble/hubble-be -ntp # Unit Test
418-
hubble-dist/assembly/travis/run-api-test.sh # API Test
468+
469+
# API tests require both HugeGraph Server and Hubble services to be running.
470+
471+
# 1. Confirm Server is running on port 8080
472+
curl http://localhost:8080/graphs
473+
474+
# 2. Confirm Hubble is running on port 8088
475+
curl http://localhost:8088/api/health
476+
477+
# 3. Execute API tests
478+
cd hugegraph-hubble/hubble-dist
479+
hubble-dist/assembly/travis/run-api-test.sh #API Test
419480
```
420481

421-
* The unit test mainly depends on the compilation of `hubble-be` itself and runs the unit tests for the Hubble backend (Java part).
422-
* `run-api-test` requires a running HugeGraph-Server service, as well as the proper functioning of the client and loader.
482+
* unit test mainly depends on the compilation of `hubble-be` itself, running Hubble backend (Java part) unit tests.
483+
* run-api-test requires a running HugeGraph-Server service, as well as normal operation of client and loader.
423484

424-
**Important Note**: Before running API tests, make sure to install the client and loader, and ensure that both HugeGraph Server and HugeGraph-Hubble services are started and accessible.
485+
**Important Note**: Before running API tests, be sure to complete client and loader installation, and ensure that both HugeGraph Server and HugeGraph-Hubble services are started and accessible.
425486

426487
### 4.4 hugegraph-spark-connector Local Testing
427488

@@ -462,7 +523,7 @@ Compile the `hugegraph-client` and `hugegraph-tools` modules:
462523
mvn install -pl hugegraph-client,hugegraph-tools -am -Dmaven.javadoc.skip=true -DskipTests -ntp
463524
```
464525

465-
#### 4.5.2 Dependent Service Installation (Choose one)
526+
#### 4.5.2 Dependent Service Installation
466527

467528
Follow the instructions in [Deploying the Test Environment](#3-deploying-the-test-environment) to start `hugegraph-server`.
468529

@@ -500,14 +561,14 @@ This section lists some common problems that may be encountered during local tes
500561
* **Troubleshooting**:
501562
* Ensure that Hadoop's NameNode and DataNode services are running normally and the HDFS file system is accessible.
502563
* Check Hadoop's logs, especially the DataNode's logs, to ensure that data blocks are being replicated and operated on correctly.
503-
* If using Docker, ensure the Hadoop container is healthy and the test program can correctly connect to the HDFS service.
564+
* If using Docker, ensure the Hadoop service is healthy and the test program can correctly connect to the HDFS service.
504565

505566
* **JDBC Test Issues**:
506567
* **Problem Description**: JDBC tests for HugeGraph-Loader fail.
507568
* **Troubleshooting**:
508569
* Ensure the MySQL database service is running normally and that the database name, username, and password you provided are correct.
509570
* Check MySQL's logs for any connection or permission issues.
510-
* If using Docker, ensure the MySQL container is healthy and the test program can correctly connect to the MySQL service.
571+
* If using Docker, ensure the MySQL service is healthy and the test program can correctly connect to the MySQL service.
511572

512573
## 6. References
513574

-11.7 KB
Loading
-541 Bytes
Loading
-118 KB
Binary file not shown.
-29.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)