Skip to content

Commit 6226667

Browse files
authored
Add plugin for Spring 6, set development baseline to JDK 17, remove Powermock entirely (#444)
1 parent 8a7fe75 commit 6226667

File tree

360 files changed

+4951
-2248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

360 files changed

+4951
-2248
lines changed

Diff for: .github/actions/build/action.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,27 @@ runs:
4444
path: ~/.m2/repository
4545
key: ${{ runner.os }}-maven-agent-test-${{ hashFiles('**/pom.xml') }}
4646
restore-keys: ${{ runner.os }}-maven-agent-test-
47+
- uses: actions/setup-java@v2
48+
with:
49+
distribution: temurin
50+
java-version: 17
4751
- name: Build SkyWalking Agent
4852
shell: bash
4953
run: |
5054
echo "::group::Build SkyWalking Agent"
5155
# Retry one more time due to frequent "maven connection reset"
52-
./mvnw --batch-mode clean package -Dmaven.test.skip || \
53-
./mvnw --batch-mode clean package -Dmaven.test.skip
56+
./mvnw -q --batch-mode clean package -Dmaven.test.skip || \
57+
./mvnw -q --batch-mode clean package -Dmaven.test.skip
5458
echo "::endgroup::"
5559
- uses: actions/upload-artifact@v2
5660
name: Upload Agent
5761
with:
5862
name: skywalking-agent
5963
path: skywalking-agent
64+
- uses: actions/setup-java@v2
65+
with:
66+
distribution: temurin
67+
java-version: 8
6068
- name: Build Docker Image
6169
shell: bash
6270
run: |

Diff for: .github/actions/run/action.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,11 @@ runs:
5151
shell: bash
5252
run: |
5353
echo "::group::Run Plugin Test ${{ inputs.test_case }}"
54-
bash test/plugin/run.sh --image_version=${{ inputs.java_version }}-1.0.0 ${{ inputs.test_case }}
54+
bash test/plugin/run.sh ${{ inputs.test_case }}
5555
echo "::endgroup::"
56+
- uses: actions/upload-artifact@v2
57+
name: Upload Agent
58+
if: always()
59+
with:
60+
path: test/plugin/workspace
61+
name: test-plugin-workspace-${{ inputs.test_case }}

Diff for: .github/workflows/ci.yaml

+2-12
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ on:
2020
pull_request:
2121
schedule:
2222
- cron: '0 18 * * *' # TimeZone: UTC 0
23-
push:
24-
branches:
25-
- test/ci/*
2623

2724
concurrency:
2825
group: ci-it-${{ github.event.pull_request.number || github.ref }}
@@ -51,10 +48,7 @@ jobs:
5148
fail-fast: true
5249
matrix:
5350
os: [ ubuntu, macos, windows ]
54-
java-version: [ 8 ]
55-
include:
56-
- os: ubuntu
57-
java-version: 11
51+
java-version: [ 17 ]
5852
steps:
5953
- uses: actions/checkout@v2
6054
with:
@@ -67,15 +61,11 @@ jobs:
6761
restore-keys: ${{ runner.os }}-maven-ci-
6862
- uses: actions/setup-java@v2
6963
with:
70-
distribution: adopt
64+
distribution: temurin
7165
java-version: ${{ matrix.java-version }}
7266
- name: Check Javaagent Plugin List
7367
run: tools/plugin/check-javaagent-plugin-list.sh
7468
- name: Install and Test
75-
if: matrix.java-version == '8' && matrix.os != 'windows'
76-
run: ./mvnw -q --batch-mode clean verify install javadoc:javadoc
77-
- name: Install and Test
78-
if: matrix.java-version == '11' || matrix.os == 'windows'
7969
run: ./mvnw -q --batch-mode clean verify install
8070

8171
ci:

Diff for: .github/workflows/codeql.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ jobs:
4848
with:
4949
submodules: true
5050

51+
- uses: actions/setup-java@v2
52+
with:
53+
distribution: temurin
54+
java-version: 17
55+
5156
- name: Initialize CodeQL
5257
uses: github/codeql-action/init@v1
5358
with:

Diff for: .github/workflows/e2e.yaml

+7-2
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,19 @@ jobs:
3737
- uses: actions/checkout@v2
3838
with:
3939
submodules: true
40+
- uses: actions/setup-java@v2
41+
with:
42+
distribution: temurin
43+
java-version: 17
4044
- name: Build SkyWalking agent docker image
4145
run: make build docker.java8
4246
- name: Build consumer & provider images
4347
shell: bash
4448
run: |
4549
echo "::group::Install SNAPSHOT apm-application-toolkit"
46-
./mvnw -DskipTests -N install
47-
./mvnw -f apm-application-toolkit -DskipTests -am install
50+
./mvnw -B -Dmaven.test.skip -N install
51+
./mvnw -B -pl :apm-test-tools -Dmaven.test.skip -am install
52+
./mvnw -B -f apm-application-toolkit -Dmaven.test.skip -am install
4853
echo "::endgroup::"
4954
echo "::group::"
5055
SW_VERSION=$(./mvnw -q -DforceStdout -N org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version)

Diff for: .github/workflows/plugins-jdk17-test.0.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ on:
2727
- 'test/plugin/**'
2828
- '**/pom.xml'
2929
- '!**.md'
30-
push:
31-
branches:
32-
- test/ci/*
3330

3431
concurrency:
3532
group: plugins-jdk17-${{ github.event.pull_request.number || github.ref }}

Diff for: .github/workflows/plugins-jdk17-test.1.yaml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
name: Test
18+
19+
on:
20+
pull_request:
21+
paths:
22+
- '.github/workflows/plugins-*.yaml'
23+
- 'apm-application-toolkit/**'
24+
- 'apm-commons/**'
25+
- 'apm-protocol/**'
26+
- 'apm-sniffer/**'
27+
- 'test/plugin/**'
28+
- '**/pom.xml'
29+
- '!**.md'
30+
31+
concurrency:
32+
group: plugins-jdk17-1-${{ github.event.pull_request.number || github.ref }}
33+
cancel-in-progress: true
34+
35+
jobs:
36+
build:
37+
name: Build
38+
runs-on: ubuntu-latest
39+
timeout-minutes: 30
40+
steps:
41+
- uses: actions/checkout@v2
42+
with:
43+
submodules: true
44+
- name: Build
45+
uses: ./.github/actions/build
46+
with:
47+
base_image_java: eclipse-temurin:17-jdk
48+
base_image_tomcat: tomcat:10.1-jdk17-temurin
49+
50+
test:
51+
needs: [ build ]
52+
name: ${{ matrix.case }}
53+
runs-on: ubuntu-latest
54+
timeout-minutes: 90
55+
strategy:
56+
matrix:
57+
case:
58+
- spring-6.x-scenario
59+
steps:
60+
- uses: actions/checkout@v2
61+
with:
62+
submodules: true
63+
- uses: actions/setup-java@v2
64+
with:
65+
distribution: 'temurin'
66+
java-version: '17'
67+
- name: Run Test
68+
uses: ./.github/actions/run
69+
with:
70+
test_case: ${{ matrix.case }}

Diff for: .github/workflows/plugins-test.0.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ on:
2727
- 'test/plugin/**'
2828
- '**/pom.xml'
2929
- '!**.md'
30-
push:
31-
branches:
32-
- test/ci/*
3330

3431
concurrency:
3532
group: plugins-0-${{ github.event.pull_request.number || github.ref }}
@@ -95,7 +92,7 @@ jobs:
9592
submodules: true
9693
- uses: actions/setup-java@v2
9794
with:
98-
distribution: adopt
95+
distribution: temurin
9996
java-version: 8
10097
- name: Run Plugin Test
10198
uses: ./.github/actions/run

Diff for: .github/workflows/plugins-test.1.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ on:
2727
- 'test/plugin/**'
2828
- '**/pom.xml'
2929
- '!**.md'
30-
push:
31-
branches:
32-
- test/ci/*
3330

3431
concurrency:
3532
group: plugins-1-${{ github.event.pull_request.number || github.ref }}
@@ -87,7 +84,7 @@ jobs:
8784
submodules: true
8885
- uses: actions/setup-java@v2
8986
with:
90-
distribution: adopt
87+
distribution: temurin
9188
java-version: 8
9289
- name: Run Plugin Test
9390
uses: ./.github/actions/run

Diff for: .github/workflows/plugins-test.2.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ on:
2727
- 'test/plugin/**'
2828
- '**/pom.xml'
2929
- '!**.md'
30-
push:
31-
branches:
32-
- test/ci/*
3330

3431
concurrency:
3532
group: plugins-2-${{ github.event.pull_request.number || github.ref }}
@@ -86,7 +83,7 @@ jobs:
8683
submodules: true
8784
- uses: actions/setup-java@v2
8885
with:
89-
distribution: adopt
86+
distribution: temurin
9087
java-version: 8
9188
- name: Run Plugin Test
9289
uses: ./.github/actions/run

Diff for: .github/workflows/plugins-test.3.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ on:
2727
- 'test/plugin/**'
2828
- '**/pom.xml'
2929
- '!**.md'
30-
push:
31-
branches:
32-
- test/ci/*
3330

3431
concurrency:
3532
group: plugins-3-${{ github.event.pull_request.number || github.ref }}
@@ -114,7 +111,7 @@ jobs:
114111
submodules: true
115112
- uses: actions/setup-java@v2
116113
with:
117-
distribution: adopt
114+
distribution: temurin
118115
java-version: 8
119116
- name: Install Oracle Libs
120117
if: matrix.case == 'oracle-scenario'

Diff for: .github/workflows/plugins-tomcat10-test.0.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ on:
2727
- 'test/plugin/**'
2828
- '**/pom.xml'
2929
- '!**.md'
30-
push:
31-
branches:
32-
- test/ci/*
3330

3431
concurrency:
3532
group: plugins-tomcat10-${{ github.event.pull_request.number || github.ref }}
@@ -64,7 +61,7 @@ jobs:
6461
submodules: true
6562
- uses: actions/setup-java@v2
6663
with:
67-
distribution: adopt
64+
distribution: temurin
6865
java-version: 8
6966
- name: Run Plugin Test
7067
uses: ./.github/actions/run

Diff for: .licenserc.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ header:
2222
copyright-owner: Apache Software Foundation
2323

2424
paths-ignore:
25+
- 'org.mockito.plugins.MockMaker'
2526
- '.github/PULL_REQUEST_TEMPLATE'
2627
- '**/.gitignore'
2728
- '.gitmodules'

Diff for: CHANGES.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ Release Notes.
66
------------------
77

88
* Enhance lettuce plugin to adopt uniform tags.
9-
* Expose complete Tracing APIs in the tracing toolkit
9+
* Expose complete Tracing APIs in the tracing toolkit.
10+
* Add plugin to trace Spring 6 and Resttemplate 6.
11+
* Move the baseline to JDK 17 for development, the runtime baseline is still Java 8 compatible.
12+
* Remove Powermock entirely from the test cases.
1013

1114
#### Documentation
1215
* Update docs of Tracing APIs, reorganize the API docs into six parts

Diff for: apm-application-toolkit/apm-toolkit-micrometer-registry/pom.xml

+6
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,11 @@
4444
<artifactId>micrometer-core</artifactId>
4545
<version>${micrometer-core.version}</version>
4646
</dependency>
47+
<dependency>
48+
<groupId>org.apache.skywalking</groupId>
49+
<artifactId>apm-test-tools</artifactId>
50+
<version>${project.version}</version>
51+
<scope>test</scope>
52+
</dependency>
4753
</dependencies>
4854
</project>

Diff for: apm-application-toolkit/apm-toolkit-micrometer-registry/src/test/java/org/apache/skywalking/apm/meter/micrometer/SkywalkingCounterTest.java

+7-10
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,36 @@
1818

1919
package org.apache.skywalking.apm.meter.micrometer;
2020

21-
import io.micrometer.core.instrument.Counter;
21+
import java.util.Arrays;
22+
import org.apache.skywalking.apm.agent.test.helper.FieldGetter;
2223
import org.junit.Assert;
2324
import org.junit.Test;
24-
import org.powermock.reflect.Whitebox;
25-
26-
import java.util.Arrays;
25+
import io.micrometer.core.instrument.Counter;
2726

2827
public class SkywalkingCounterTest {
2928

3029
@Test
31-
public void testCounter() {
30+
public void testCounter() throws IllegalAccessException, NoSuchFieldException {
3231
// Creating a simplified micrometer counter
3332
final SkywalkingMeterRegistry registry = new SkywalkingMeterRegistry();
3433
Counter counter = registry.counter("test_counter", "skywalking", "test");
3534

3635
// Check Skywalking counter type
3736
Assert.assertTrue(counter instanceof SkywalkingCounter);
3837
final SkywalkingCounter skywalkingCounter = (SkywalkingCounter) counter;
39-
final org.apache.skywalking.apm.toolkit.meter.Counter realCounter =
40-
Whitebox.getInternalState(skywalkingCounter, "counter");
38+
final org.apache.skywalking.apm.toolkit.meter.Counter realCounter = FieldGetter.getValue(skywalkingCounter, "counter");
4139
Assert.assertNotNull(realCounter);
4240
}
4341

4442
@Test
45-
public void testRateCounter() {
43+
public void testRateCounter() throws IllegalAccessException, NoSuchFieldException {
4644
final SkywalkingMeterRegistry registry = new SkywalkingMeterRegistry(new SkywalkingConfig(Arrays.asList("test_rate_counter")));
4745
final Counter counter = registry.counter("test_rate_counter", "skywalking", "test");
4846

4947
// Check Skywalking counter type
5048
Assert.assertTrue(counter instanceof SkywalkingCounter);
5149
final SkywalkingCounter skywalkingCounter = (SkywalkingCounter) counter;
52-
final org.apache.skywalking.apm.toolkit.meter.Counter realCounter =
53-
Whitebox.getInternalState(skywalkingCounter, "counter");
50+
final org.apache.skywalking.apm.toolkit.meter.Counter realCounter = FieldGetter.getValue(skywalkingCounter, "counter");
5451
Assert.assertNotNull(realCounter);
5552
}
5653
}

Diff for: apm-application-toolkit/apm-toolkit-micrometer-registry/src/test/java/org/apache/skywalking/apm/meter/micrometer/SkywalkingMeterRegistryTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ private void testNewMeter(String meterName, Meter.Type type, Statistic statistic
8888
.register(registry);
8989
}
9090

91-
9291
/**
9392
* Working on {@link io.micrometer.core.instrument.Gauge} check
9493
*/

Diff for: apm-commons/apm-datacarrier/pom.xml

+6
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
<artifactId>jmh-generator-annprocess</artifactId>
3434
<scope>test</scope>
3535
</dependency>
36+
37+
<dependency>
38+
<groupId>uk.org.webcompere</groupId>
39+
<artifactId>system-stubs-junit4</artifactId>
40+
<scope>test</scope>
41+
</dependency>
3642
</dependencies>
3743

3844
</project>

0 commit comments

Comments
 (0)