lp://staging/~percona-toolkit-dev/percona-toolkit/portable-test-suite
Executive summary:
OptionParser, Daemon, DSNParser:
* Minor changes for portability
PerconaTest.pm had a seasonal cleanup:
* A lot of functions were either unused, or used by just one file -- so they were either removed, merged into other functions, or phased out of PerconaTest and into the file that needed them.
* no_diff() in particular saw a large change -- most of it's options (sed, sort, trf, etc) were used only once or twice, and were undocumented. Now there's two transformation options: transform_sample and transform_result. However, it also adds a new option, cmd_is_file, meaning that the passed string is actually a filename and no_diff should just diff/apply the transforms then diff off that directly, without the need to call anything else. A large amount of no_diff uses were jumping through hoops because this was missing.
* Some new exports: touch(), which replaces `touch $file`, remove_tree(), which replaces `rm -rf $dir`, make_path(), which replaces and enhaces `mkdir $dir`, and tempfile(). The last three, besides being exported for convenience, also work around some annoying bugs/behavior in old versions of File::Temp and File::Path.
* cmd_output(), which replaces most backtick calls throughout the test suite. Think of it as a shelling out counterpart to output().
Nearly all of sandbox/ has been revamped:
* start/stop-sandbox are now deprecated (you can use $sandbox_
* test-env is now in Perl and uses Sandbox.
* You can use 'test-env start cluster' to start master/
* load-sakila-db is gone, but you can use $sandbox_
* use, start, stop and the version-specific config files are gone. They ar generated by $sandbox_
Sandbox.pm:
* Largest changes. Sandbox.pm is now just a factory that returns a Sandbox plugin object. By default uses Sandbox::MySQL, but other plugins can be specified by passing a plugin => ... argument to new.
Sandbox::MySQL:
* Actually contains only a bit of the functionality; the most interesting bits are implemented by it's three roles, described below
* Six attributes: ->basedir() (PERCONA_
* An important bit of new functionality is ->register_
* Provides a lot of convenience functions: pid_file_for, socket_file_for, pid_for, port_for, registered_servers, get_executable, base_dir_for, config_file_for, genlog, dsn_for
* ->use() and ->load_file() incompatible changes
Sandbox:
* ->start_
* ->stop_
* ->kill_
* ->server_
Sandbox:
* ->start_sandbox() provides the functionality of sandbox/
* ->stop_sandbox() provides the functionality of sandbox/
* ->set_as_
* ->_reset_sandbox() implements test-env reset
* ->sandbox_version() implements test-env version, and also replaces $PerconaTest:
* ->_call_
* Additionally, this role has the methods that create the use/stop/start and config files. The first three are all in Perl now, to make them work everywhere.
Sandbox:
* Basically the dumping ground for things that we want Sandbox to have, but don't need when starting the sandbox itself. This is the only place that uses DSNParser -- everything else gets by with ->use()
* ->wait_
* ->is_cluster_node()
* ->verify_
* Maybe we can put in util/checksum-
Sandbox:
* A Sandbox plugin, and actually a subclass of Sandbox::MySQL. You can get one of these by doing Sandbox->new(plugin => "Percona:
* ->start_
Test suite:
* ...
* catfile etc
- Get this branch:
- bzr branch lp://staging/~percona-toolkit-dev/percona-toolkit/portable-test-suite
Branch merges
Related bugs
Related blueprints
Branch information
- Owner:
- Percona Toolkit developers
- Status:
- Development
Recent revisions
- 467. By Brian Fraser
-
Minor speedup change in lib/Sandbox/
MySQL/Role/ Servers. pm: either wait for ibdata1, or for the server to respond to pings - 466. By Brian Fraser
-
Sandboxes: Explicitly set tmpdir to the sandboxes' basedir, to avoid race conditions.
t/pt-slave-
find/pt- slave-find. t occasionally fails if this isn't done,
as it hits this bug: http://bugs.mysql. com/bug. php?id= 62055 - 461. By Brian Fraser <email address hidden>
-
Phase out version-specific config files in sandbox/servers.
- 460. By Brian Fraser <email address hidden>
-
Fix for 1063912: pt-table-checksum 2.1.4 miscategorizes Percona XtraDB Cluster-$
This commit adds two warnings; one for the case of master -> cluster,
and one for cluster1 -> cluster2.
The code that checks if two nodes belong to the same cluster
is "best effort" -- it will generally DTRT, but will fail in
the case that all of the following are true:
* Both nodes have the same cluster name
* They aren't in a master-slave relationship
* Both nodes have a different wsrep_cluster_address,
or both of their addresses aren't 'gcom://'; that is,
they both aren't the first node of a cluster.Which can happen in the case that
Cluster 1:
node1 -> addr points to node2
node2 -> addr points to node3
node3 -> addr points to node1Cluster 2:
_node1 -> addr points to _node2
_node2 -> addr points to _node3
_node3 -> addr points to _node1node1 is a master to _node1.
The dsns table has all of the nodes.ptc will think that cluster 2 is only _node1, and cluster 1
is everything else. Further heuristics could check if we've
seen a second cluster and check the addresses from there,
but isn't currently worth the effort. - 459. By Brian Fraser <email address hidden>
-
config file templates should only be created if there isn't a template in place already
- 458. By Brian Fraser <email address hidden>
-
Several fixes for starting clusters, including test-env start cluster
test-env start cluster starts master/
slave1/ slave2 as a PXC cluster.
This breaks nearly everywhere, at the moment.
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp://staging/percona-toolkit/2.1