Skip to content

Commit

Permalink
[test/plugin] immigrate test hystrix scenario. (#3887)
Browse files Browse the repository at this point in the history
* [test/plugin] immigrate test hystrix scenario.

* change package name.

* add start script.
  • Loading branch information
aderm authored and wu-sheng committed Nov 19, 2019
1 parent 7e889d3 commit a2dce71
Show file tree
Hide file tree
Showing 14 changed files with 656 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Jenkinsfile-Agent-Test-3
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pipeline {
sh './mvnw -f test/plugin/pom.xml clean package -DskipTests docker:build'
}
}
stage('Test Cases Report (140)') {
stage('Test Cases Report (160)') {
steps {
echo "Test Cases Report"
}
Expand All @@ -82,6 +82,12 @@ pipeline {
parallel {
stage('Group1') {
stages {
stage('hystrix 1.4.20-1.5.12 (20)') {
steps {
sh 'bash test/plugin/run.sh hystrix-scenario'
}
}

stage('postgresql 9.2.x-9.4.x (36)') {
steps {
sh 'bash test/plugin/run.sh postgresql-scenario'
Expand Down
3 changes: 2 additions & 1 deletion docs/en/guides/Plugin-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -648,9 +648,10 @@ elasticsearch 5.x | 3 | 142.15


### Workload 3
#### Group 1 (2291.912s)
#### Group 1 (3090.912s)
scenario name | versions | elapsed time (sec)
---|---|---
hystrix-scenario | 20 | 799.00
postgresql 9.2.x-9.4.x | 36 | 1243.03
sofarpc 5.4.0-5.6.2 | 23 | 817.77
spring 3.0.x | 8 | 231.11
Expand Down
21 changes: 21 additions & 0 deletions test/plugin/scenarios/hystrix-scenario/bin/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/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} ${home}/../libs/hystrix-scenario.jar &
98 changes: 98 additions & 0 deletions test/plugin/scenarios/hystrix-scenario/config/expectedData.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# 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.
registryItems:
applications:
- {hystrix-scenario: 2}
instances:
- {hystrix-scenario: 1}
operationNames:
- hystrix-scenario: [/case/hystrix-scenario]
heartbeat: []
segmentItems:
- applicationCode: hystrix-scenario
segmentSize: ge 1
segments:
- segmentId: not null
spans:
- operationName: Hystrix/TestACommand/Execution
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Unknown
startTime: nq 0
endTime: nq 0
componentId: 29
componentName: ''
isError: false
spanType: Local
peer: ''
peerId: 0
logs:
- logEvent:
- {key: event, value: error}
- {key: error.kind, value: java.lang.InterruptedException}
- {key: message, value: not null}
- {key: stack, value: not null}
refs:
- {parentEndpointId: 0, parentEndpoint: /case/hystrix-scenario, networkAddressId: 0, entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: '${hystrix-scenario[2]}', parentServiceInstanceId: nq 0, networkAddress: '', entryEndpoint: /case/hystrix-scenario, entryServiceInstanceId: nq 0 }
- segmentId: not null
spans:
- operationName: Hystrix/TestACommand/Fallback
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Unknown
startTime: nq 0
endTime: nq 0
componentId: 29
componentName: ''
isError: false
spanType: Local
peer: ''
peerId: 0
refs:
- {parentEndpointId: 0, parentEndpoint: Hystrix/TestACommand/Execution, networkAddressId: 0, entryEndpointId: 0, refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: '${hystrix-scenario[0]}', parentServiceInstanceId: nq 0, networkAddress: '', entryEndpoint: /case/hystrix-scenario, entryServiceInstanceId: nq 0}
- segmentId: not null
spans:
- operationName: Hystrix/TestBCommand/Execution
operationId: 0
parentSpanId: 0
spanId: 1
spanLayer: Unknown
startTime: nq 0
endTime: nq 0
componentId: 29
componentName: ''
isError: false
spanType: Local
peer: ''
peerId: 0
- operationName: /case/hystrix-scenario
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 14
componentName: ''
isError: false
spanType: Entry
peer: ''
peerId: 0
tags:
- {key: url, value: 'http://localhost:8080/hystrix-scenario/case/hystrix-scenario'}
- {key: http.method, value: GET}
23 changes: 23 additions & 0 deletions test/plugin/scenarios/hystrix-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/hystrix-scenario/case/hystrix-scenario
healthCheck: http://localhost:8080/hystrix-scenario/case/healthCheck
startScript: ./bin/startup.sh
framework: hystrix-scenario
environment:
dependencies:
123 changes: 123 additions & 0 deletions test/plugin/scenarios/hystrix-scenario/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<?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">

<groupId>org.apache.skywalking.apm.testcase</groupId>
<artifactId>hystrix-scenario</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>

<modelVersion>4.0.0</modelVersion>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<compiler.version>1.8</compiler.version>

<test.framework.version>1.4.20</test.framework.version>
<spring-boot-version>2.1.6.RELEASE</spring-boot-version>
</properties>

<name>skywalking-hystrix-scenario</name>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
<exclusions>
<exclusion>
<artifactId>jul-to-slf4j</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-core</artifactId>
<version>${test.framework.version}</version>
</dependency>
</dependencies>

<build>
<finalName>hystrix-scenario</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${compiler.version}</source>
<target>${compiler.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<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>
<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,41 @@
<?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">
<formats>
<format>zip</format>
</formats>

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

<files>
<file>
<source>${project.build.directory}/hystrix-scenario.jar</source>
<outputDirectory>./libs</outputDirectory>
<fileMode>0775</fileMode>
</file>
</files>
</assembly>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* 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 test.apache.skywalking.apm.testcase.hystrix;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;


@SpringBootApplication
public class Application {

public static void main(String[] args) {
try {
SpringApplication.run(Application.class, args);
} catch (Exception e) {
// Never do this
}
}
}
Loading

0 comments on commit a2dce71

Please sign in to comment.