Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Call For Participation)*: Different expected error behavior when recording the test output. #1

Open
bb7133 opened this issue Mar 23, 2020 · 0 comments

Comments

@bb7133
Copy link
Member

bb7133 commented Mar 23, 2020

For example, given an test file, say t/some_test.test:

sh> cat t/some_test.test -n
     1	drop database if exists tdb;
     2	create database tdb;
     3	use tdb;
     4	
     5	create table t(a int primary key);
     6	insert into t values (1);
     7	# an incorrect expected error
     8	--Error 1062
     9	insert into t values (2);

Notice that at line 8, an incorrect expected error("--Error 1062") is given, and when we try to record the result, MySQL test framework reports an error like the followings:

sh>mysqltest -u root < t/mysql_replace.test
drop database if exists tdb;
create database tdb;
use tdb;
create table t(a int primary key);
insert into t values (1);
mysqltest: At line 9: Query 'insert into t values (2)' succeeded, should have failed with error '1062'
not ok

But in this framework, recording is done successfully:

sh>run-tests.sh -s tidb-server -r some_test -b n
skip building tidb-server, using existing binary: ./tidb-server
skip building mysqltest, using existing binary: ./mysql_test
start tidb-server, log file: ./mysql-test.out
tidb-server(PID: 10971) started
record result for case: "some_test"
./t/some_test.test: ok! 2 test cases passed, take time 0.023170004 s

Great, All tests passed
mysqltest end
tidb-server(PID: 10971) stopped
@bb7133 bb7133 changed the title *: Different expected error behavior when recording the test output. (Call For Participation)*: Different expected error behavior when recording the test output. Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant