未验证 提交 e7f66c91 编写于 作者: K kezhenxu94 提交者: GitHub

[CI] Reorganize the Plugin Tests to speed up the PR checks (#4566)

上级 f1b2b298
# 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.
name: PluginsTest
on:
pull_request:
paths:
- '.github/workflows/plugins-test*.yaml'
- 'apm-application-toolkit/**'
- 'apm-commons/**'
- 'apm-protocol/**'
- 'apm-sniffer/**'
- 'test/plugin/**'
- '**/pom.xml'
- '!test/e2e/**'
- '!apm-webapp/**'
- '!apm-dist/**'
- '!apm-dist-es7/**'
- '!apm-docker/**'
- '!docs/**'
- '!oap-server/**'
jobs:
PluginsTest:
name: Plugin
runs-on: ubuntu-18.04
timeout-minutes: 90
strategy:
fail-fast: true
matrix:
case:
- { name: 'activemq-scenario', title: 'ActiveMQ 5.10.0-5.15.4 (22)' }
- { name: 'apm-toolkit-trace-scenario', title: 'apm-toolkit-trace (1)' }
- { name: 'armeria-0.96minus-scenario', title: 'Armeria 0.63.0-0.95.0 (20)' }
- { name: 'armeria-0.96plus-scenario', title: 'Armeria 0.96.0-0.97.0 (2)' }
- { name: 'avro-scenario', title: 'Avro 1.7.0-1.8.2 (10)' }
- { name: 'canal-scenario', title: 'Canal 1.0.24-1.1.2 (5)' }
- { name: 'cassandra-java-driver-3.x-scenario', title: 'Cassandra 3.7.0-3.7.2 (3)' }
- { name: 'customize-scenario', title: 'customize (1)' }
- { name: 'dubbo-2.5.x-scenario', title: 'Dubbo 2.5.x-2.6.x (10)' }
- { name: 'dubbo-2.7.x-scenario', title: 'Dubbo 2.7.x (4)' }
- { name: 'ehcache-2.x-scenario', title: 'Ehcache 2.8.x-2.10.x (19)' }
- { name: 'elasticsearch-5.x-scenario', title: 'ElasticSearch 5.x (3)' }
- { name: 'elasticsearch-6.x-scenario', title: 'ElasticSearch 6.7.1-6.8.4 (7)' }
- { name: 'elasticsearch-7.x-scenario', title: 'ElasticSearch 7.0.0-7.5.2 (14)' }
- { name: 'feign-scenario', title: 'Feign 9.0.0-9.5.1 (8)' }
- { name: 'finagle-17.10.x-scenario', title: 'Finagle 17.10.0-20.1.0' }
- { name: 'finagle-6.25.x-scenario', title: 'Finagle 6.25.0-6.43.0' }
- { name: 'finagle-6.44.x-scenario', title: 'Finagle 6.44.0-7.1.0' }
- { name: 'gateway-scenario', title: 'Spring-Cloud-Gateway 2.1.x (3)' }
- { name: 'grpc-scenario', title: 'gRPC 1.6.0-1.25.0 (22)' }
- { name: 'gson-scenario', title: 'Gson (7)' }
steps:
- uses: actions/checkout@v2
- name: checkout submodules
shell: bash
run: |
git submodule sync --recursive
git -c protocol.version=2 submodule update --init --force --recursive --depth=1
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Build SkyWalking Agent
run: ./mvnw --batch-mode clean package -DskipTests -Pagent
- name: Build Docker image
run: ./mvnw --batch-mode -f test/plugin/pom.xml clean package -DskipTests docker:build -DBUILD_NO=local
- name: ${{ matrix.case.title }}
run: bash test/plugin/run.sh ${{ matrix.case.name }}
# 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.
name: PluginsTest
on:
pull_request:
paths:
- '.github/workflows/plugins-test*.yaml'
- 'apm-application-toolkit/**'
- 'apm-commons/**'
- 'apm-protocol/**'
- 'apm-sniffer/**'
- 'test/plugin/**'
- '**/pom.xml'
- '!test/e2e/**'
- '!apm-webapp/**'
- '!apm-dist/**'
- '!apm-dist-es7/**'
- '!apm-docker/**'
- '!docs/**'
- '!oap-server/**'
jobs:
PluginsTest:
name: Plugin
runs-on: ubuntu-18.04
timeout-minutes: 90
strategy:
fail-fast: true
matrix:
case:
- { name: 'h2-scenario', title: 'H2 (24)' }
- { name: 'httpasyncclient-scenario', title: 'HttpAsyncClient 4.0-4.1.3 (7)' }
- { name: 'httpclient-3.x-scenario', title: 'HttpClient 2.0-3.1 (5)' }
- { name: 'httpclient-4.3.x-scenario', title: 'HttpClient 4.3.x-4.5.x (14)' }
- { name: 'hystrix-scenario', title: 'Hystrix 1.4.20-1.5.12 (20)' }
- { name: 'jdk-http-scenario', title: 'JDK http (1)' }
- { name: 'jdk-threading-scenario', title: 'JDK Threading (1)' }
- { name: 'jedis-scenario', title: 'Jedis 2.4.0-2.9.0 (18)' }
- { name: 'jetty-scenario', title: 'Jetty 9.x (63)' }
- { name: 'kafka-scenario', title: 'Kafka 0.11.0.0-2.3.0 (16)' }
- { name: 'kotlin-coroutine-scenario', title: 'Kotlin Coroutine 1.0.1-1.3.3 (4)' }
- { name: 'lettuce-scenario', title: 'Lettuce 5.x (17)' }
- { name: 'mongodb-3.x-scenario', title: 'Mongodb 3.4.0-3.11.1 (22)' }
- { name: 'mysql-scenario', title: 'MySQL 5.1.2-8.0.15 (53)' }
- { name: 'netty-socketio-scenario', title: 'Netty-SocketIO 1.x (4)' }
steps:
- uses: actions/checkout@v2
- name: checkout submodules
shell: bash
run: |
git submodule sync --recursive
git -c protocol.version=2 submodule update --init --force --recursive --depth=1
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Build SkyWalking Agent
run: ./mvnw --batch-mode clean package -DskipTests -Pagent
- name: Build Docker image
run: ./mvnw --batch-mode -f test/plugin/pom.xml clean package -DskipTests docker:build -DBUILD_NO=local
- name: ${{ matrix.case.title }}
run: bash test/plugin/run.sh ${{ matrix.case.name }}
# 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.
name: PluginsTest
on:
pull_request:
paths:
- '.github/workflows/plugins-test*.yaml'
- 'apm-application-toolkit/**'
- 'apm-commons/**'
- 'apm-protocol/**'
- 'apm-sniffer/**'
- 'test/plugin/**'
- '**/pom.xml'
- '!test/e2e/**'
- '!apm-webapp/**'
- '!apm-dist/**'
- '!apm-dist-es7/**'
- '!apm-docker/**'
- '!docs/**'
- '!oap-server/**'
jobs:
PluginsTest:
name: Plugin
runs-on: ubuntu-18.04
timeout-minutes: 90
strategy:
fail-fast: true
matrix:
case:
- { name: 'okhttp-scenario', title: 'OKHttp 3.0.x-3.14.x (34)' }
- { name: 'play-scenario', title: 'Play! Framework' }
- { name: 'postgresql-above9.4.1207-scenario', title: 'PostgreSQL 9.4.1207+ (62)' }
- { name: 'postgresql-scenario', title: 'PostgreSQL 9.2.x-9.4.x (36)' }
- { name: 'pulsar-scenario', title: 'Pulsar 2.2.0-2.4.1 (7)' }
- { name: 'rabbitmq-scenario', title: 'RabbitMQ (12)' }
- { name: 'redisson-scenario', title: 'Redisson 3.x (37)' }
- { name: 'resttemplate-4.x-scenario', title: 'RestTemplate 4.0.0.RELEASE-4.3.26.RELEASE (57)' }
- { name: 'servicecomb-0.x-scenario', title: 'ServiceComb 0.x (5)' }
- { name: 'servicecomb-1.x-scenario', title: 'ServiceComb 1.x (5)' }
- { name: 'shardingsphere-3.x-scenario', title: 'ShardingSphere 3.0.0 (1)' }
- { name: 'shardingsphere-4.x-RC1-RC2-scenario', title: 'ShardingSphere 4.0.0-RC1-4.0.0-RC2 (2)' }
- { name: 'shardingsphere-4.x-RC3-scenario', title: 'ShardingSphere 4.0.0-RC3 (1)' }
- { name: 'sofarpc-scenario', title: 'SofaRPC 5.4.0-5.6.2 (23)' }
- { name: 'solrj-7.x-scenario', title: 'SolrJ 7.x (12)' }
- { name: 'spring-3.0.x-scenario', title: 'Spring 3.0.x (8)' }
- { name: 'spring-3.1.x-scenario', title: 'Spring 3.1.x-4.0.x (25)' }
- { name: 'spring-4.1.x-scenario', title: 'Spring 4.1.x-4.2.x (20)' }
- { name: 'spring-4.3.x-scenario', title: 'Spring 4.3.x-5.2.x (54)' }
- { name: 'spring-async-scenario', title: 'Spring Async 4.3.x-5.1.x (35)' }
- { name: 'spring-cloud-feign-1.1.x-scenario', title: 'SpringCloud Feign 1.1.x (8)' }
- { name: 'spring-cloud-feign-1.2.x-scenario', title: 'SpringCloud Feign 1.2.x-1.4.x (23)' }
- { name: 'spring-cloud-feign-2.x-scenario', title: 'SpringCloud Feign 2.x (14)' }
- { name: 'spring-tx-scenario', title: 'Spring-tx 4.x+ (10)' }
- { name: 'struts2.3-scenario', title: 'Struts2.3 (35)' }
- { name: 'struts2.5-scenario', title: 'Struts2.5 (14)' }
steps:
- uses: actions/checkout@v2
- name: checkout submodules
shell: bash
run: |
git submodule sync --recursive
git -c protocol.version=2 submodule update --init --force --recursive --depth=1
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Build SkyWalking Agent
run: ./mvnw --batch-mode clean package -DskipTests -Pagent
- name: Build Docker image
run: ./mvnw --batch-mode -f test/plugin/pom.xml clean package -DskipTests docker:build -DBUILD_NO=local
- name: ${{ matrix.case.title }}
run: bash test/plugin/run.sh ${{ matrix.case.name }}
\ No newline at end of file
# 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.
name: PluginsTest
on:
pull_request:
paths:
- '.github/workflows/plugins-test*.yaml'
- 'apm-application-toolkit/**'
- 'apm-commons/**'
- 'apm-protocol/**'
- 'apm-sniffer/**'
- 'test/plugin/**'
- '**/pom.xml'
- '!test/e2e/**'
- '!apm-webapp/**'
- '!apm-dist/**'
- '!apm-dist-es7/**'
- '!apm-docker/**'
- '!docs/**'
- '!oap-server/**'
jobs:
PluginsTest:
name: Plugin
runs-on: ubuntu-18.04
timeout-minutes: 90
strategy:
fail-fast: true
matrix:
case:
- { name: 'undertow-scenario', title: 'Undertow 1.3.0-2.0.27 (23)' }
- { name: 'webflux-scenario', title: 'Spring-WebFlux 2.x (7)' }
- { name: 'zookeeper-scenario', title: 'Zookeeper 3.4.x (14)' }
steps:
- uses: actions/checkout@v2
- name: checkout submodules
shell: bash
run: |
git submodule sync --recursive
git -c protocol.version=2 submodule update --init --force --recursive --depth=1
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Build SkyWalking Agent
run: ./mvnw --batch-mode clean package -DskipTests -Pagent
- name: Build Docker image
run: ./mvnw --batch-mode -f test/plugin/pom.xml clean package -DskipTests docker:build -DBUILD_NO=local
- name: ${{ matrix.case.title }}
run: bash test/plugin/run.sh ${{ matrix.case.name }}
Oracle:
name: Oracle
runs-on: ubuntu-18.04
timeout-minutes: 90
steps:
- uses: actions/checkout@v2
- name: checkout submodules
shell: bash
run: |
git submodule sync --recursive
git -c protocol.version=2 submodule update --init --force --recursive --depth=1
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Build SkyWalking Agent
run: ./mvnw --batch-mode clean package -DskipTests -Pagent
- name: Build Docker image
run: ./mvnw --batch-mode -f test/plugin/pom.xml clean package -DskipTests docker:build -DBUILD_NO=local
- name: Oracle 10.2.0.4.0 (1)
run: |
curl -O https://skyapm.github.io/ci-assist/jars/ojdbc14-10.2.0.4.0.jar
curl -L -o ./skywalking-agent/plugins/apm-oracle-10.x-plugin-1.0.1.jar https://github.com/SkyAPM/java-plugin-extensions/releases/download/1.0.1/apm-oracle-10.x-plugin-1.0.1.jar
./mvnw --batch-mode install:install-file -Dfile=ojdbc14-10.2.0.4.0.jar -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.4.0 -Dpackaging=jar
bash test/plugin/run.sh oracle-scenario
\ No newline at end of file
此差异已折叠。
# Plugin automatic test framework
Plugin test frameworks is designed for verifying the plugin function and compatible status. As there are dozens of plugins and
hundreds versions need to be verified, it is impossible to do manually.
Plugin test framework is designed for verifying the plugins' function and compatible status. As there are dozens of plugins and
hundreds of versions need to be verified, it is impossible to do manually.
The test framework uses container based tech stack, requires a set of real services with agent installed, then the test mock
OAP backend is running to check the segment and register data sent from agents.
OAP backend is running to check the segments and register data sent from agents.
Every plugin maintained in the main repo is required having its test cases, also matching the versions in the supported list doc.
Every plugin maintained in the main repo requires corresponding test cases, also matching the versions in the supported list doc.
## Environment Requirements
......@@ -559,41 +559,23 @@ rather than recompiling it every time.
Use `${SKYWALKING_HOME}/test/plugin/run.sh -h` to know more command options.
If the local test passed, then you could add it to `.github/workflows/plugins-test.yaml` file, which will drive the tests running on the Github Action of official SkyWalking repository. Please check the prev agent related PRs, and add your case to the fastest group, in order to make the whole test finished as soon as possible.
If the local test passed, then you could add it to `.github/workflows/plugins-test.<n>.yaml` file, which will drive the tests running on the Github Actions of official SkyWalking repository.
Based on your plugin's name, please add the test case into file `.github/workflows/plugins-test.<n>.yaml`, by alphabetical orders.
Every test case is a Github Action Step. Please use the scenario name, version range and version number to combine the name,
take the existing one as a reference.
Every test case is a Github Actions Job. Please use the `<scenario name> + <version range> + (<supported version count>)` as the Job `title`, and the scenario directory as the Job `name`,
mostly you'll just need to decide which file (`plugins-test.<n>.yaml`) to add your test case, and simply put one line (as follows) in it, take the existed cases as examples.
For example:
Here is a group named 'Kafka'. The latest step is Kafka scenario.
```
Kafka:
```yaml
jobs:
PluginsTest:
name: Plugin
runs-on: ubuntu-18.04
timeout-minutes: 90
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
# In the checkout@v2, it doesn't support git submodule. Execute the commands manually.
- name: checkout submodules
shell: bash
run: |
git submodule sync --recursive
git -c protocol.version=2 submodule update --init --force --recursive --depth=1
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Build SkyWalking Agent
run: ./mvnw clean package -DskipTests -Pagent >/dev/null
- name: Build the Docker image
run: ./mvnw -f test/plugin/pom.xml clean package -DskipTests docker:build -DBUILD_NO=local >/dev/null
- name: Run kafka 0.11.0.0-2.3.0 (16)
run: bash test/plugin/run.sh kafka-scenario
matrix:
case:
# ...
- { name: '<your case name>', title: '<PluginName, i.e. Spring> (<Supported Version Count, i.e 12>)' } # <<== insert one line by alphabetical orders
# ...
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册