Skip to content

Commit 39e7612

Browse files
committed
Enhance run.sh to support extra Maven properties per version
support-version.list now supports format: version[,key=value[,key=value...]] Extra properties are passed as -D flags to Maven. This allows different framework versions to use different dependency versions (e.g., Spring Boot). Example: 2.7.14,spring.boot.version=2.7.18 Use this to extend Spring Kafka test coverage: - 2.3.x scenario: 2.3-2.6 (default Spring Boot 2.3), 2.7-2.9 (Spring Boot 2.7) - 3.x scenario: 3.0 (Spring Boot 3.0), 3.1-3.3 (matching Spring Boot 3.1-3.3)
1 parent 9ce740a commit 39e7612

4 files changed

Lines changed: 26 additions & 7 deletions

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Release Notes.
1616
* Extend Undertow plugin to support Undertow 2.1.x, 2.2.x, 2.3.x.
1717
* Extend GraphQL plugin to support graphql-java 18 -> 24 (20+ requires JDK 17).
1818
* Extend Spring Kafka plugin to support Spring Kafka 2.4 -> 2.9 and 3.0 -> 3.3.
19+
* Enhance test/plugin/run.sh to support extra Maven properties per version in support-version.list (format: version,key=value).
1920

2021
All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/249?closed=1)
2122

test/plugin/run.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,21 @@ ls "${jacoco_home}"/jacocoagent.jar || curl -Lso "${jacoco_home}"/jacocoagent.ja
231231
ls "${jacoco_home}"/jacococli.jar || curl -Lso "${jacoco_home}"/jacococli.jar https://repo1.maven.org/maven2/org/jacoco/org.jacoco.cli/${jacoco_version}/org.jacoco.cli-${jacoco_version}-nodeps.jar
232232

233233
supported_versions=`grep -v -E "^$|^#" ${supported_version_file}`
234-
for version in ${supported_versions}
234+
for version_line in ${supported_versions}
235235
do
236+
# Support format: version[,key=value[,key=value...]]
237+
# e.g., "2.7.14,spring.boot.version=2.7.19"
238+
# First token is test.framework.version, rest are extra Maven properties.
239+
version=$(echo "${version_line}" | cut -d',' -f1)
240+
extra_props=""
241+
remaining=$(echo "${version_line}" | cut -d',' -f2- -s)
242+
if [[ -n "${remaining}" ]]; then
243+
IFS=',' read -ra props <<< "${remaining}"
244+
for prop in "${props[@]}"; do
245+
extra_props="${extra_props} -D${prop}"
246+
done
247+
fi
248+
236249
testcase_name="${scenario_name}-${version}"
237250

238251
# testcase working directory, there are logs, data and packages.
@@ -245,7 +258,7 @@ do
245258
cp ./config/expectedData.yaml ${case_work_base}/data
246259

247260
# echo "build ${testcase_name}"
248-
${mvnw} -q --batch-mode clean package -Dtest.framework.version=${version} && \
261+
${mvnw} -q --batch-mode clean package -Dtest.framework.version=${version} ${extra_props} && \
249262
mv ./target/${scenario_name}.* ${case_work_base}
250263

251264
java -jar \

test/plugin/scenarios/spring-kafka-2.3.x-scenario/support-version.list

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17+
# Format: spring-kafka-version[,key=value] — extra properties passed to Maven.
18+
# spring-kafka 2.7+ requires Spring Framework 5.3+ (ApplicationStartup class),
19+
# so those versions override spring.boot.version to match.
1720
2.3.10.RELEASE
1821
2.4.13.RELEASE
1922
2.5.17.RELEASE
2023
2.6.13
21-
2.7.14
22-
2.8.11
23-
2.9.13
24+
2.7.14,spring.boot.version=2.7.18
25+
2.8.11,spring.boot.version=2.7.18
26+
2.9.13,spring.boot.version=2.7.18

test/plugin/scenarios/spring-kafka-3.x-scenario/support-version.list

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# limitations under the License.
1616

1717
# Spring Kafka 3.x requires Spring Boot 3.x / JDK 17+
18-
# This scenario uses Spring Boot 3.0.13, so only 3.0.x is compatible.
19-
# 3.1+ requires Spring Boot 3.1+ (Spring Framework 6.1).
18+
# 3.1+ requires Spring Framework 6.1, so override spring.boot.version.
2019
3.0.17
20+
3.1.4,spring.boot.version=3.1.12
21+
3.2.10,spring.boot.version=3.2.12
22+
3.3.7,spring.boot.version=3.3.8

0 commit comments

Comments
 (0)