You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "taojintianxia (via GitHub)" <gi...@apache.org> on 2023/01/28 08:24:47 UTC

[GitHub] [shardingsphere] taojintianxia opened a new pull request, #23777: Add : add document for remote debug testcontainer (#23759)

taojintianxia opened a new pull request, #23777:
URL: https://github.com/apache/shardingsphere/pull/23777

   Fixes #23759.
   
   Changes proposed in this pull request:
     - add document for remote debug testcontainer
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [ ] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [ ] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [ ] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [ ] I have added corresponding unit tests for my changes.
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] TeslaCN commented on a diff in pull request #23777: Add : add document for remote debug testcontainer (#23759)

Posted by "TeslaCN (via GitHub)" <gi...@apache.org>.
TeslaCN commented on code in PR #23777:
URL: https://github.com/apache/shardingsphere/pull/23777#discussion_r1089686888


##########
docs/document/content/test-manual/integration-test/_index.en.md:
##########
@@ -166,6 +166,31 @@ If you only modify the test code, you can reuse the existing test mirror without
 ./mvnw -B clean install -f shardingsphere-test/shardingsphere-test-e2e/shardingsphere-test-e2e-test-suite/pom.xml -Pit.env.docker -Dit.cluster.adapters=proxy,jdbc -Dit.scenarios=${scenario_name_1,scenario_name_2,scenario_name_n} -Dit.cluster.databases=MySQL
 ```
 
+#### Remote debug Proxy code in Docker container
+
+##### Remote debug Proxy started by docker image
+E2E Test Proxy image opens the 3308 port by default for remote debugging of the instance in the container.
+Use the following method to connect and debug the Proxy code in the container with IDE tools such as IDEA:
+
+IDEA -> Run -> Edit Configurations -> Add New Configuration -> Remote JVM Debug
+
+Edit the corresponding information:
+  - Name: A descriptive name, such as e2e-debug.
+  - Host: A IP that can access docker, such as 127.0.0.1
+  - Port: debugging port 3308.
+  - use module classpath: The root directory of the project shardingsphere.
+
+After editing the above information, run Run -> Run -> e2e-debug in IDEA to start the remote debug of IDEA.
+
+##### Remote debug Proxy started by Testcontainer
+> Note: If the Proxy container is started by Testcontainer, because the 3308 port is not exposed before Testcontainer starts, it cannot be debugged by the `Remote debug Proxy started by docker image` method.
+Debug Testcontainer started Proxy container by the following method:
+  - Set a breakpoint in the relevant startup class of Testcontainer, for example, after the line `containerComposer.start();` in BaseE2EIT#setUp() in the suite test, at this time, the relevant containers must have been started.
+  - Access breakpoint debugging mode through shortcut key Alt + F8, and view the port mapped by the 3308 mapping of the Proxy object under the containerComposer (the external mapping port of Testcontainer is random). For example, the expression `((ShardingSphereProxyClusterContainer)((java.util.LinkedList)((ITContainers)((ClusterContainerComposer)containerComposer).containers).dockerContainers).getLast()).getMappedPort(3308)` get the mapped random port 51837.

Review Comment:
   Could we just `docker ps` to get port?



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] tristaZero merged pull request #23777: Add : add document for remote debug testcontainer (#23759)

Posted by "tristaZero (via GitHub)" <gi...@apache.org>.
tristaZero merged PR #23777:
URL: https://github.com/apache/shardingsphere/pull/23777


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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