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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]