You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hugegraph.apache.org by "Thespica (via GitHub)" <gi...@apache.org> on 2024/08/09 08:11:20 UTC

[I] [Doc][Developer] Documentation about how to run test [incubator-hugegraph-toolchain]

Thespica opened a new issue, #618:
URL: https://github.com/apache/incubator-hugegraph-toolchain/issues/618

   ### Search before asking
   
   - [X] I had searched in the [feature](https://github.com/apache/incubator-hugegraph-toolchain/issues?q=is%3Aissue+label%3A%22Feature%22) and found no similar feature requirement.
   
   
   ### Feature Description (εŠŸθƒ½ζθΏ°)
   
   Currently, it's little bit of complexity for developer who wants run test locally.
   
   For example, I want to run client's test, and fund it relying on hugegraph server. Okay, then I start HugeGraph server, the test still failed. Then I took a look to it's CI, and fund [this script](https://github.com/apache/incubator-hugegraph-toolchain/blob/master/hugegraph-client/assembly/travis/install-hugegraph-from-source.sh) which can not run directly on local.
   
   Running tests is a good approach to understand the code, maybe we should provide some documentations and scripts for developers that teach how to test locally?
   
   ### Are you willing to submit a PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [I] [Doc][Developer] Documentation about how to run test [incubator-hugegraph-toolchain]

Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on issue #618:
URL: https://github.com/apache/incubator-hugegraph-toolchain/issues/618#issuecomment-2277722983

   @dosu help the dev/user to provide more info/details about how to run hugegraph-client test locally (or in IDEA)
   
   Or could you provide a simple way to run it quickly
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [I] [Doc][Developer] Documentation about how to run test [incubator-hugegraph-toolchain]

Posted by "Thespica (via GitHub)" <gi...@apache.org>.
Thespica commented on issue #618:
URL: https://github.com/apache/incubator-hugegraph-toolchain/issues/618#issuecomment-2957806467

   > Hello! I saw the post about first issues and found this is needed. Would it be okay if I worked on it and had it assigned to me? I would finish it as soon as possible
   
   Hi @sadwitdastreetz , you can have a try.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [I] [Doc][Developer] Documentation about how to run test [incubator-hugegraph-toolchain]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #618:
URL: https://github.com/apache/incubator-hugegraph-toolchain/issues/618#issuecomment-2277728316

   <!-- Greeting -->
   Hey @imbajin! πŸ‘‹ I'm here to help you with any bugs, questions, or contributions while you wait for the human maintainer.
   
   <!-- Answer -->
   To run the HugeGraph client tests locally or in IntelliJ IDEA, follow these steps:
   
   1. **Clone the HugeGraph repository and checkout the specific commit:**
       ```sh
       git clone --depth 150 https://github.com/apache/hugegraph.git hugegraph
       cd hugegraph
       git checkout <COMMIT_ID>
       ```
   
   2. **Build the HugeGraph server:**
       ```sh
       mvn package -DskipTests -Dmaven.javadoc.skip=true -ntp
       ```
   
   3. **Extract the HugeGraph server package:**
       ```sh
       cd hugegraph-server
       mv apache-hugegraph-*.tar.gz ../../
       cd ../../
       rm -rf hugegraph
       tar zxf apache-hugegraph-*.tar.gz
       ```
   
   4. **Configure and start the HugeGraph server:**
       ```sh
       HTTP_SERVER_DIR=$(echo apache-hugegraph-*.*)
       HTTPS_SERVER_DIR="hugegraph_https"
   
       cp -r "${HTTP_SERVER_DIR}" "${HTTPS_SERVER_DIR}"
   
       # Config auth options just for http server (must keep '/.')
       cp -rf hugegraph-client/assembly/travis/conf/. "${HTTP_SERVER_DIR}"/conf/
   
       # Start HugeGraphServer with http protocol
       cd "${HTTP_SERVER_DIR}"
       echo -e "pa" | bin/init-store.sh
       bin/start-hugegraph.sh
       ```
   
   5. **Configure and start the HugeGraph server with HTTPS protocol:**
       ```sh
       cd ../"${HTTPS_SERVER_DIR}"
       REST_SERVER_CONFIG="conf/rest-server.properties"
       GREMLIN_SERVER_CONFIG="conf/gremlin-server.yaml"
       sed -i "s?http://127.0.0.1:8080?https://127.0.0.1:8443?g" "$REST_SERVER_CONFIG"
       sed -i "s/rpc.server_port=8091/rpc.server_port=8092/g" "$REST_SERVER_CONFIG"
       sed -i "s/#port: 8182/port: 8282/g" "$GREMLIN_SERVER_CONFIG"
       echo "gremlinserver.url=http://127.0.0.1:8282" >> ${REST_SERVER_CONFIG}
   
       # Start HugeGraphServer with https protocol
       bin/init-store.sh
       bin/start-hugegraph.sh
       ```
   
   6. **Run the tests in IntelliJ IDEA:**
       - Open IntelliJ IDEA and import the HugeGraph client project.
       - Ensure that the HugeGraph server is running.
       - Run the tests from the test classes or test methods in IntelliJ IDEA.
   
   Additionally, you can follow the detailed guide provided in the HugeGraph documentation for setting up and debugging the HugeGraph server in IntelliJ IDEA:
   
   1. **Copy Configuration Files:**
       ```bash
       cp -r hugegraph-dist/src/assembly/static/scripts hugegraph-dist/src/assembly/static/conf path-to-your-directory
       ```
   
   2. **Configure `InitStore` to initialize the graph:**
       - Configure the database backend in `path-to-your-directory/conf/graphs/hugegraph.properties`:
           ```properties
           backend=rocksdb
           serializer=binary
           rocksdb.data_path=.
           rocksdb.wal_path=.
           ```
       - Create a new Application configuration in IntelliJ IDEA:
           - Use `hugegraph-dist` as the classpath of the module.
           - Set the Main class to `org.apache.hugegraph.cmd.InitStore`.
           - Set the program arguments to `conf/rest-server.properties`.
   
   3. **Running `HugeGraphServer`:**
       - Create a new Application configuration in IntelliJ IDEA:
           - Use `hugegraph-dist` as the classpath of the module.
           - Set the Main class to `org.apache.hugegraph.dist.HugeGraphServer`.
           - Set the program arguments to `conf/gremlin-server.yaml conf/rest-server.properties`.
   
   4. **Debugging `HugeGraphServer` (optional):**
       - Set breakpoints and use the RESTful API to request `HugeGraphServer`.
   
   5. **Log4j2 Configuration:**
       - Modify the Log4j2 configuration file path in IntelliJ IDEA to `conf/log4j2.xml`.
   
   By following these steps and the detailed guide, you can manually set up the HugeGraph server and run the client tests locally or in IntelliJ IDEA <sup>[[1]](https://github.com/apache/incubator-hugegraph-toolchain/blob/master/hugegraph-client/assembly/travis/install-hugegraph-from-source.sh)</sup><sup>[[2]](https://github.com/apache/incubator-hugegraph-toolchain/blob/master/hugegraph-loader/assembly/travis/install-hugegraph-from-source.sh)</sup><sup>[[3]](https://github.com/apache/incubator-hugegraph-doc/blob/master/content/en/docs/contribution-guidelines/hugegraph-server-idea-setup.md)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [I] [Doc][Developer] Documentation about how to run test [incubator-hugegraph-toolchain]

Posted by "sadwitdastreetz (via GitHub)" <gi...@apache.org>.
sadwitdastreetz commented on issue #618:
URL: https://github.com/apache/incubator-hugegraph-toolchain/issues/618#issuecomment-2957776962

   Hello! I saw the post about first issues and found this is needed. Would it be okay if I worked on it and had it assigned to me? I would finish it as soon as possible


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org