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

add multiprocess mode to CI

上级 e1660a12
...@@ -50,4 +50,11 @@ ...@@ -50,4 +50,11 @@
./test.sh -f tsim/stable/values.sim ./test.sh -f tsim/stable/values.sim
./test.sh -f tsim/stable/vnode3.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=============== #======================b1-end===============
...@@ -5,18 +5,12 @@ set +e ...@@ -5,18 +5,12 @@ set +e
echo "Executing deploy.sh" 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` UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN` OS_TYPE=`$UNAME_BIN`
NODE_NAME= NODE_NAME=
NODE= NODE=
while getopts "n:i:" arg MULTIPROCESS=0
while getopts "n:i:m" arg
do do
case $arg in case $arg in
n) n)
...@@ -25,6 +19,9 @@ do ...@@ -25,6 +19,9 @@ do
i) i)
NODE=$OPTARG NODE=$OPTARG
;; ;;
m)
MULTIPROCESS=1
;;
?) ?)
echo "unkonw argument" echo "unkonw argument"
;; ;;
...@@ -145,5 +142,5 @@ echo "statusInterval 1" >> $TAOS_CFG ...@@ -145,5 +142,5 @@ echo "statusInterval 1" >> $TAOS_CFG
echo "asyncLog 0" >> $TAOS_CFG echo "asyncLog 0" >> $TAOS_CFG
echo "locale en_US.UTF-8" >> $TAOS_CFG echo "locale en_US.UTF-8" >> $TAOS_CFG
echo "telemetryReporting 0" >> $TAOS_CFG echo "telemetryReporting 0" >> $TAOS_CFG
echo "multiProcess 0" >> $TAOS_CFG echo "multiProcess ${MULTIPROCESS}" >> $TAOS_CFG
echo " " >> $TAOS_CFG echo " " >> $TAOS_CFG
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
################################################## ##################################################
set +e set +e
#set -x
FILE_NAME= FILE_NAME=
RELEASE=0 RELEASE=0
...@@ -16,7 +15,8 @@ VALGRIND=0 ...@@ -16,7 +15,8 @@ VALGRIND=0
UNIQUE=0 UNIQUE=0
UNAME_BIN=`which uname` UNAME_BIN=`which uname`
OS_TYPE=`$UNAME_BIN` OS_TYPE=`$UNAME_BIN`
while getopts "f:avu" arg MULTIPROCESS=1
while getopts "f:avum" arg
do do
case $arg in case $arg in
f) f)
...@@ -28,6 +28,9 @@ do ...@@ -28,6 +28,9 @@ do
u) u)
UNIQUE=1 UNIQUE=1
;; ;;
m)
MULTIPROCESS=1
;;
?) ?)
echo "unknow argument" echo "unknow argument"
;; ;;
...@@ -125,9 +128,14 @@ if [ -n "$FILE_NAME" ]; then ...@@ -125,9 +128,14 @@ 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 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 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 else
echo "ExcuteCmd:" $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 $PROGRAM -c $CFG_DIR -f $FILE_NAME
fi fi
fi
else else
echo "ExcuteCmd:" $PROGRAM -c $CFG_DIR -f basicSuite.sim echo "ExcuteCmd:" $PROGRAM -c $CFG_DIR -f basicSuite.sim
echo "------------------------------------------------------------------------" echo "------------------------------------------------------------------------"
......
...@@ -155,6 +155,7 @@ extern int32_t simScriptSucced; ...@@ -155,6 +155,7 @@ extern int32_t simScriptSucced;
extern int32_t simDebugFlag; extern int32_t simDebugFlag;
extern char simScriptDir[]; extern char simScriptDir[];
extern bool abortExecution; extern bool abortExecution;
extern bool useMultiProcess;
SScript *simParseScript(char *fileName); SScript *simParseScript(char *fileName);
SScript *simProcessCallOver(SScript *script); SScript *simProcessCallOver(SScript *script);
......
...@@ -305,25 +305,24 @@ bool simExecuteRunBackCmd(SScript *script, char *option) { ...@@ -305,25 +305,24 @@ bool simExecuteRunBackCmd(SScript *script, char *option) {
return true; return true;
} }
void simReplaceShToBat(char *dst) { void simReplaceStr(char *buf, char *src, char *dst) {
char *sh = strstr(dst, ".sh"); char *begin = strstr(buf, src);
if (sh != NULL) { if (begin != NULL) {
int32_t srcLen = (int32_t)strlen(src);
int32_t dstLen = (int32_t)strlen(dst); int32_t dstLen = (int32_t)strlen(dst);
char *end = dst + dstLen; int32_t interval = (dstLen - srcLen);
*(end + 1) = 0; int32_t remainLen = (int32_t)strlen(buf);
char *end = buf + remainLen;
*(end + interval) = 0;
for (char *p = end; p >= sh; p--) { for (char *p = end; p >= begin; p--) {
*(p + 1) = *p; *(p + interval) = *p;
} }
sh[0] = '.'; memcpy(begin, dst, dstLen);
sh[1] = 'b';
sh[2] = 'a';
sh[3] = 't';
sh[4] = ' ';
} }
simDebug("system cmd is %s", dst); simInfo("system cmd is %s", buf);
} }
bool simExecuteSystemCmd(SScript *script, char *option) { bool simExecuteSystemCmd(SScript *script, char *option) {
...@@ -334,9 +333,13 @@ bool simExecuteSystemCmd(SScript *script, char *option) { ...@@ -334,9 +333,13 @@ bool simExecuteSystemCmd(SScript *script, char *option) {
simVisuallizeOption(script, option, buf + strlen(buf)); simVisuallizeOption(script, option, buf + strlen(buf));
#else #else
sprintf(buf, "%s%s", simScriptDir, option); sprintf(buf, "%s%s", simScriptDir, option);
simReplaceShToBat(buf); simReplaceStr(buf, ".sh", ".bat");
#endif #endif
if (useMultiProcess) {
simReplaceStr(buf, "deploy.sh", "deploy.sh -m");
}
simLogSql(buf, true); simLogSql(buf, true);
int32_t code = system(buf); int32_t code = system(buf);
int32_t repeatTimes = 0; int32_t repeatTimes = 0;
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
bool simExecSuccess = false; bool simExecSuccess = false;
bool abortExecution = false; bool abortExecution = false;
bool useMultiProcess = false;
void simHandleSignal(int32_t signo, void *sigInfo, void *context) { void simHandleSignal(int32_t signo, void *sigInfo, void *context) {
simSystemCleanUp(); simSystemCleanUp();
...@@ -32,6 +33,8 @@ int32_t main(int32_t argc, char *argv[]) { ...@@ -32,6 +33,8 @@ int32_t main(int32_t argc, char *argv[]) {
tstrncpy(configDir, argv[++i], 128); tstrncpy(configDir, argv[++i], 128);
} else if (strcmp(argv[i], "-f") == 0 && i < argc - 1) { } else if (strcmp(argv[i], "-f") == 0 && i < argc - 1) {
strcpy(scriptFile, argv[++i]); strcpy(scriptFile, argv[++i]);
} else if (strcmp(argv[i], "-m") == 0) {
useMultiProcess = true;
} else { } else {
printf("usage: %s [options] \n", argv[0]); printf("usage: %s [options] \n", argv[0]);
printf(" [-c config]: config directory, default is: %s\n", configDir); 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.
先完成此消息的编辑!
想要评论请 注册