提交 5a2a34f1 编写于 作者: S Shengliang Guan

add multiprocess mode to CI

上级 e1660a12
......@@ -50,4 +50,11 @@
./test.sh -f tsim/stable/values.sim
./test.sh -f tsim/stable/vnode3.sim
# --- for multi process mode
./test.sh -f tsim/user/basic1.sim -m
./test.sh -f tsim/insert/basic1.sim -m
./test.sh -f tsim/stable/vnode3.sim -m
./test.sh -f tsim/tmq/basic.sim -m
#======================b1-end===============
......@@ -5,18 +5,12 @@ set +e
echo "Executing deploy.sh"
if [ $# != 4 ]; then
echo "argument list need input : "
echo " -n nodeName"
echo " -i nodePort"
exit 1
fi
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`
NODE_NAME=
NODE=
while getopts "n:i:" arg
MULTIPROCESS=0
while getopts "n:i:m" arg
do
case $arg in
n)
......@@ -25,6 +19,9 @@ do
i)
NODE=$OPTARG
;;
m)
MULTIPROCESS=1
;;
?)
echo "unkonw argument"
;;
......@@ -145,5 +142,5 @@ echo "statusInterval 1" >> $TAOS_CFG
echo "asyncLog 0" >> $TAOS_CFG
echo "locale en_US.UTF-8" >> $TAOS_CFG
echo "telemetryReporting 0" >> $TAOS_CFG
echo "multiProcess 0" >> $TAOS_CFG
echo "multiProcess ${MULTIPROCESS}" >> $TAOS_CFG
echo " " >> $TAOS_CFG
......@@ -7,7 +7,6 @@
##################################################
set +e
#set -x
FILE_NAME=
RELEASE=0
......@@ -16,7 +15,8 @@ VALGRIND=0
UNIQUE=0
UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN`
while getopts "f:avu" arg
MULTIPROCESS=1
while getopts "f:avum" arg
do
case $arg in
f)
......@@ -28,6 +28,9 @@ do
u)
UNIQUE=1
;;
m)
MULTIPROCESS=1
;;
?)
echo "unknow argument"
;;
......@@ -125,8 +128,13 @@ if [ -n "$FILE_NAME" ]; then
echo valgrind --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes --log-file=${CODE_DIR}/../script/valgrind.log $PROGRAM -c $CFG_DIR -f $FILE_NAME
valgrind --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes --log-file=${CODE_DIR}/../script/valgrind.log $PROGRAM -c $CFG_DIR -f $FILE_NAME
else
echo "ExcuteCmd:" $PROGRAM -c $CFG_DIR -f $FILE_NAME
$PROGRAM -c $CFG_DIR -f $FILE_NAME
if [[ $MULTIPROCESS -eq 1 ]];then
echo "ExcuteCmd(multiprocess):" $PROGRAM -m -c $CFG_DIR -f $FILE_NAME
$PROGRAM -m -c $CFG_DIR -f $FILE_NAME
else
echo "ExcuteCmd(singleprocess):" $PROGRAM -c $CFG_DIR -f $FILE_NAME
$PROGRAM -c $CFG_DIR -f $FILE_NAME
fi
fi
else
echo "ExcuteCmd:" $PROGRAM -c $CFG_DIR -f basicSuite.sim
......
......@@ -155,6 +155,7 @@ extern int32_t simScriptSucced;
extern int32_t simDebugFlag;
extern char simScriptDir[];
extern bool abortExecution;
extern bool useMultiProcess;
SScript *simParseScript(char *fileName);
SScript *simProcessCallOver(SScript *script);
......
......@@ -305,25 +305,24 @@ bool simExecuteRunBackCmd(SScript *script, char *option) {
return true;
}
void simReplaceShToBat(char *dst) {
char *sh = strstr(dst, ".sh");
if (sh != NULL) {
void simReplaceStr(char *buf, char *src, char *dst) {
char *begin = strstr(buf, src);
if (begin != NULL) {
int32_t srcLen = (int32_t)strlen(src);
int32_t dstLen = (int32_t)strlen(dst);
char *end = dst + dstLen;
*(end + 1) = 0;
int32_t interval = (dstLen - srcLen);
int32_t remainLen = (int32_t)strlen(buf);
char *end = buf + remainLen;
*(end + interval) = 0;
for (char *p = end; p >= sh; p--) {
*(p + 1) = *p;
for (char *p = end; p >= begin; p--) {
*(p + interval) = *p;
}
sh[0] = '.';
sh[1] = 'b';
sh[2] = 'a';
sh[3] = 't';
sh[4] = ' ';
memcpy(begin, dst, dstLen);
}
simDebug("system cmd is %s", dst);
simInfo("system cmd is %s", buf);
}
bool simExecuteSystemCmd(SScript *script, char *option) {
......@@ -334,9 +333,13 @@ bool simExecuteSystemCmd(SScript *script, char *option) {
simVisuallizeOption(script, option, buf + strlen(buf));
#else
sprintf(buf, "%s%s", simScriptDir, option);
simReplaceShToBat(buf);
simReplaceStr(buf, ".sh", ".bat");
#endif
if (useMultiProcess) {
simReplaceStr(buf, "deploy.sh", "deploy.sh -m");
}
simLogSql(buf, true);
int32_t code = system(buf);
int32_t repeatTimes = 0;
......
......@@ -18,6 +18,7 @@
bool simExecSuccess = false;
bool abortExecution = false;
bool useMultiProcess = false;
void simHandleSignal(int32_t signo, void *sigInfo, void *context) {
simSystemCleanUp();
......@@ -32,6 +33,8 @@ int32_t main(int32_t argc, char *argv[]) {
tstrncpy(configDir, argv[++i], 128);
} else if (strcmp(argv[i], "-f") == 0 && i < argc - 1) {
strcpy(scriptFile, argv[++i]);
} else if (strcmp(argv[i], "-m") == 0) {
useMultiProcess = true;
} else {
printf("usage: %s [options] \n", argv[0]);
printf(" [-c config]: config directory, default is: %s\n", configDir);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册