run-sql-bench.pl
run-sql-bench.pl
è uno script Perl per l'esecuzione automatica di sql-bench (sql-bench si trova nel codice sorgente di MariaDB.)
run-sql-bench.pl
si trova nel progetto mariadb-tools su Launchpad. Una volta scaricata una copia di mariadb-tools, lo script e le sue directory di configurazione si trovano nella directory sql-bench
. Ai fini di questo articolo, la directory in cui si trova mariadb-tools
verrà chiamata ${BASE_DIR}
.
Lo script run-sql-bench.pl
si trova in '${BASE_DIR}/sql-bench/run-sql-bench.pl
'.
Un esempio degli script di configurazione usati per le diverse esecuzioni si trova nelle varie sottodirectory di ${BASE_DIR}/sql-bench/
.
Ecco come eseguire lo script run-sql-bench.pl
:
- Creare un branch di un albero di MariaDB o MySQL
- Opzionalmente, si eseguano delle modifiche nella branch e si esegua un commit
- Si modifichi
run-sql-bench.pl
valorizzando le opzioni interne, soprattutto la variabile "my $path
". - Create a
${BASE_DIR}/sql-bench/conf/host.cnf
file for your system. An easy way to do this is by duplicating one of the examplehost.cnf
files:cp -avi ${BASE_DIR}/sql-bench/conf/pitbull.cnf ${BASE_DIR}/sql-bench/conf/${HOSTNAME}.cnf
Edit the file to customize it for your system. - Create
${HOSTNAME}.cnf
files under the${BASE_DIR}/sql-bench/basic
,${BASE_DIR}/sql-bench/debug
,${BASE_DIR}/sql-bench/debug-full
, and${BASE_DIR}/sql-bench/O2
directories, depending on which automated tests you want to run. Use the example files as a base and customize them for your system. - Run the
run-sql-bench.pl
script:cd ${BASE_DIR}/sql-bench/; ./run-sql-bench.pl --repository=[/path/to/bzr/repository] --sql-bench-options=[additional sql-bench-options] --debug=[yes|no]
is the MariaDB tree to use and compile, the script will also look here for sql-bench.--
repository
is mostly used in testing and debugging cases where we want to have short run times. For instance, using--
sql-bench-options
or--
small-test
.--
small-table- You can separate several sql-bench options with spaces like so:
--sql-bench-options="--small-test --small-table"
The results
Results are stored at the location specified by the $sql_bench_results
variable in the ${BASE_DIR}/sql-bench/conf/hostname.cnf
file for your host.
Results are organized in sub directories with the following schema:
sql-bench-results-dir/${HOSTNAME}/YYYY-MM-DD
Future plans
- Crash and error detection and reporting.
- One should be able to specify a test name for each file (
run-all-tests
)--
suffix='_xxxx'