[MDEV-12130] Improve mysqltest language (Full-time project) Created: 2017-02-26  Updated: 2023-09-14

Status: Open
Project: MariaDB Server
Component/s: Scripts & Clients, Tests
Fix Version/s: None

Type: Task Priority: Major
Reporter: Sergei Golubchik Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 1
Labels: gsoc17, gsoc18, gsoc19, gsoc20, gsoc22

Issue Links:
Duplicate
duplicates MDEV-25209 Improve mysqltest language Closed
Relates
relates to MDEV-12138 mysqltest: source inside a loop Open
relates to MDEV-12139 mysqltest: errors in source in a loop Open
relates to MDEV-21271 Switching off/on separate tests in my... Open
relates to MDEV-28914 MTR commands do not support "assert",... Open

 Description   

mysqltest has a lot of historical problems:

  • ad hoc parser, weird limitations
  • commands added as needed with no view over the total language structure
  • historical code issues (e.g. casts that become unnecessary ~10 years ago)
    etc

A lot can be done to improve it.

Ideas

to simplify writing tests

  • control structures, else in if, break and continue in while, for (or foreach) loop
  • proper expression support in let, if, etc
  • letenv command to set environment variables instead of having let do it.
  • ${var} and ${${var}} variable expansion
  • rich enough expressions to make resorting to sql unnecessary in most cases
    • in particular, see rpl_init.inc
  • remove unused and redundant commands (e.g. system vs exec, query_vertical vs vertical_results ONCE)
  • remove complex commands that do many sql statements under the hood, if they can be scripted, e.g. sync_slave_with_master
  • scoped variables
  • parameters for the source command
  • remove dead code
  • returning values from perl command (in some easier way than writing a new file and sourcing it)
    • e.g. stderr is stored in $perl ?
  • running many test files on one server connection. They are supposed to be independent, so for performance reasons we can avoid restarting mysqltest for them

to simplify debugging

  • make `echo` automatically print `#` at the start of every line (optionally, don't do it if it's explicitly specified — for backward compatibility)
  • make most commands print itself to the log.
    • os and file operations, like exec/remove_file, etc, should strip MYSQL_VAR_DIR from paths.
  • remove over-verbose treatment of rpl test failures (already done in 64dd3969481)


 Comments   
Comment by Amol Holani [ 2017-03-02 ]

Hi,
I'm amol holani, computer science student from College of Engineering, Pune(COEP, India). I would love to contribute to this project. Can you explain more about ad hoc parser. Also, How can I get some documentation about mysqltest?

Thank you.

Comment by Sergei Golubchik [ 2017-03-03 ]

yes, but, please, ask this question on maria-developers@ mailing list

Comment by Amol Holani [ 2017-03-03 ]

sure, I will ask on the mailing list.

Comment by Amol Holani [ 2017-04-02 ]

Hi Sergei,
I have submitted proposal for GSoC based on this project. Please review it.

Comment by Andrew Hutchings [ 2023-09-14 ]

Break has now been implemented in 11.3.

Generated at Thu Feb 08 07:55:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.