提交 2af4ea8c 编写于 作者: D Daming 提交者: wu-sheng

support plugin testcases run with optional/bootstap plugins (#3617)

上级 72153230
......@@ -146,6 +146,26 @@ if [[ ! -f $supported_version_file ]]; then
exitWithMessage "cannot found 'support-version.list' in directory ${scenario_name}"
fi
_agent_home=${agent_home}
mode=`grep "runningMode" ${scenario_home}/configuration.yml |sed -e "s/\s//g" |awk -F: '{print $2}'`
if [[ "$mode" == "with_optional" ]]; then
agent_with_optional_home=${home}/workspace/agent_with_optional
if [[ ! -d ${agent_with_optional_home} ]]; then
mkdir -p ${agent_with_optional_home}
cp -r ${agent_home}/* ${agent_with_optional_home}
mv ${agent_with_optional_home}/optional-plugins/* ${agent_with_optional_home}/plugins/
fi
_agent_home=${agent_with_optional_home}
elif [[ "$mode" == "with_bootstrap" ]]; then
agent_with_bootstrap_home=${home}/workspace/agent_with_bootstrap
if [[ ! -d ${agent_with_bootstrap_home} ]]; then
mkdir -p ${agent_with_bootstrap_home}
cp -r ${agent_home}/* ${agent_with_bootstrap_home}
mv ${agent_with_bootstrap_home}/bootstrap-plugins/* ${agent_with_bootstrap_home}/plugins/
fi
_agent_home=${agent_with_bootstrap_home}
fi
supported_versions=`grep -v -E "^$|^#" ${supported_version_file}`
for version in ${supported_versions}
do
......@@ -172,7 +192,7 @@ do
-Dscenario.name=${scenario_name} \
-Dscenario.version=${version} \
-Doutput.dir=${case_work_base} \
-Dagent.dir=${agent_home} \
-Dagent.dir=${_agent_home} \
-Ddocker.image.version=${build_id} \
${plugin_runner_helper} 1>${case_work_logs_dir}/helper.log
......
......@@ -20,6 +20,7 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import com.google.common.base.Strings;
import org.apache.skywalking.plugin.test.helper.exception.ConfigureFileNotFoundException;
import org.apache.skywalking.plugin.test.helper.util.StringUtils;
import org.apache.skywalking.plugin.test.helper.vo.CaseConfiguration;
......@@ -37,6 +38,12 @@ public class ConfigurationImpl implements IConfiguration {
this.configuration = new Yaml().loadAs(new FileReader(new File(configureFile)), CaseConfiguration.class);
this.scenarioHome = System.getProperty("scenario.home");
if (!Strings.isNullOrEmpty(this.configuration.getRunningMode())) {
String runningMode = this.configuration.getRunningMode();
if (!runningMode.matches("default|with_optional|with_bootstrap")) {
throw new RuntimeException("RunningMode (" + runningMode + ") is not defined.");
}
}
}
@Override
......
......@@ -30,6 +30,7 @@ public class CaseConfiguration {
private List<String> environment;
private List<String> expose;
private List<String> depends_on;
private String runningMode;
public String getType() {
return type;
......@@ -110,4 +111,12 @@ public class CaseConfiguration {
public void setDepends_on(List<String> depends_on) {
this.depends_on = depends_on;
}
public String getRunningMode() {
return runningMode;
}
public void setRunningMode(String runningMode) {
this.runningMode = runningMode;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册