Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/plugin/containers/jvm-container/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<run>chmod +x /usr/local/skywalking/run.sh</run>
<run>tar -xvf ../tools/skywalking-mock-collector.tar.gz -C ../tools</run>
<run>apt-get update -y</run>
<run>apt-get install -y unzip</run>
<run>apt-get install -y unzip bash</run>
<run>rm -rf /var/lib/apt/lists/*</run>
</runCmds>
<cmd>["/usr/local/skywalking/run.sh"]</cmd>
Expand Down
2 changes: 2 additions & 0 deletions test/plugin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ remove_dir() {
start_stamp=`date +%s`
parse_commandline "$@"

echo "Scenario=$scenario_name JavaImage=$base_image_java TomcatImage=$base_image_tomcat"

if [[ "$cleanup" == "on" ]]; then
do_cleanup
[[ -z "${scenario_name}" ]] && exit 0
Expand Down
189 changes: 189 additions & 0 deletions test/plugin/scenarios/gateway-4.3.x-scenario/config/expectedData.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
# 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.

ignoreSegmentNames:
- HEAD:/provider/b/healthCheck
- /provider/b/healthCheck

segmentItems:
- serviceName: gateway-projectB-scenario
segmentSize: nq 0
segments:
- segmentId: not null
spans:
- operationName: GET:/provider/b/testcase
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: nq 0
isError: false
spanType: Entry
peer: ''
tags:
- {key: url, value: not null}
- {key: http.method, value: GET}
- {key: http.status_code, value: '200'}
refs:
- {parentEndpoint: SpringCloudGateway/GatewayFilter, networkAddress: not null,
refType: CrossProcess, parentSpanId: 2, parentTraceSegmentId: not null, parentServiceInstance: not
null, parentService: not null, traceId: not null}
skipAnalysis: 'false'

- serviceName: gateway-projectA-scenario
segmentSize: nq 0
segments:
# --------------------------------------------------------
# Case 1: Timeout Error
# --------------------------------------------------------
# A. Entry Span
- segmentId: not null
spans:
- operationName: /provider/timeout/error
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: nq 0
isError: true
spanType: Entry
peer: ''
tags:
- {key: url, value: not null }
- {key: http.method, value: GET}
- {key: http.status_code, value: '500'}
skipAnalysis: 'false'

# B. Exit Span (Contains Logs)
- segmentId: not null
spans:
- operationName: SpringCloudGateway/sendRequest
parentSpanId: 1
spanId: 2
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: nq 0
isError: true
spanType: Exit
peer: not null
skipAnalysis: 'false'
tags:
- { key: url, value: not null }
logs:
- logEvent:
- { key: event, value: error }
- { key: error.kind, value: not null }
- { key: message, value: not null }
- { key: stack, value: not null}
- operationName: SpringCloudGateway/RoutingFilter
parentSpanId: 0
spanId: 1
startTime: nq 0
endTime: nq 0
componentId: nq 0
isError: false
spanType: Local
peer: ''
skipAnalysis: 'false'
refs:
- { parentEndpoint: '/provider/timeout/error', networkAddress: '', refType: CrossThread,
parentSpanId: 0, parentTraceSegmentId: not null, parentServiceInstance: not
null, parentService: not null, traceId: not null }
- operationName: SpringCloudGateway/GatewayFilter
parentSpanId: -1
spanId: 0
startTime: nq 0
endTime: nq 0
componentId: nq 0
isError: false
spanType: Local
peer: ''
skipAnalysis: 'false'
refs:
- { parentEndpoint: '/provider/timeout/error', networkAddress: '', refType: CrossThread,
parentSpanId: 0, parentTraceSegmentId: not null, parentServiceInstance: not
null, parentService: not null, traceId: not null }

# --------------------------------------------------------
# Case 2: Success Case
# --------------------------------------------------------
# A. Entry Span
- segmentId: not null
spans:
- operationName: /provider/b/testcase
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: nq 0
isError: false
spanType: Entry
peer: ''
tags:
- { key: url, value: not null }
- { key: http.method, value: GET }
- { key: http.status_code, value: '200' }
skipAnalysis: 'false'

# B. Exit Span
- segmentId: not null
spans:
- operationName: SpringCloudGateway/sendRequest
parentSpanId: 1
spanId: 2
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: nq 0
isError: false
spanType: Exit
peer: not null
tags:
- {key: url, value: not null}
- {key: http.status_code, value: '200'}
skipAnalysis: 'false'
- operationName: SpringCloudGateway/RoutingFilter
parentSpanId: 0
spanId: 1
startTime: nq 0
endTime: nq 0
componentId: nq 0
isError: false
spanType: Local
peer: ''
skipAnalysis: 'false'
refs:
- {parentEndpoint: '/provider/b/testcase', networkAddress: '', refType: CrossThread,
parentSpanId: 0, parentTraceSegmentId: not null, parentServiceInstance: not
null, parentService: not null, traceId: not null}
- operationName: SpringCloudGateway/GatewayFilter
parentSpanId: -1
spanId: 0
startTime: nq 0
endTime: nq 0
componentId: nq 0
isError: false
spanType: Local
peer: ''
skipAnalysis: 'false'
refs:
- {parentEndpoint: '/provider/b/testcase', networkAddress: '', refType: CrossThread,
parentSpanId: 0, parentTraceSegmentId: not null, parentServiceInstance: not
null, parentService: not null, traceId: not null}
23 changes: 23 additions & 0 deletions test/plugin/scenarios/gateway-4.3.x-scenario/configuration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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.

type: jvm
entryService: http://localhost:8080/provider/b/testcase
healthCheck: http://localhost:8080/provider/b/healthCheck
startScript: ./bin/startup.sh
runningMode: with_optional
withPlugins: apm-spring-cloud-gateway-4.x-plugin-*.jar

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
#
# 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.

home="$(cd "$(dirname $0)"; pwd)"

java -jar ${agent_opts} "-Dskywalking.agent.service_name=gateway-projectA-scenario" ${home}/../libs/gateway-projectA-scenario.jar &
sleep 1

java -jar ${agent_opts} "-Dskywalking.agent.service_name=gateway-projectB-scenario" ${home}/../libs/gateway-projectB-scenario.jar &
57 changes: 57 additions & 0 deletions test/plugin/scenarios/gateway-4.3.x-scenario/gateway-dist/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.apache.skywalking</groupId>
<artifactId>gateway-4.3.x-scenario</artifactId>
<version>5.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>gateway-dist</artifactId>

<build>
<finalName>gateway-4.3.x-scenario</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assemble</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>gateway-4.3.x-scenario</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<outputDirectory>../target/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>gateway-dist</id>
<formats>
<format>zip</format>
</formats>

<fileSets>
<fileSet>
<directory>./bin</directory>
<fileMode>0775</fileMode>
</fileSet>
</fileSets>

<files>
<file>
<source>../gateway-projectA-scenario/target/gateway-projectA-scenario.jar</source>
<outputDirectory>./libs</outputDirectory>
<fileMode>0775</fileMode>
</file>
<file>
<source>../gateway-projectB-scenario/target/gateway-projectB-scenario.jar</source>
<outputDirectory>./libs</outputDirectory>
<fileMode>0775</fileMode>
</file>
</files>
</assembly>
Loading
Loading