initial preparation for local tests

This commit is contained in:
Shlomi Noach 2016-08-22 09:20:17 +02:00
parent fc954562a3
commit 0bb8d70fce
3 changed files with 58 additions and 0 deletions

14
localtests/test.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
set -e
tests_path=$(dirname $0)
cd $tests_path
gh-ost-test-mysql-master -e "select 1"
gh-ost-test-mysql-replica -e "select 1"
find . ! -path . -type d | cut -d "/" -f 2 | while read test_name ; do
echo "Testing: $test_name"
done

View File

@ -0,0 +1,24 @@
drop table if exists gh_ost_test;
create table gh_ost_test (
id int auto_increment,
i int not null,
bi bigint not null,
iu int unsigned not null,
biu bigint unsigned not null,
primary key(id)
) auto_increment=1;
drop event if exists gh_ost_test;
delimiter ;;
create event gh_ost_test
on schedule every 1 second
starts current_timestamp
ends current_timestamp + interval 60 second
on completion not preserve
enable
do
begin
insert into gh_ost_test values (null, -2147483647, -9223372036854775807, 4294967295, 18446744073709551615);
set @last_insert_id := cast(last_insert_id() as signed);
update gh_ost_test set i=-2147483647+@last_insert_id, bi=-9223372036854775807+@last_insert_id, iu=4294967295-@last_insert_id, biu=18446744073709551615-@last_insert_id where id < @last_insert_id order by id desc limit 1;
end ;;

20
localtests/unsigned/test Normal file
View File

@ -0,0 +1,20 @@
go run go/cmd/gh-ost/main.go \
--conf=/Users/shlomi-noach/tmp/gh-osc.cnf \
--port=22297 \
--database=test \
--table=gh_ost_test \
--alter="engine=innodb" \
--exact-rowcount \
--switch-to-rbr \
--initially-drop-old-table \
--initially-drop-ghost-table \
--throttle-query="select timestampdiff(second, min(last_update), now()) < 5 from _gh_ost_test_ghc" \
--serve-socket-file=/tmp/gh-ost.test.sock \
--initially-drop-socket-file \
--postpone-cut-over-flag-file=/tmp/gh-ost.postpone.flag \
--execute \
--verbose \
--debug \
--stack \
~/sandboxes/rsandbox_mysql-5_6_28/m test -e "select * from $t" | md5sum ; ~/sandboxes/rsandbox_mysql-5_6_28/m test -e "select * from _${t}_del" | md5sum ; ~/sandboxes/rsandbox_mysql-5_6_28/m test -e "select * from $t limit 5"