Support for the remote debugging of local E2E testing framework #5196
Closed
codeglzhang wants to merge 5 commits intoapache:masterfrom
codeglzhang:master
Closed
Support for the remote debugging of local E2E testing framework #5196codeglzhang wants to merge 5 commits intoapache:masterfrom codeglzhang:master
codeglzhang wants to merge 5 commits intoapache:masterfrom
codeglzhang:master
Conversation
… exposed ports of containers. 2. Check a port whether is exposed by the container.
…ote debugging port and host port.
…ontainer: 1.Add exposed 5005 port. 2.Add "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", which is remote debugging parameter of JVM.
Codecov Report
@@ Coverage Diff @@
## master #5196 +/- ##
=============================================
- Coverage 53.50% 31.64% -21.87%
=============================================
Files 1458 1392 -66
Lines 31359 29743 -1616
Branches 3460 3715 +255
=============================================
- Hits 16778 9411 -7367
- Misses 13776 19506 +5730
- Partials 805 826 +21 Continue to review full report at Codecov.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please answer these questions before submitting pull request
Why submit this pull request?
Bug fix
New feature provided
Improve performance
Related issues
Bug fix
Bug description.
How to fix?
New feature or improvement
Motivation
If a developer fails to execute the E2E test locally, he needs to judge the bug through the log output, correct the code, and executing the E2E test again to check whether the bug is fixed. This process is time-consuming, especially in finding bugs and re-deploying the E2E test environment. If the test framework allows developers to debug remotely during local E2E testing, a lot of time will be saved.
Goals
Method
Judging the environment
In the original code, the variable
IS_CIis used to judge the environment whether is a ci environment. Thus, we also use it to judge the environment.Remote debugging port
We designated
5005as the remote debugging port of a container. If a container requires the remote debugging, it needs to expose the port5005. The program judges a container whether exposes the port5005by using the commanddocker-compose config. The commanddocker-compose configcan get the all config information even if thedocker-compose.ymlinherits other configuration files, like skywalking/test/e2e/e2e-test/docker/simple/jdk/docker-compose.yml.Getting Remote debugging containers
If the container exposes the port
5005, the program will add it to a list. Containers in this list need the remote debugging.Binding the remote debugging port
After getting the remote debugging containers, the program uses the
testcontainersframework to map the port5005of containers to the ports not used by the host and write the mapping information to a fileremote_real_port.Compatibility
Because no previous container configuration exposed the port
5005, the change is no effect on previous versions.Using remote debugging
For the developers, if they want to use remote debugging, they only need to add the remote debugging parameters to the configuration file
docker-compose.ymland expose the port5005. For example, this is the configuration of a container in the skywalking/test/e2e/e2e-test/docker/base-compose.yml.To using remote debugging, the configuration adds the debugging parameters
agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005of JAVA and exposes the port5005.Then, if the E2E test failed and is retrying, the developer can get the ports mapping in the file
skywalking/test/e2e/e2e-test/remote_real_portand selects the host port of the corresponding service for remote debugging.