Skip to content

Commit

Permalink
fixes things
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsolr committed Oct 7, 2019
1 parent def2e48 commit 0a1668e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
12 changes: 5 additions & 7 deletions test/plugin/containers/tomcat-container/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@

FROM tomcat:8.5.42-jdk8-openjdk
MAINTAINER zhangxin@apache.org
WORKDIR /usr/local/skywalking-agent-scenario
WORKDIR /usr/local/skywalking/tools

COPY run.sh /
COPY catalina.sh /usr/local/tomcat/bin/

COPY skywalking-validator-tools.jar /usr/local/skywalking-agent-scenario
COPY skywalking-mock-collector.tar.gz /usr/local/skywalking-agent-scenario
RUN tar -xvf skywalking-mock-collector.tar.gz -C /usr/local/skywalking-agent-scenario

# RUN wget -O skywalking-mock-collector.tar.gz https://github.com/SkyAPMTest/skywalking-mock-collector/releases/download/V6.0.0-2018/skywalking-mock-collector.tar.gz && \
# tar -xvf skywalking-mock-collector.tar.gz -C /usr/local/skywalking-agent-scenario
COPY skywalking-validator-tools.jar /usr/local/skywalking/tools
COPY skywalking-mock-collector.tar.gz /usr/local/skywalking/tools
RUN tar -xvf skywalking-mock-collector.tar.gz -C /usr/local/skywalking/tools

RUN chmod +x /usr/local/tomcat/bin/catalina.sh && chmod +x /run.sh

WORKDIR /usr/local/skywalking/scenario
CMD ["/run.sh"]
6 changes: 3 additions & 3 deletions test/plugin/containers/tomcat-container/docker/catalina.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
# case the default is "true"
# -----------------------------------------------------------------------------

export AGENT_FILE_PATH=/usr/local/skywalking-agent-scenario/agent
export AGENT_FILE_PATH=/usr/local/skywalking/scenario/agent
echo "${AGENT_FILE_PATH}/skywalking-agent.jar"
if [ -f "${AGENT_FILE_PATH}/skywalking-agent.jar" ]; then
CATALINA_OPTS="$CATALINA_OPTS -javaagent:${AGENT_FILE_PATH}/skywalking-agent.jar
Expand All @@ -113,7 +113,7 @@ if [ -f "${AGENT_FILE_PATH}/skywalking-agent.jar" ]; then
-Dskywalking.collector.discovery_check_interval=2
-Dskywalking.collector.backend_service=localhost:19876
-Dskywalking.agent.service_name=${SCENARIO_NAME}
-Dskywalking.logging.dir=/usr/local/skywalking-agent-scenario/logs
-Dskywalking.logging.dir=/usr/local/skywalking/scenario/logs
-Xms256m -Xmx256m -XX:PermSize=64M -XX:MaxPermSize=64"
fi

Expand Down Expand Up @@ -220,7 +220,7 @@ fi
CLASSPATH="$CLASSPATH""$CATALINA_HOME"/bin/bootstrap.jar

if [ -z "$CATALINA_OUT" ] ; then
CATALINA_OUT=/usr/local/skywalking-agent-scenario/logs/catalina.out
CATALINA_OUT=/usr/local/skywalking/scenario/logs/catalina.out
fi

if [ -z "$CATALINA_TMPDIR" ] ; then
Expand Down
8 changes: 4 additions & 4 deletions test/plugin/containers/tomcat-container/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ function healthCheck() {
exitOnError "${SCENARIO_NAME}-${SCENARIO_VERSION} health check failed!"
}

SCENARIO_HOME=/usr/local/skywalking-agent-scenario/
TOOLS_HOME=/usr/local/skywalking/tools
SCENARIO_HOME=/usr/local/skywalking/scenario

# Speed up launch tomcat
rm /usr/local/tomcat/webapps/* -rf # remove needn't app
Expand All @@ -48,8 +49,7 @@ cp ${SCENARIO_HOME}/packages/*.war /usr/local/tomcat/webapps/

# start mock collector
echo "To start mock collector"
${SCENARIO_HOME}/skywalking-mock-collector/bin/collector-startup.sh \
1>${SCENARIO_HOME}/logs/collector.out 2>${SCENARIO_HOME}/logs/collector.err &
${TOOLS_HOME}/skywalking-mock-collector/bin/collector-startup.sh 1>${SCENARIO_HOME}/logs/collector.out 2>${SCENARIO_HOME}/logs/collector.err &
healthCheck http://localhost:12800/receiveData

echo "To start tomcat"
Expand All @@ -68,7 +68,7 @@ java -jar \
-Dv2=true \
-DtestDate="`date +%Y-%m-%d-%H-%M`" \
-DtestCasePath=${SCENARIO_HOME}/data/ \
${SCENARIO_HOME}/skywalking-validator-tools.jar 1>${SCENARIO_HOME}/logs/validate.log 2>&2
${TOOLS_HOME}/skywalking-validator-tools.jar 1>${SCENARIO_HOME}/logs/validate.log 2>&2
status=$?

if [[ $status -eq 0 ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ docker run \
--env SCENARIO_SUPPORT_FRAMEWORK=${scenario_name} \
--env SCENARIO_ENTRY_SERVICE=${entry_service} \
--env SCENARIO_HEALTH_CHECK_URL=${health_check} \
-v ${agent_home}:/usr/local/skywalking-agent-scenario/agent \
-v ${scenario_home}:/usr/local/skywalking-agent-scenario \
-v ${agent_home}:/usr/local/skywalking/scenario/agent \
-v ${scenario_home}:/usr/local/skywalking/scenario \
${docker_image_name}:latest 1>${scenario_home}/logs/container.log 2>&2

status="$?"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ public class Main {
private static Logger logger = LogManager.getLogger(Main.class);

public static void main(String[] args) {
logger.info("Begin to validate data.");
logger.error("error");

Report report = new Report();
String testCasePath = ConfigHelper.testCaseBaseDir();

Expand Down

0 comments on commit 0a1668e

Please sign in to comment.