未验证 提交 d14148d4 编写于 作者: W wallezhang 提交者: GitHub

fix: Fix macos test script command not found error. #6846 (#6964)

Co-authored-by: NZhenxu Ke <kezhenxu94@apache.org>
上级 e7d6b545
...@@ -7,6 +7,7 @@ Release Notes. ...@@ -7,6 +7,7 @@ Release Notes.
#### Project #### Project
* Add OpenSearch as storage option. * Add OpenSearch as storage option.
* Upgrade Kubernetes Java client dependency to 11.0. * Upgrade Kubernetes Java client dependency to 11.0.
* Fix plugin test script error in macOS.
#### Java Agent #### Java Agent
* Add `trace_segment_ref_limit_per_span` configuration mechanism to avoid OOM. * Add `trace_segment_ref_limit_per_span` configuration mechanism to avoid OOM.
......
...@@ -33,6 +33,8 @@ num_of_testcases= ...@@ -33,6 +33,8 @@ num_of_testcases=
image_version="jdk8-1.0.0" image_version="jdk8-1.0.0"
jacoco_version="${JACOCO_VERSION:-0.8.6}" jacoco_version="${JACOCO_VERSION:-0.8.6}"
os="$(uname)"
print_help() { print_help() {
echo "Usage: run.sh [OPTION] SCENARIO_NAME" echo "Usage: run.sh [OPTION] SCENARIO_NAME"
echo -e "\t-f, --force_build \t\t do force to build Plugin-Test tools and images" echo -e "\t-f, --force_build \t\t do force to build Plugin-Test tools and images"
...@@ -142,10 +144,18 @@ if [[ ! -d ${agent_home} ]]; then ...@@ -142,10 +144,18 @@ if [[ ! -d ${agent_home} ]]; then
${mvnw} --batch-mode -f ${home}/../../pom.xml -Pagent -DskipTests clean package ${mvnw} --batch-mode -f ${home}/../../pom.xml -Pagent -DskipTests clean package
fi fi
# if it fails last time, relevant information will be deleted # if it fails last time, relevant information will be deleted
sed -i '/<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>/d' ./pom.xml if [ "$os" == 'Darwin' ]; then
sed -i '' '/<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>/d' ./pom.xml
else
sed -i '/<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>/d' ./pom.xml
fi
# add scenario_name into plugin/pom.xml # add scenario_name into plugin/pom.xml
echo check code with the checkstyle-plugin echo check code with the checkstyle-plugin
sed -i '/<\/sourceDirectories>/i <sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>' ./pom.xml if [ "$os" == 'Darwin' ]; then
sed -i '' '/<\/sourceDirectories>/i\'$'\n''<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>'$'\n' ./pom.xml
else
sed -i '/<\/sourceDirectories>/i <sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>' ./pom.xml
fi
if [[ "$force_build" == "on" ]]; then if [[ "$force_build" == "on" ]]; then
profile= profile=
...@@ -153,7 +163,11 @@ if [[ "$force_build" == "on" ]]; then ...@@ -153,7 +163,11 @@ if [[ "$force_build" == "on" ]]; then
${mvnw} --batch-mode -f ${home}/pom.xml clean package -DskipTests ${profile} ${mvnw} --batch-mode -f ${home}/pom.xml clean package -DskipTests ${profile}
fi fi
# remove scenario_name into plugin/pom.xml # remove scenario_name into plugin/pom.xml
sed -i '/<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>/d' ./pom.xml if [ "$os" == 'Darwin' ]; then
sed -i '' '/<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>/d' ./pom.xml
else
sed -i '/<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>/d' ./pom.xml
fi
workspace="${home}/workspace/${scenario_name}" workspace="${home}/workspace/${scenario_name}"
[[ -d ${workspace} ]] && rm -rf $workspace [[ -d ${workspace} ]] && rm -rf $workspace
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册