Make auto_sanity_test always use the db_sanity_test.cc of the newer commit.
Summary: Whenever we add new tests in db_sanity_test.cc, the verification test will fail since the old version db_sanity_test.cc does not have the newly added test. This patch makes auto_sanity_test.sh always use the db_sanity_test.cc of the newer commit. As a result, a macro guard is added to allow db_sanity_test.cc to be backward compatible. Test Plan: tools/auto_sanity_check.sh Reviewers: sdong, rven, igor Reviewed By: igor Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D35997
This commit is contained in:
parent
e9fddb7a2b
commit
cfa576402c
|
@ -46,6 +46,8 @@ makestuff
|
||||||
mv db_sanity_test new_db_sanity_test
|
mv db_sanity_test new_db_sanity_test
|
||||||
echo "Creating db based on the new commit --- $commit_new"
|
echo "Creating db based on the new commit --- $commit_new"
|
||||||
./new_db_sanity_test $dir_new create
|
./new_db_sanity_test $dir_new create
|
||||||
|
cp ./tools/db_sanity_test.cc $dir_new
|
||||||
|
cp ./tools/auto_sanity_test.sh $dir_new
|
||||||
|
|
||||||
echo "============================================================="
|
echo "============================================================="
|
||||||
echo "Making build $commit_old"
|
echo "Making build $commit_old"
|
||||||
|
@ -54,28 +56,36 @@ if [ $? -ne 0 ]; then
|
||||||
echo "[ERROR] Can't checkout $commit_old"
|
echo "[ERROR] Can't checkout $commit_old"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
cp -f $dir_new/db_sanity_test.cc ./tools/.
|
||||||
|
cp -f $dir_new/auto_sanity_test.sh ./tools/.
|
||||||
makestuff
|
makestuff
|
||||||
mv db_sanity_test old_db_sanity_test
|
mv db_sanity_test old_db_sanity_test
|
||||||
echo "Creating db based on the old commit --- $commit_old"
|
echo "Creating db based on the old commit --- $commit_old"
|
||||||
./old_db_sanity_test $dir_old create
|
./old_db_sanity_test $dir_old create
|
||||||
|
|
||||||
echo "============================================================="
|
echo "============================================================="
|
||||||
echo "Verifying new db $dir_new using the old commit --- $commit_old"
|
echo "[Backward Compability Check]"
|
||||||
./old_db_sanity_test $dir_new verify
|
echo "Verifying old db $dir_old using the new commit --- $commit_new"
|
||||||
|
./new_db_sanity_test $dir_old verify
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "[ERROR] Verification of $dir_new using commit $commit_old failed."
|
echo "[ERROR] Backward Compability Check fails:"
|
||||||
|
echo " Verification of $dir_old using commit $commit_new failed."
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "============================================================="
|
echo "============================================================="
|
||||||
echo "Verifying old db $dir_old using the new commit --- $commit_new"
|
echo "[Forward Compatibility Check]"
|
||||||
./new_db_sanity_test $dir_old verify
|
echo "Verifying new db $dir_new using the old commit --- $commit_old"
|
||||||
|
./old_db_sanity_test $dir_new verify
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "[ERROR] Verification of $dir_old using commit $commit_new failed."
|
echo "[ERROR] Forward Compability Check fails:"
|
||||||
|
echo " $dir_new using commit $commit_old failed."
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm old_db_sanity_test
|
rm old_db_sanity_test
|
||||||
rm new_db_sanity_test
|
rm new_db_sanity_test
|
||||||
|
rm -rf $dir_new
|
||||||
|
rm -rf $dir_old
|
||||||
|
|
||||||
echo "Auto sanity test passed!"
|
echo "Auto sanity test passed!"
|
||||||
|
|
|
@ -142,7 +142,9 @@ class SanityTestZlibCompressionVersion2 : public SanityTest {
|
||||||
: SanityTest(path) {
|
: SanityTest(path) {
|
||||||
options_.compression = kZlibCompression;
|
options_.compression = kZlibCompression;
|
||||||
BlockBasedTableOptions table_options;
|
BlockBasedTableOptions table_options;
|
||||||
|
#if ROCKSDB_MAJOR > 3 || (ROCKSDB_MAJOR == 3 && ROCKSDB_MINOR >= 10)
|
||||||
table_options.format_version = 2;
|
table_options.format_version = 2;
|
||||||
|
#endif
|
||||||
options_.table_factory.reset(NewBlockBasedTableFactory(table_options));
|
options_.table_factory.reset(NewBlockBasedTableFactory(table_options));
|
||||||
}
|
}
|
||||||
virtual Options GetOptions() const override { return options_; }
|
virtual Options GetOptions() const override { return options_; }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user