Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
润土的好友猹
SkyWalking
提交
1601cc10
S
SkyWalking
项目概览
润土的好友猹
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
1601cc10
编写于
4月 11, 2020
作者:
静夜思朝颜
提交者:
GitHub
4月 11, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support `java` -> `nginx` -> `java` e2e test, and v3 protocol (#4637)
上级
31385159
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
163 addition
and
56 deletion
+163
-56
.github/workflows/e2e.yaml
.github/workflows/e2e.yaml
+2
-3
test/e2e/e2e-service-provider/src/main/java/org/apache/skywalking/e2e/lua/LuaController.java
...ain/java/org/apache/skywalking/e2e/lua/LuaController.java
+43
-0
test/e2e/e2e-test/docker/lua/Dockerfile.nginx
test/e2e/e2e-test/docker/lua/Dockerfile.nginx
+1
-1
test/e2e/e2e-test/docker/lua/docker-compose.yml
test/e2e/e2e-test/docker/lua/docker-compose.yml
+25
-2
test/e2e/e2e-test/docker/lua/nginx.conf
test/e2e/e2e-test/docker/lua/nginx.conf
+1
-1
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/LuaE2E.java
...-test/src/test/java/org/apache/skywalking/e2e/LuaE2E.java
+12
-5
test/e2e/e2e-test/src/test/resources/expected/lua/endpoints-end.yml
...2e-test/src/test/resources/expected/lua/endpoints-end.yml
+0
-0
test/e2e/e2e-test/src/test/resources/expected/lua/endpoints-entry.yml
...-test/src/test/resources/expected/lua/endpoints-entry.yml
+18
-0
test/e2e/e2e-test/src/test/resources/expected/lua/instances.yml
...2e/e2e-test/src/test/resources/expected/lua/instances.yml
+1
-1
test/e2e/e2e-test/src/test/resources/expected/lua/nginxEndpoints.yml
...e-test/src/test/resources/expected/lua/nginxEndpoints.yml
+1
-1
test/e2e/e2e-test/src/test/resources/expected/lua/nginxInstances.yml
...e-test/src/test/resources/expected/lua/nginxInstances.yml
+2
-2
test/e2e/e2e-test/src/test/resources/expected/lua/serviceInstanceTopo.yml
...t/src/test/resources/expected/lua/serviceInstanceTopo.yml
+14
-13
test/e2e/e2e-test/src/test/resources/expected/lua/services.yml
...e2e/e2e-test/src/test/resources/expected/lua/services.yml
+6
-4
test/e2e/e2e-test/src/test/resources/expected/lua/topo.yml
test/e2e/e2e-test/src/test/resources/expected/lua/topo.yml
+26
-21
test/e2e/e2e-test/src/test/resources/expected/lua/traces.yml
test/e2e/e2e-test/src/test/resources/expected/lua/traces.yml
+11
-2
未找到文件。
.github/workflows/e2e.yaml
浏览文件 @
1601cc10
...
...
@@ -72,9 +72,8 @@ jobs:
run
:
make docker
-
name
:
Copy dist package
run
:
cp -R dist test/e2e/
# TODO, LUA hasn't followed the v3 protocol
# - name: Nginx Lua
# run: ./mvnw --batch-mode -f test/e2e/pom.xml -am -DfailIfNoTests=false verify -Dit.test=org.apache.skywalking.e2e.LuaE2E
-
name
:
Nginx Lua
run
:
./mvnw --batch-mode -f test/e2e/pom.xml -am -DfailIfNoTests=false verify -Dit.test=org.apache.skywalking.e2e.LuaE2E
-
uses
:
actions/upload-artifact@v1
if
:
failure()
with
:
...
...
test/e2e/e2e-service-provider/src/main/java/org/apache/skywalking/e2e/lua/LuaController.java
0 → 100644
浏览文件 @
1601cc10
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.e2e.lua
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.client.RestTemplate
;
import
java.net.MalformedURLException
;
import
java.net.URISyntaxException
;
import
java.net.URL
;
@RestController
@RequiredArgsConstructor
public
class
LuaController
{
protected
final
RestTemplate
restTemplate
=
new
RestTemplate
();
@PostMapping
(
"/nginx/entry/info"
)
private
String
nginxEntry
(
String
backend
)
throws
MalformedURLException
,
URISyntaxException
{
final
URL
url
=
new
URL
(
"http://nginx:8080/nginx/info"
);
final
ResponseEntity
<
String
>
response
=
restTemplate
.
postForEntity
(
url
.
toURI
(),
null
,
String
.
class
);
return
response
.
getBody
();
}
}
test/e2e/e2e-test/docker/lua/Dockerfile.nginx
浏览文件 @
1601cc10
...
...
@@ -15,7 +15,7 @@
FROM openresty/openresty
ENV COMMIT_HASH=
9cebe51276d9a8a5b360ee1d9897e8bf803bda31
ENV COMMIT_HASH=
45cf64640047a4a54619fa1d3451b4d0a65a62d6
WORKDIR /usr/share/skywalking-nginx-lua
...
...
test/e2e/e2e-test/docker/lua/docker-compose.yml
浏览文件 @
1601cc10
...
...
@@ -42,7 +42,7 @@ services:
oap
:
condition
:
service_healthy
provider
:
provider
-entry
:
build
:
context
:
../../../
dockerfile
:
e2e-test/docker/Dockerfile.provider
...
...
@@ -52,6 +52,27 @@ services:
-
9090
environment
:
-
SW_AGENT_COLLECTOR_BACKEND_SERVICES=oap:11800
-
SW_AGENT_NAME=e2e-service-entry-provider
depends_on
:
oap
:
condition
:
service_healthy
healthcheck
:
test
:
[
"
CMD"
,
"
sh"
,
"
-c"
,
"
nc
-z
127.0.0.1
9090"
]
interval
:
5s
timeout
:
60s
retries
:
120
provider-end
:
build
:
context
:
../../../
dockerfile
:
e2e-test/docker/Dockerfile.provider
networks
:
-
e2e
expose
:
-
9090
environment
:
-
SW_AGENT_COLLECTOR_BACKEND_SERVICES=oap:11800
-
SW_AGENT_NAME=e2e-service-end-provider
depends_on
:
oap
:
condition
:
service_healthy
...
...
@@ -72,7 +93,9 @@ services:
depends_on
:
oap
:
condition
:
service_healthy
provider
:
# Just to make sure that the service id > provider service id
provider-entry
:
condition
:
service_healthy
provider-end
:
condition
:
service_healthy
volumes
:
-
../lua/nginx.conf:/var/nginx/conf.d/nginx.conf
...
...
test/e2e/e2e-test/docker/lua/nginx.conf
浏览文件 @
1601cc10
...
...
@@ -50,7 +50,7 @@ http {
require
("tracer"):start("User_Service_Name")
}
proxy_pass
http://provider:9090/info
;
proxy_pass
http://provider
-end
:9090/info
;
body_filter_by_lua_block
{
require
("tracer"):finish()
...
...
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/LuaE2E.java
浏览文件 @
1601cc10
...
...
@@ -77,17 +77,22 @@ public class LuaE2E extends SkyWalkingTestAdapter {
@ContainerHostAndPort
(
name
=
"ui"
,
port
=
8080
)
private
HostAndPort
swWebappHostPort
;
@SuppressWarnings
(
"unused"
)
@ContainerHostAndPort
(
name
=
"provider-entry"
,
port
=
9090
)
private
HostAndPort
entryProvider
;
@SuppressWarnings
(
"unused"
)
@ContainerHostAndPort
(
name
=
"nginx"
,
port
=
8080
)
private
HostAndPort
nginxHostPort
;
private
final
String
nginxServiceName
=
"User_Service_Name"
;
private
final
String
entryServiceName
=
"e2e-service-entry-provider"
;
@BeforeAll
public
void
setUp
()
throws
Exception
{
queryClient
(
swWebappHostPort
);
trafficController
(
nginxHostPort
,
"/nginx/info"
);
trafficController
(
entryProvider
,
"/nginx/entry/info?backend="
+
nginxHostPort
.
host
()
+
":"
+
nginxHostPort
.
port
()
);
}
@AfterAll
...
...
@@ -144,8 +149,8 @@ public class LuaE2E extends SkyWalkingTestAdapter {
new
ServiceInstanceTopologyQuery
().
stepByMinute
()
.
start
(
startTime
.
minusDays
(
1
))
.
end
(
now
())
.
clientServiceId
(
"1"
)
.
serverServiceId
(
"
4
"
));
.
clientServiceId
(
"
ZTJlLXNlcnZpY2UtZW50cnktcHJvdmlkZXI=.
1"
)
.
serverServiceId
(
"
VXNlcl9TZXJ2aWNlX05hbWU=.1
"
));
LOGGER
.
info
(
"topology: {}"
,
topology
);
...
...
@@ -177,8 +182,10 @@ public class LuaE2E extends SkyWalkingTestAdapter {
if
(
nginxServiceName
.
equals
(
service
.
getLabel
()))
{
load
(
"expected/lua/nginxEndpoints.yml"
).
as
(
EndpointsMatcher
.
class
).
verify
(
endpoints
);
}
else
if
(
entryServiceName
.
equals
(
service
.
getLabel
()))
{
load
(
"expected/lua/endpoints-entry.yml"
).
as
(
EndpointsMatcher
.
class
).
verify
(
endpoints
);
}
else
{
load
(
"expected/lua/endpoints.yml"
).
as
(
EndpointsMatcher
.
class
).
verify
(
endpoints
);
load
(
"expected/lua/endpoints
-end
.yml"
).
as
(
EndpointsMatcher
.
class
).
verify
(
endpoints
);
}
return
endpoints
;
...
...
@@ -206,7 +213,7 @@ public class LuaE2E extends SkyWalkingTestAdapter {
private
void
verifyEndpointsMetrics
(
Endpoints
endpoints
)
throws
Exception
{
for
(
Endpoint
endpoint
:
endpoints
.
getEndpoints
())
{
if
(!
endpoint
.
getLabel
().
equals
(
"/info"
)
||
!
endpoint
.
getLabel
().
equals
(
"/nginx/info"
))
{
if
(!
endpoint
.
getLabel
().
equals
(
"/info"
)
&&
!
endpoint
.
getLabel
().
equals
(
"/nginx/info"
))
{
continue
;
}
for
(
final
String
metricName
:
ALL_ENDPOINT_METRICS
)
{
...
...
test/e2e/e2e-test/src/test/resources/expected/lua/endpoints.yml
→
test/e2e/e2e-test/src/test/resources/expected/lua/endpoints
-end
.yml
浏览文件 @
1601cc10
文件已移动
test/e2e/e2e-test/src/test/resources/expected/lua/endpoints-entry.yml
0 → 100644
浏览文件 @
1601cc10
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
endpoints
:
-
key
:
not
null
label
:
/nginx/entry/info
test/e2e/e2e-test/src/test/resources/expected/lua/instances.yml
浏览文件 @
1601cc10
...
...
@@ -14,7 +14,7 @@
# limitations under the License.
instances
:
-
key
:
2
-
key
:
not
null
label
:
not
null
attributes
:
-
name
:
OS Name
...
...
test/e2e/e2e-test/src/test/resources/expected/lua/nginxEndpoints.yml
浏览文件 @
1601cc10
...
...
@@ -14,7 +14,7 @@
# limitations under the License.
endpoints
:
-
key
:
not
null
-
key
:
VXNlcl9TZXJ2aWNlX05hbWU=.1_L25naW54L2luZm8=
label
:
/nginx/info
...
...
test/e2e/e2e-test/src/test/resources/expected/lua/nginxInstances.yml
浏览文件 @
1601cc10
...
...
@@ -14,5 +14,5 @@
# limitations under the License.
instances
:
-
key
:
4
label
:
not
null
-
key
:
VXNlcl9TZXJ2aWNlX05hbWU=.1_VXNlcl9TZXJ2aWNlX0luc3RhbmNlX05hbWU=
label
:
User_Service_Instance_Name
test/e2e/e2e-test/src/test/resources/expected/lua/serviceInstanceTopo.yml
浏览文件 @
1601cc10
...
...
@@ -14,21 +14,22 @@
# limitations under the License.
nodes
:
-
id
:
1
name
:
User
type
:
USER
serviceId
:
1
serviceName
:
User
isReal
:
false
-
id
:
4
name
:
not
null
serviceId
:
4
serviceName
:
User_Service_Name
-
id
:
VXNlcl9TZXJ2aWNlX05hbWU=.1_VXNlcl9TZXJ2aWNlX0luc3RhbmNlX05hbWU=
name
:
User_Service_Instance_Name
type
:
not
null
serviceId
:
VXNlcl9TZXJ2aWNlX05hbWU=.1
serviceName
:
User_Service_Name
isReal
:
true
-
id
:
not
null
name
:
not
null
serviceId
:
ZTJlLXNlcnZpY2UtZW50cnktcHJvdmlkZXI=.1
serviceName
:
e2e-service-entry-provider
type
:
"
"
isReal
:
true
calls
:
-
id
:
1_4
source
:
1
-
id
:
not
null
source
:
not
null
detectPoints
:
-
CLIENT
-
SERVER
target
:
4
target
:
VXNlcl9TZXJ2aWNlX05hbWU=.1_VXNlcl9TZXJ2aWNlX0luc3RhbmNlX05hbWU=
test/e2e/e2e-test/src/test/resources/expected/lua/services.yml
浏览文件 @
1601cc10
...
...
@@ -14,7 +14,9 @@
# limitations under the License.
services
:
-
key
:
gt
0
label
:
"
Your_ApplicationName"
-
key
:
gt
0
label
:
"
User_Service_Name"
\ No newline at end of file
-
key
:
ZTJlLXNlcnZpY2UtZW50cnktcHJvdmlkZXI=.1
label
:
"
e2e-service-entry-provider"
-
key
:
VXNlcl9TZXJ2aWNlX05hbWU=.1
label
:
"
User_Service_Name"
-
key
:
ZTJlLXNlcnZpY2UtZW5kLXByb3ZpZGVy.1
label
:
"
e2e-service-end-provider"
\ No newline at end of file
test/e2e/e2e-test/src/test/resources/expected/lua/topo.yml
浏览文件 @
1601cc10
...
...
@@ -14,41 +14,46 @@
# limitations under the License.
nodes
:
-
id
:
1
-
id
:
VXNlcg==.0
name
:
User
type
:
USER
isReal
:
false
-
id
:
2
name
:
Your_ApplicationName
-
id
:
ZTJlLXNlcnZpY2UtZW50cnktcHJvdmlkZXI=.1
name
:
e2e-service-entry-provider
type
:
Tomcat
isReal
:
true
-
id
:
3
name
:
localhost:-1
type
:
H2
isReal
:
false
-
id
:
4
-
id
:
VXNlcl9TZXJ2aWNlX05hbWU=.1
name
:
User_Service_Name
type
:
Nginx
isReal
:
true
-
id
:
ZTJlLXNlcnZpY2UtZW5kLXByb3ZpZGVy.1
name
:
e2e-service-end-provider
type
:
Tomcat
isReal
:
true
-
id
:
bG9jYWxob3N0Oi0x.0
name
:
localhost:-1
type
:
H2
isReal
:
false
calls
:
-
id
:
1_4
source
:
1
-
id
:
VXNlcg==.0-ZTJlLXNlcnZpY2UtZW50cnktcHJvdmlkZXI=.1
source
:
VXNlcg==.0
detectPoints
:
-
SERVER
target
:
4
-
id
:
4_2
source
:
4
target
:
ZTJlLXNlcnZpY2UtZW50cnktcHJvdmlkZXI=.1
-
id
:
ZTJlLXNlcnZpY2UtZW50cnktcHJvdmlkZXI=.1-VXNlcl9TZXJ2aWNlX05hbWU=.1
source
:
ZTJlLXNlcnZpY2UtZW50cnktcHJvdmlkZXI=.1
detectPoints
:
-
CLIENT
-
SERVER
target
:
2
-
id
:
2_3
source
:
2
target
:
VXNlcl9TZXJ2aWNlX05hbWU=.1
-
id
:
VXNlcl9TZXJ2aWNlX05hbWU=.1-ZTJlLXNlcnZpY2UtZW5kLXByb3ZpZGVy.1
source
:
VXNlcl9TZXJ2aWNlX05hbWU=.1
detectPoints
:
-
CLIENT
target
:
3
-
id
:
1_2
source
:
1
detectPoints
:
-
SERVER
target
:
2
\ No newline at end of file
target
:
ZTJlLXNlcnZpY2UtZW5kLXByb3ZpZGVy.1
-
id
:
ZTJlLXNlcnZpY2UtZW5kLXByb3ZpZGVy.1-bG9jYWxob3N0Oi0x.0
source
:
ZTJlLXNlcnZpY2UtZW5kLXByb3ZpZGVy.1
detectPoints
:
-
CLIENT
target
:
bG9jYWxob3N0Oi0x.0
\ No newline at end of file
test/e2e/e2e-test/src/test/resources/expected/lua/traces.yml
浏览文件 @
1601cc10
...
...
@@ -16,7 +16,7 @@
traces
:
-
key
:
not
null
endpointNames
:
-
/info
-
/
nginx/entry/
info
duration
:
ge
0
start
:
gt
0
isError
:
false
...
...
@@ -30,4 +30,13 @@ traces:
start
:
gt
0
isError
:
false
traceIds
:
-
not
null
\ No newline at end of file
-
not
null
-
key
:
not
null
endpointNames
:
-
/info
duration
:
ge
0
start
:
gt
0
isError
:
false
traceIds
:
-
not
null
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录