Skip to content

Commit d1c9bc7

Browse files
committed
Split elasticsearch-java 9.x test to JDK 17 scenario
elasticsearch-java 9.0.0 is compiled for JDK 17 (class version 61), so it cannot be tested in the JDK 8 test container. Split into a separate elasticsearch-java-9.x-scenario using Spring Boot 3.x and JDK 17 compiler target, added to plugins-jdk17-test.1.yaml.
1 parent fe79c38 commit d1c9bc7

12 files changed

Lines changed: 543 additions & 1 deletion

File tree

.github/workflows/plugins-jdk17-test.1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ jobs:
8181
- spring-scheduled-6.x-scenario
8282
- caffeine-3.x-scenario
8383
- lettuce-webflux-6x-scenario
84+
- elasticsearch-java-9.x-scenario
8485
steps:
8586
- uses: actions/checkout@v2
8687
with:
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
19+
home="$(cd "$(dirname $0)"; pwd)"
20+
21+
java -jar ${agent_opts} -Dskywalking.plugin.elasticsearch.trace_dsl=true ${home}/../libs/elasticsearch-java-9.x-scenario.jar &
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
segmentItems:
17+
- serviceName: elasticsearch-java-9.x-scenario
18+
segmentSize: ge 2
19+
segments:
20+
- segmentId: not null
21+
spans:
22+
- operationName: Elasticsearch/es/indices.create
23+
parentSpanId: 0
24+
spanId: 1
25+
spanLayer: Database
26+
startTime: nq 0
27+
endTime: nq 0
28+
componentId: 77
29+
isError: false
30+
spanType: Exit
31+
peer: not null
32+
skipAnalysis: false
33+
tags:
34+
- {key: db.type, value: Elasticsearch}
35+
- operationName: Elasticsearch/es/index
36+
parentSpanId: 0
37+
spanId: 2
38+
spanLayer: Database
39+
startTime: nq 0
40+
endTime: nq 0
41+
componentId: 77
42+
isError: false
43+
spanType: Exit
44+
peer: not null
45+
skipAnalysis: false
46+
tags:
47+
- {key: db.type, value: Elasticsearch}
48+
- operationName: Elasticsearch/es/get
49+
parentSpanId: 0
50+
spanId: 3
51+
spanLayer: Database
52+
startTime: nq 0
53+
endTime: nq 0
54+
componentId: 77
55+
isError: false
56+
spanType: Exit
57+
peer: not null
58+
skipAnalysis: false
59+
tags:
60+
- {key: db.type, value: Elasticsearch}
61+
- operationName: Elasticsearch/es/search
62+
parentSpanId: 0
63+
spanId: 4
64+
spanLayer: Database
65+
startTime: nq 0
66+
endTime: nq 0
67+
componentId: 77
68+
isError: false
69+
spanType: Exit
70+
peer: not null
71+
skipAnalysis: false
72+
tags:
73+
- {key: db.type, value: Elasticsearch}
74+
- operationName: Elasticsearch/es/delete
75+
parentSpanId: 0
76+
spanId: 5
77+
spanLayer: Database
78+
startTime: nq 0
79+
endTime: nq 0
80+
componentId: 77
81+
isError: false
82+
spanType: Exit
83+
peer: not null
84+
skipAnalysis: false
85+
tags:
86+
- {key: db.type, value: Elasticsearch}
87+
- operationName: Elasticsearch/es/indices.delete
88+
parentSpanId: 0
89+
spanId: 6
90+
spanLayer: Database
91+
startTime: nq 0
92+
endTime: nq 0
93+
componentId: 77
94+
isError: false
95+
spanType: Exit
96+
peer: not null
97+
skipAnalysis: false
98+
tags:
99+
- {key: db.type, value: Elasticsearch}
100+
- operationName: GET:/elasticsearch-java-case/case/elasticsearch
101+
parentSpanId: -1
102+
spanId: 0
103+
startTime: nq 0
104+
endTime: nq 0
105+
spanLayer: Http
106+
isError: false
107+
spanType: Entry
108+
componentId: 1
109+
tags:
110+
- {key: url, value: not null}
111+
- {key: http.method, value: GET}
112+
- {key: http.status_code, value: '200'}
113+
skipAnalysis: 'false'
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
type: jvm
18+
entryService: http://localhost:8080/elasticsearch-java-case/case/elasticsearch
19+
healthCheck: http://localhost:8080/elasticsearch-java-case/case/healthCheck
20+
startScript: ./bin/startup.sh
21+
environment:
22+
- elasticsearch.server=elasticsearch-server:9200
23+
dependencies:
24+
elasticsearch-server:
25+
image: docker.elastic.co/elasticsearch/elasticsearch:8.17.0
26+
hostname: elasticsearch-server
27+
removeOnExit: true
28+
expose:
29+
- 9200
30+
environment:
31+
- cluster.name=docker-node
32+
- xpack.security.enabled=false
33+
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
34+
- discovery.type=single-node
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one or more
4+
~ contributor license agreements. See the NOTICE file distributed with
5+
~ this work for additional information regarding copyright ownership.
6+
~ The ASF licenses this file to You under the Apache License, Version 2.0
7+
~ (the "License"); you may not use this file except in compliance with
8+
~ the License. You may obtain a copy of the License at
9+
~
10+
~ http://www.apache.org/licenses/LICENSE-2.0
11+
~
12+
~ Unless required by applicable law or agreed to in writing, software
13+
~ distributed under the License is distributed on an "AS IS" BASIS,
14+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
~ See the License for the specific language governing permissions and
16+
~ limitations under the License.
17+
~
18+
-->
19+
<project xmlns="http://maven.apache.org/POM/4.0.0"
20+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
22+
23+
<groupId>org.apache.skywalking.apm.testcase</groupId>
24+
<artifactId>elasticsearch-java-9.x-scenario</artifactId>
25+
<version>1.0.0</version>
26+
<packaging>jar</packaging>
27+
28+
<modelVersion>4.0.0</modelVersion>
29+
30+
<properties>
31+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
32+
<compiler.version>17</compiler.version>
33+
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
34+
35+
<test.framework.version>9.0.0</test.framework.version>
36+
37+
<spring.boot.version>3.0.13</spring.boot.version>
38+
</properties>
39+
40+
<name>skywalking-elasticsearch-java-9.x-scenario</name>
41+
42+
<dependencyManagement>
43+
<dependencies>
44+
<dependency>
45+
<groupId>org.springframework.boot</groupId>
46+
<artifactId>spring-boot-dependencies</artifactId>
47+
<version>${spring.boot.version}</version>
48+
<type>pom</type>
49+
<scope>import</scope>
50+
</dependency>
51+
</dependencies>
52+
</dependencyManagement>
53+
54+
<dependencies>
55+
<dependency>
56+
<groupId>org.springframework.boot</groupId>
57+
<artifactId>spring-boot-starter-web</artifactId>
58+
<exclusions>
59+
<exclusion>
60+
<groupId>org.springframework.boot</groupId>
61+
<artifactId>spring-boot-starter-logging</artifactId>
62+
</exclusion>
63+
</exclusions>
64+
</dependency>
65+
<dependency>
66+
<groupId>org.springframework.boot</groupId>
67+
<artifactId>spring-boot-starter-log4j2</artifactId>
68+
<exclusions>
69+
<exclusion>
70+
<artifactId>jul-to-slf4j</artifactId>
71+
<groupId>org.slf4j</groupId>
72+
</exclusion>
73+
</exclusions>
74+
</dependency>
75+
<!-- Elasticsearch Java client -->
76+
<dependency>
77+
<groupId>co.elastic.clients</groupId>
78+
<artifactId>elasticsearch-java</artifactId>
79+
<version>${test.framework.version}</version>
80+
</dependency>
81+
<!-- Must match elasticsearch-java version, override Spring Boot BOM -->
82+
<dependency>
83+
<groupId>org.elasticsearch.client</groupId>
84+
<artifactId>elasticsearch-rest-client</artifactId>
85+
<version>${test.framework.version}</version>
86+
</dependency>
87+
<dependency>
88+
<groupId>com.fasterxml.jackson.core</groupId>
89+
<artifactId>jackson-databind</artifactId>
90+
</dependency>
91+
</dependencies>
92+
93+
<build>
94+
<finalName>elasticsearch-java-9.x-scenario</finalName>
95+
<plugins>
96+
<plugin>
97+
<groupId>org.springframework.boot</groupId>
98+
<artifactId>spring-boot-maven-plugin</artifactId>
99+
<version>${spring.boot.version}</version>
100+
<executions>
101+
<execution>
102+
<goals>
103+
<goal>repackage</goal>
104+
</goals>
105+
</execution>
106+
</executions>
107+
</plugin>
108+
<plugin>
109+
<artifactId>maven-compiler-plugin</artifactId>
110+
<version>${maven-compiler-plugin.version}</version>
111+
<configuration>
112+
<source>${compiler.version}</source>
113+
<target>${compiler.version}</target>
114+
<encoding>${project.build.sourceEncoding}</encoding>
115+
</configuration>
116+
</plugin>
117+
<plugin>
118+
<groupId>org.apache.maven.plugins</groupId>
119+
<artifactId>maven-assembly-plugin</artifactId>
120+
<executions>
121+
<execution>
122+
<id>assemble</id>
123+
<phase>package</phase>
124+
<goals>
125+
<goal>single</goal>
126+
</goals>
127+
<configuration>
128+
<descriptors>
129+
<descriptor>src/main/assembly/assembly.xml</descriptor>
130+
</descriptors>
131+
<outputDirectory>./target/</outputDirectory>
132+
</configuration>
133+
</execution>
134+
</executions>
135+
</plugin>
136+
</plugins>
137+
</build>
138+
</project>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one or more
4+
~ contributor license agreements. See the NOTICE file distributed with
5+
~ this work for additional information regarding copyright ownership.
6+
~ The ASF licenses this file to You under the Apache License, Version 2.0
7+
~ (the "License"); you may not use this file except in compliance with
8+
~ the License. You may obtain a copy of the License at
9+
~
10+
~ http://www.apache.org/licenses/LICENSE-2.0
11+
~
12+
~ Unless required by applicable law or agreed to in writing, software
13+
~ distributed under the License is distributed on an "AS IS" BASIS,
14+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
~ See the License for the specific language governing permissions and
16+
~ limitations under the License.
17+
~
18+
-->
19+
<assembly
20+
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
21+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
23+
<formats>
24+
<format>zip</format>
25+
</formats>
26+
27+
<fileSets>
28+
<fileSet>
29+
<directory>./bin</directory>
30+
<fileMode>0775</fileMode>
31+
</fileSet>
32+
</fileSets>
33+
34+
<files>
35+
<file>
36+
<source>${project.build.directory}/elasticsearch-java-scenario.jar</source>
37+
<outputDirectory>./libs</outputDirectory>
38+
<fileMode>0775</fileMode>
39+
</file>
40+
</files>
41+
</assembly>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
package org.apache.skywalking.apm.testcase.elasticsearch;
20+
21+
import org.springframework.boot.SpringApplication;
22+
import org.springframework.boot.autoconfigure.SpringBootApplication;
23+
24+
@SpringBootApplication
25+
public class Application {
26+
public static void main(String[] args) {
27+
SpringApplication.run(Application.class, args);
28+
}
29+
}

0 commit comments

Comments
 (0)