77 exit 1
88}
99
10- _get_repo_revision () {
11- if [[ -d $1 ]]; then
12- cd $1
13- repo_hash_commit=$( git rev-parse HEAD)
14- echo -n ${repo_hash_commit}
15- cd $OLDPWD
16- else
17- echo " [Error] $1 doesn't exist"
18- fi
19- }
20-
2110prepare_env () {
2211 out_dir=" ${_DIR} /out"
2312 logs_dir=" ${_DIR} /logs"
@@ -30,7 +19,7 @@ prepare_env() {
3019
3120 [ " ${TRAVIS} " == " true" ] && {
3221 if [ " ${TOOLCHAIN} " == " gnu" ] ; then
33- python .ci/toolchain.py -v $TOOLCHAIN_VER -c $TOOLCHAIN_CACHE_FOLDER || die
22+ python scripts/ .ci/toolchain.py -v $TOOLCHAIN_VER -c $TOOLCHAIN_CACHE_FOLDER || die
3423 if [ -d $TOOLCHAIN_CACHE_FOLDER ] ; then
3524 if [ -d $TOOLCHAIN_CACHE_FOLDER /$TOOLCHAIN_VER ] ; then
3625 ARC_DEV_TOOL_ROOT=" ${TOOLCHAIN_CACHE_FOLDER} /${TOOLCHAIN_VER} "
@@ -63,31 +52,19 @@ run_test() {
6352 export PYTHONUNBUFFERED=1
6453 {
6554 hostname
66- python ./scripts/test.py --platform $BOARD --toolchain $TOOLCHAIN $target_flags --build-only --report-dir logs_dir || {
67- if [[ $? == 124 ]]; then
68- echo " twister timeout"
69- fi
70- true
71- }
55+ python ./scripts/test.py --platform $BOARD --toolchain $TOOLCHAIN $target_flags --build-only --report-dir $logs_dir || true
7256 } 2>&1 | tee -a $test_log
7357}
7458
7559parse_logs () {
7660 # get rid of MAC \r and change it to UNIX \n
7761 sed -i ' s/\r/\n/g' $test_log
78- # use sed remove ANSI color codes. \x1B is the escape special character, \[ is the second character of the escape sequence, [0-9] is the color value(s) regex
79- sed -i -r ' s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g' $test_log
80- failed=$( cat $test_log | sed -n ' s/^.*, \([0-9]\+\) .*failed.*$/\1 /p' )
81- embarc_osp_repo_commit=$( _get_repo_revision ${_DIR} )
82- COMMENT=" "
83- if ! [[ $failed == 0 ]]; then
84- comment_url=" https://api.github.com/repos/$TRAVIS_REPO_SLUG /commits/$embarc_osp_repo_commit /comments"
85- for line in $( grep " build status:" $test_log | sed -E ' s/^.* (.*) failed.*$/\1/' ) ; do
86- COMMENT=" $COMMENT <br>$line "
87- done
88- curl --user " $EMBARC_BOT " --request POST https://api.github.com/repos/$TRAVIS_REPO_SLUG /commits/$embarc_osp_repo_commit /comments \
89- --data ' {"body":"' ${COMMENT} ' "}'
90- fi
62+
63+ METRICS=$( cat $test_log | grep " test configurations passed" | sed -n ' s/^.*-\(.*\)*$/\1/p' )
64+ COMMENT=" $BOARD ${BD_VER:- } test results: $METRICS "
65+
66+ curl --user " $EMBARC_BOT " --request POST https://api.github.com/repos/$TRAVIS_REPO_SLUG /commits/$TRAVIS_COMMIT /comments \
67+ --data ' {"body":"' " ${COMMENT} " ' "}'
9168}
9269
9370main () {
0 commit comments