2015-08-31 19:37:26 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# This script is executed by Sandcastle
|
|
|
|
# to determine next steps to run
|
|
|
|
|
2015-09-09 23:32:26 +00:00
|
|
|
#
|
|
|
|
# Helper variables
|
|
|
|
#
|
2015-09-04 19:25:15 +00:00
|
|
|
REPORT_EMAIL="'report': [
|
|
|
|
{
|
|
|
|
'type':'email',
|
|
|
|
'triggers':['fail'],
|
|
|
|
'emails':['leveldb@fb.com']
|
|
|
|
}
|
|
|
|
]"
|
|
|
|
|
2015-09-09 23:32:26 +00:00
|
|
|
CLEANUP_ENV="
|
|
|
|
{
|
|
|
|
'name':'Cleanup environment',
|
|
|
|
'shell':'rm -rf /dev/shm/rocksdb && mkdir /dev/shm/rocksdb && make clean',
|
|
|
|
'user':'root'
|
|
|
|
}"
|
|
|
|
|
|
|
|
DEBUG="OPT=-g"
|
|
|
|
SHM="TEST_TMPDIR=/dev/shm/rocksdb"
|
|
|
|
GCC_481="ROCKSDB_FBCODE_BUILD_WITH_481=1"
|
|
|
|
ASAN="COMPILE_WITH_ASAN=1"
|
|
|
|
CLANG="USE_CLANG=1"
|
|
|
|
LITE="OPT=-DROCKSDB_LITE"
|
|
|
|
TSAN="COMPILE_WITH_TSAN=1"
|
|
|
|
|
|
|
|
#
|
|
|
|
# RocksDB unit test in parallel
|
|
|
|
# Currently we always have noise in our parallel runs. This job is to help
|
|
|
|
# manage the noise
|
|
|
|
#
|
|
|
|
PARALLEL_UNIT_TEST_COMMANDS="[
|
|
|
|
{
|
|
|
|
'name':'Rocksdb Parallel Unit Test',
|
|
|
|
'steps': [
|
|
|
|
$CLEANUP_ENV,
|
|
|
|
{
|
|
|
|
'name':'Build and test RocksDB debug version',
|
|
|
|
'shell':'$SHM $DEBUG make check 2>&1 > /dev/null || cat t/log-*',
|
|
|
|
'user':'root'
|
|
|
|
},
|
|
|
|
$CLEANUP_ENV,
|
|
|
|
{
|
|
|
|
'name':'Build and test RocksDB debug version under gcc-4.8.1',
|
|
|
|
'shell':'$SHM $GCC_481 $DEBUG make check 2>&1 > /dev/null || cat t/log-*',
|
|
|
|
'user':'root'
|
|
|
|
},
|
|
|
|
],
|
|
|
|
$REPORT_EMAIL
|
|
|
|
}
|
|
|
|
]"
|
|
|
|
|
2015-09-02 19:16:42 +00:00
|
|
|
#
|
|
|
|
# RocksDB unit test
|
|
|
|
#
|
2015-08-31 19:37:26 +00:00
|
|
|
UNIT_TEST_COMMANDS="[
|
|
|
|
{
|
|
|
|
'name':'Rocksdb Unit Test',
|
|
|
|
'steps': [
|
2015-09-09 23:32:26 +00:00
|
|
|
$CLEANUP_ENV,
|
2015-08-31 19:37:26 +00:00
|
|
|
{
|
2015-09-09 23:32:26 +00:00
|
|
|
'name':'Build and test RocksDB debug version',
|
|
|
|
'shell':'$SHM $DEBUG make J=1 check',
|
2015-08-31 19:37:26 +00:00
|
|
|
'user':'root'
|
|
|
|
},
|
|
|
|
],
|
2015-09-04 19:25:15 +00:00
|
|
|
$REPORT_EMAIL
|
2015-08-31 19:37:26 +00:00
|
|
|
}
|
|
|
|
]"
|
|
|
|
|
2015-09-03 21:53:33 +00:00
|
|
|
#
|
|
|
|
# RocksDB unit test on gcc-4.8.1
|
|
|
|
#
|
|
|
|
UNIT_TEST_COMMANDS_481="[
|
|
|
|
{
|
2015-09-09 23:32:26 +00:00
|
|
|
'name':'Rocksdb Unit Test on GCC 4.8.1',
|
2015-09-03 21:53:33 +00:00
|
|
|
'steps': [
|
2015-09-09 23:32:26 +00:00
|
|
|
$CLEANUP_ENV,
|
2015-09-03 21:53:33 +00:00
|
|
|
{
|
2015-09-09 23:32:26 +00:00
|
|
|
'name':'Build and test RocksDB debug version',
|
|
|
|
'shell':'$SHM $GCC_481 $DEBUG make J=1 check',
|
2015-09-03 21:53:33 +00:00
|
|
|
'user':'root'
|
|
|
|
},
|
2015-09-09 23:32:26 +00:00
|
|
|
],
|
|
|
|
$REPORT_EMAIL
|
|
|
|
}
|
|
|
|
]"
|
|
|
|
|
|
|
|
#
|
|
|
|
# RocksDB unit test with CLANG
|
|
|
|
#
|
|
|
|
CLANG_UNIT_TEST_COMMANDS="[
|
|
|
|
{
|
|
|
|
'name':'Rocksdb Unit Test',
|
|
|
|
'steps': [
|
|
|
|
$CLEANUP_ENV,
|
2015-09-03 21:53:33 +00:00
|
|
|
{
|
2015-09-09 23:32:26 +00:00
|
|
|
'name':'Build and test RocksDB debug',
|
|
|
|
'shell':'$CLANG $SHM $DEBUG make check',
|
2015-09-03 21:53:33 +00:00
|
|
|
'user':'root'
|
2015-09-09 23:32:26 +00:00
|
|
|
},
|
2015-09-03 21:53:33 +00:00
|
|
|
],
|
2015-09-04 19:25:15 +00:00
|
|
|
$REPORT_EMAIL
|
2015-09-03 21:53:33 +00:00
|
|
|
}
|
|
|
|
]"
|
|
|
|
|
2015-09-09 23:32:26 +00:00
|
|
|
#
|
|
|
|
# Build RocksDB lite
|
|
|
|
#
|
|
|
|
LITE_BUILD_COMMANDS="[
|
|
|
|
{
|
|
|
|
'name':'Rocksdb Lite build',
|
|
|
|
'steps': [
|
|
|
|
$CLEANUP_ENV,
|
|
|
|
{
|
|
|
|
'name':'Build RocksDB debug version',
|
|
|
|
'shell':'$LITE $DEBUG make J=1 static_lib',
|
|
|
|
'user':'root'
|
|
|
|
},
|
|
|
|
],
|
|
|
|
$REPORT_EMAIL
|
|
|
|
}
|
|
|
|
]"
|
2015-09-03 21:53:33 +00:00
|
|
|
|
2015-09-02 19:16:42 +00:00
|
|
|
#
|
|
|
|
# RocksDB stress/crash test
|
|
|
|
#
|
|
|
|
STRESS_CRASH_TEST_COMMANDS="[
|
|
|
|
{
|
|
|
|
'name':'Rocksdb Stress/Crash Test',
|
|
|
|
'steps': [
|
2015-09-09 23:32:26 +00:00
|
|
|
$CLEANUP_ENV,
|
2015-09-02 19:16:42 +00:00
|
|
|
{
|
2015-09-09 23:32:26 +00:00
|
|
|
'name':'Build and run RocksDB debug stress tests',
|
|
|
|
'shell':'$SHM $DEBUG make J=1 db_stress',
|
2015-09-02 19:16:42 +00:00
|
|
|
'user':'root'
|
|
|
|
},
|
|
|
|
{
|
2015-09-09 23:32:26 +00:00
|
|
|
'name':'Build and run RocksDB debug crash tests',
|
|
|
|
'shell':'$SHM $DEBUG make J=1 crash_test',
|
2015-09-02 19:16:42 +00:00
|
|
|
'user':'root'
|
|
|
|
}
|
|
|
|
],
|
2015-09-04 19:25:15 +00:00
|
|
|
$REPORT_EMAIL
|
2015-09-02 19:16:42 +00:00
|
|
|
}
|
|
|
|
]"
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# RocksDB test under address sanitizer
|
|
|
|
#
|
|
|
|
ASAN_TEST_COMMANDS="[
|
|
|
|
{
|
2015-09-09 23:32:26 +00:00
|
|
|
'name':'Rocksdb Unit Test under ASAN',
|
2015-09-02 19:16:42 +00:00
|
|
|
'steps': [
|
2015-09-09 23:32:26 +00:00
|
|
|
$CLEANUP_ENV,
|
2015-09-02 19:16:42 +00:00
|
|
|
{
|
2015-09-09 23:32:26 +00:00
|
|
|
'name':'Test RocksDB debug under ASAN',
|
|
|
|
'shell':'set -o pipefail && $SHM $ASAN $DEBUG make J=1 asan_check |& /usr/facebook/ops/scripts/asan_symbolize.py -d',
|
2015-09-02 19:16:42 +00:00
|
|
|
'user':'root'
|
|
|
|
}
|
|
|
|
],
|
2015-09-04 19:25:15 +00:00
|
|
|
$REPORT_EMAIL
|
2015-09-02 19:16:42 +00:00
|
|
|
}
|
|
|
|
]"
|
|
|
|
|
|
|
|
#
|
|
|
|
# RocksDB crash testing under address sanitizer
|
|
|
|
#
|
|
|
|
ASAN_CRASH_TEST_COMMANDS="[
|
|
|
|
{
|
2015-09-09 23:32:26 +00:00
|
|
|
'name':'Rocksdb crash test under ASAN',
|
2015-09-02 19:16:42 +00:00
|
|
|
'steps': [
|
2015-09-09 23:32:26 +00:00
|
|
|
$CLEANUP_ENV,
|
2015-09-02 19:16:42 +00:00
|
|
|
{
|
2015-09-09 23:32:26 +00:00
|
|
|
'name':'Build and run RocksDB debug asan_crash_test',
|
|
|
|
'shell':'$SHM $DEBUG make J=1 asan_crash_test',
|
2015-09-02 19:16:42 +00:00
|
|
|
'user':'root'
|
|
|
|
},
|
|
|
|
],
|
2015-09-04 19:25:15 +00:00
|
|
|
$REPORT_EMAIL
|
2015-09-02 19:16:42 +00:00
|
|
|
}
|
|
|
|
]"
|
|
|
|
|
|
|
|
#
|
2015-09-09 23:32:26 +00:00
|
|
|
# RocksDB unit test under valgrind
|
2015-09-02 19:16:42 +00:00
|
|
|
#
|
2015-09-09 23:32:26 +00:00
|
|
|
VALGRIND_TEST_COMMANDS="[
|
2015-09-02 19:16:42 +00:00
|
|
|
{
|
2015-09-09 23:32:26 +00:00
|
|
|
'name':'Rocksdb Unit Test under valgrind',
|
2015-09-02 19:16:42 +00:00
|
|
|
'steps': [
|
2015-09-09 23:32:26 +00:00
|
|
|
$CLEANUP_ENV,
|
2015-09-02 19:16:42 +00:00
|
|
|
{
|
2015-09-09 23:32:26 +00:00
|
|
|
'name':'Run RocksDB debug unit tests',
|
|
|
|
'shell':'$SHM $DEBUG ./build_tools/valgrind_test.sh',
|
2015-09-02 19:16:42 +00:00
|
|
|
'user':'root'
|
|
|
|
},
|
2015-09-09 23:32:26 +00:00
|
|
|
],
|
|
|
|
$REPORT_EMAIL
|
|
|
|
}
|
|
|
|
]"
|
|
|
|
|
|
|
|
#
|
|
|
|
# RocksDB test under TSAN
|
|
|
|
#
|
|
|
|
TSAN_TEST_COMMANDS="[
|
|
|
|
{
|
|
|
|
'name':'Rocksdb Unit Test under TSAN',
|
|
|
|
'steps': [
|
|
|
|
$CLEANUP_ENV,
|
2015-09-02 19:16:42 +00:00
|
|
|
{
|
2015-09-09 23:32:26 +00:00
|
|
|
'name':'Run RocksDB debug unit test',
|
|
|
|
'shell':'set -o pipefail && $SHM $DEBUG $TSAN make J=1 check',
|
2015-09-02 19:16:42 +00:00
|
|
|
'user':'root'
|
2015-09-09 23:32:26 +00:00
|
|
|
},
|
2015-09-02 19:16:42 +00:00
|
|
|
],
|
2015-09-04 19:25:15 +00:00
|
|
|
$REPORT_EMAIL
|
2015-09-02 19:16:42 +00:00
|
|
|
}
|
|
|
|
]"
|
|
|
|
|
2015-08-31 19:37:26 +00:00
|
|
|
case $1 in
|
2015-09-09 23:32:26 +00:00
|
|
|
punit)
|
|
|
|
echo $PARALLEL_UNIT_TEST_COMMANDS
|
|
|
|
;;
|
2015-08-31 19:37:26 +00:00
|
|
|
unit)
|
|
|
|
echo $UNIT_TEST_COMMANDS
|
|
|
|
;;
|
2015-09-03 21:53:33 +00:00
|
|
|
unit_481)
|
|
|
|
echo $UNIT_TEST_COMMANDS_481
|
|
|
|
;;
|
2015-09-09 23:32:26 +00:00
|
|
|
clang_unit)
|
|
|
|
echo $CLANG_UNIT_TEST_COMMANDS
|
|
|
|
;;
|
|
|
|
lite)
|
|
|
|
echo $LITE_BUILD_COMMANDS
|
|
|
|
;;
|
2015-09-02 19:16:42 +00:00
|
|
|
stress_crash)
|
|
|
|
echo $STRESS_CRASH_TEST_COMMANDS
|
|
|
|
;;
|
|
|
|
asan)
|
|
|
|
echo $ASAN_TEST_COMMANDS
|
|
|
|
;;
|
|
|
|
asan_crash)
|
|
|
|
echo $ASAN_CRASH_TEST_COMMANDS
|
|
|
|
;;
|
2015-09-09 23:32:26 +00:00
|
|
|
valgrind)
|
|
|
|
echo $VALGRIND_TEST_COMMANDS
|
|
|
|
;;
|
|
|
|
tsan)
|
|
|
|
echo $TSAN_TEST_COMMANDS
|
2015-09-02 19:16:42 +00:00
|
|
|
;;
|
2015-08-31 19:37:26 +00:00
|
|
|
*)
|
2015-09-09 23:32:26 +00:00
|
|
|
echo "Invalid determinator command"
|
2015-08-31 19:37:26 +00:00
|
|
|
;;
|
|
|
|
esac
|