diff --git a/conf/functional/mooncake-selftests.conf b/conf/functional/mooncake-selftests.conf index 0e45376b6d02bbb21fcaa410a2a09a852910d05c..7dff108e33a02f29d418b73e6c8827f9cb54ca2f 100644 --- a/conf/functional/mooncake-selftests.conf +++ b/conf/functional/mooncake-selftests.conf @@ -1,3 +1,2 @@ test -transfer-engine-selftests -transfer-engine-examples \ No newline at end of file +ci-test \ No newline at end of file diff --git a/tests/mooncake-selftests/install.sh b/tests/mooncake-selftests/install.sh index bb170809f9abf43f74841da06301c6260f808899..0a6017f7755197e13a115d02f9623cf03f9aed03 100644 --- a/tests/mooncake-selftests/install.sh +++ b/tests/mooncake-selftests/install.sh @@ -1,11 +1,22 @@ #!/bin/bash INSTALL_DEP=${INSTALL_DEP:-"0"} - + build() { - git clone git@github.com:kvcache-ai/mooncake-dev.git $TONE_BM_BUILD_DIR/mooncake - set -x + GIT_SSH_COMMAND='ssh -i /root/.ssh/id_rsa' + git clone ${CI_REPO_URL} $TONE_BM_BUILD_DIR/mooncake cd $TONE_BM_BUILD_DIR/mooncake + git fetch origin ${CI_REPO_TARGET_BRANCH} :target_branch + git checkout target_branch + git reset --hard ${CI_REPO_TARGET_COMMIT} + git fetch origin ${CI_REPO_SOURCE_BRANCH} :source_branch + git checkout source_branch + git reset --hard ${CI_REPO_SOURCE_COMMIT} + git rebase target_branch + if [[ $? != 0 ]]; then + echo "rebase fail!" + return -1 + fi if [[ "$INSTALL_DEP" == 1 ]]; then bash dependencies.sh fi diff --git a/tests/mooncake-selftests/run.sh b/tests/mooncake-selftests/run.sh index 45d084740d0fd898cd7a0a09a7b647b123702023..0edcafd4d6f458620e8cd11e1c227e7d54c7eb90 100644 --- a/tests/mooncake-selftests/run.sh +++ b/tests/mooncake-selftests/run.sh @@ -11,23 +11,14 @@ setup() run() { - set -x export LD_LIBRARY_PATH=/usr/local/lib/ - [ -f $TONE_BM_RUN_DIR/result.log ] && rm $TONE_BM_RUN_DIR/result.log - touch $TONE_BM_RUN_DIR/result.log - if [[ "$test" == "transfer-engine-selftests" ]]; then - cd $TONE_BM_RUN_DIR/mooncake/build/mooncake-transfer-engine/tests - for case in $(ls | grep test); do - if echo $case | grep rdma; then - echo "$case: Skip" >> $TONE_BM_RUN_DIR/result.log - else - eval "timeout 300s ./$case" - if [[ $? -eq 0 ]];then - echo "$case: Pass" >> $TONE_BM_RUN_DIR/result.log - else - echo "$case: Fail" >> $TONE_BM_RUN_DIR/result.log - fi - fi + [ -f $TONE_BM_RUN_DIR/results.txt ] && rm $TONE_BM_RUN_DIR/results.txt + touch $TONE_BM_RUN_DIR/results.txt + if [[ "$test" == "ci-test" ]]; then + cd $TONE_BM_RUN_DIR/mooncake/.ci + for case in $(ls | grep .sh); do + chmod +x "$case" + ./$case $TONE_BM_RUN_DIR/mooncake/build $TONE_BM_RUN_DIR done fi } @@ -35,5 +26,5 @@ run() parse() { - cat $TONE_BM_RUN_DIR/result.log + cat $TONE_BM_RUN_DIR/results.txt } \ No newline at end of file