You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/07/29 17:43:41 UTC
[GitHub] [skywalking] codeglzhang opened a new pull request #5196: Support for the remote debugging of local E2E testing framework
codeglzhang opened a new pull request #5196:
URL: https://github.com/apache/skywalking/pull/5196
Please answer these questions before submitting pull request
- Why submit this pull request?
- [ ] Bug fix
- [x] New feature provided
- [ ] Improve performance
- Related issues
___
### Bug fix
- Bug description.
- How to fix?
___
### New feature or improvement
- Describe the details and related test reports.
### 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
1. Open the container debugging port in the local E2E test environment to bind with the host port to support remote debugging.
2. The remote debugging is simple and easy to use.
3. The remote debugging should be off in the ci environment.
### Method
#### Judging the environment
In the original code, the variable `IS_CI` is used to judge the environment whether is a ci environment. Thus, we also use it to judge the environment.
#### Remote debugging port
We designated `5005` as the remote debugging port of a container. If a container requires the remote debugging, it needs to expose the port `5005`. The program judges a container whether exposes the port `5005` by using the command `docker-compose config`. The command `docker-compose config` can get the all config information even if the `docker-compose.yml` inherits other configuration files, like [skywalking/test/e2e/e2e-test/docker/simple/jdk/docker-compose.yml](https://github.com/apache/skywalking/blob/master/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 `testcontainers` framework to map the port `5005` of containers to the ports not used by the host and write the mapping information to a file `remote_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.yml` and expose the port `5005`. For example, this is the configuration of a container in the [skywalking/test/e2e/e2e-test/docker/base-compose.yml](https://github.com/apache/skywalking/blob/master/test/e2e/e2e-test/docker/base-compose.yml).
```yml
oap:
image: skywalking/oap:latest
expose:
- 11800
- 12800
networks:
- e2e
restart: on-failure
volumes:
- ../../../jacoco:/jacoco
- ./download-mysql.sh:/download-mysql.sh
environment:
SW_CLUSTER_ZK_HOST_PORT: zk:2181
SW_STORAGE_ES_CLUSTER_NODES: es:9200
SW_JDBC_URL: jdbc:mysql://mysql:3306/swtest
SW_STORAGE_INFLUXDB_URL: http://influxdb:8086
JAVA_OPTS: >-
-javaagent:/jacoco/jacocoagent.jar=classdumpdir=/jacoco/classes/oap,destfile=/jacoco/oap.exec,includes=org.apache.skywalking.*,excludes=org.apache.skywalking.oap.query.*:org.apache.skywalking.oap.server.core.query.*
healthcheck:
test: ["CMD", "sh", "-c", "nc -zn 127.0.0.1 11800"]
interval: 5s
timeout: 60s
retries: 120
```
To using remote debugging, the configuration adds the debugging parameters `agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005` of JAVA and exposes the port `5005`.
```yml
oap:
image: skywalking/oap:latest
expose:
- 11800
- 12800
- 5005
networks:
- e2e
restart: on-failure
volumes:
- ../../../jacoco:/jacoco
- ./download-mysql.sh:/download-mysql.sh
environment:
SW_CLUSTER_ZK_HOST_PORT: zk:2181
SW_STORAGE_ES_CLUSTER_NODES: es:9200
SW_JDBC_URL: jdbc:mysql://mysql:3306/swtest
SW_STORAGE_INFLUXDB_URL: http://influxdb:8086
JAVA_OPTS: >-
-javaagent:/jacoco/jacocoagent.jar=classdumpdir=/jacoco/classes/oap,destfile=/jacoco/oap.exec,includes=org.apache.skywalking.*,excludes=org.apache.skywalking.oap.query.*:org.apache.skywalking.oap.server.core.query.*
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
healthcheck:
test: ["CMD", "sh", "-c", "nc -zn 127.0.0.1 11800"]
interval: 5s
timeout: 60s
retries: 120
```
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_port` and selects the host port of the corresponding service for remote debugging.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] codecov[bot] commented on pull request #5196: Support for the remote debugging of local E2E testing framework
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #5196:
URL: https://github.com/apache/skywalking/pull/5196#issuecomment-665521136
# [Codecov](https://codecov.io/gh/apache/skywalking/pull/5196?src=pr&el=h1) Report
> Merging [#5196](https://codecov.io/gh/apache/skywalking/pull/5196?src=pr&el=desc) into [master](https://codecov.io/gh/apache/skywalking/commit/5d7da1aead98e367582613d9caa04fb87385e8cd&el=desc) will **decrease** coverage by `53.30%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/skywalking/pull/5196?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #5196 +/- ##
============================================
- Coverage 53.30% 0.00% -53.31%
============================================
Files 803 153 -650
Lines 20019 3809 -16210
Branches 1938 450 -1488
============================================
- Hits 10672 0 -10672
+ Misses 8479 3809 -4670
+ Partials 868 0 -868
```
| [Impacted Files](https://codecov.io/gh/apache/skywalking/pull/5196?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...ywalking/apm/agent/core/logging/core/LogLevel.java](https://codecov.io/gh/apache/skywalking/pull/5196/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvbG9nZ2luZy9jb3JlL0xvZ0xldmVsLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-1.00%)` | |
| [...ywalking/apm/agent/core/plugin/EnhanceContext.java](https://codecov.io/gh/apache/skywalking/pull/5196/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcGx1Z2luL0VuaGFuY2VDb250ZXh0LmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-5.00%)` | |
| [...ywalking/apm/agent/core/profile/ProfileStatus.java](https://codecov.io/gh/apache/skywalking/pull/5196/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcHJvZmlsZS9Qcm9maWxlU3RhdHVzLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-1.00%)` | |
| [...walking/apm/agent/core/context/SW8CarrierItem.java](https://codecov.io/gh/apache/skywalking/pull/5196/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvY29udGV4dC9TVzhDYXJyaWVySXRlbS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-2.00%)` | |
| [...walking/apm/agent/core/jvm/cpu/SunCpuAccessor.java](https://codecov.io/gh/apache/skywalking/pull/5196/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvanZtL2NwdS9TdW5DcHVBY2Nlc3Nvci5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-2.00%)` | |
| [...walking/apm/agent/core/logging/core/LogOutput.java](https://codecov.io/gh/apache/skywalking/pull/5196/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvbG9nZ2luZy9jb3JlL0xvZ091dHB1dC5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-1.00%)` | |
| [...walking/apm/agent/core/plugin/match/NameMatch.java](https://codecov.io/gh/apache/skywalking/pull/5196/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcGx1Z2luL21hdGNoL05hbWVNYXRjaC5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-3.00%)` | |
| [...alking/apm/agent/core/context/CarrierItemHead.java](https://codecov.io/gh/apache/skywalking/pull/5196/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvY29udGV4dC9DYXJyaWVySXRlbUhlYWQuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-1.00%)` | |
| [...lking/apm/agent/core/remote/GRPCChannelStatus.java](https://codecov.io/gh/apache/skywalking/pull/5196/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvcmVtb3RlL0dSUENDaGFubmVsU3RhdHVzLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-1.00%)` | |
| [...king/apm/agent/core/jvm/memory/MemoryProvider.java](https://codecov.io/gh/apache/skywalking/pull/5196/diff?src=pr&el=tree#diff-YXBtLXNuaWZmZXIvYXBtLWFnZW50LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NreXdhbGtpbmcvYXBtL2FnZW50L2NvcmUvanZtL21lbW9yeS9NZW1vcnlQcm92aWRlci5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-3.00%)` | |
| ... and [772 more](https://codecov.io/gh/apache/skywalking/pull/5196/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/skywalking/pull/5196?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/skywalking/pull/5196?src=pr&el=footer). Last update [5d7da1a...ddce7ae](https://codecov.io/gh/apache/skywalking/pull/5196?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] codecov[bot] edited a comment on pull request #5196: Support for the remote debugging of local E2E testing framework
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #5196:
URL: https://github.com/apache/skywalking/pull/5196#issuecomment-665521136
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] codeglzhang closed pull request #5196: Support for the remote debugging of local E2E testing framework
Posted by GitBox <gi...@apache.org>.
codeglzhang closed pull request #5196:
URL: https://github.com/apache/skywalking/pull/5196
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org