The alterations to logging and maxscale were sending malformed JSON to
MaxScale. Boolean values weren't converted to JSON booleans but were sent
as strings.
Making the core a module proved to bring more problems than it solved. For
the sake of simplicity in installation and code coverage reporting, the
core is now completely contained in the `lib/` directory.
Also added preliminary coverage reporting with nyc.
The monitor user and password can now be defined as options to the create
command. This should help with the creation of a monitor in one request.
Fixed the command description of `create listener`.
All of the alter operations weren't properly validating the integer
parameters. This appeared to the client as successful modifications of
parameters with bad value.
If an unexpected network error occurs, only the error part of the response
should be printed. The complete object should be dumped only as a last
resort.
The main `maxctrl` function now does the cluster health checks and handles
the iteration over the host list. This solves the problem of how to
execute commands on multiple hosts while still allowing recursive calls
into the common functions.
This does not, however, solve the problem of how interconnected commands
across a set of servers are handled. One way to solve this would be to
offer a second main function, `maxctrl_cluster` which would call the
callback with a set of servers instead of a single server.
Minor refactoring to the core library to allow multiple calls from within
the same program.
Added --quiet option to silence output so that tests aren't so
verbose. Currently this only works on UNIX based systems.
The request-promise-native package adds support for request with native
promises. This is a convenient way to synchronize multiple HTTP requests.
The functions are changed to use promises to make testing easier. With
promises, the testing code can use the chai-as-promised library.
There are a few cases where doRequest is called with a callback that again
calls doAsyncRequest. With multiple hosts, this causes each command to be
propagated to all servers. This is a design flaw of the current multi-host
mode and needs to be changed.
Changed maxctrl.js to wait on the promises to silence some warnings if the
promise rejections are ignored.
All invocations into the common helper functions are now done through the
`maxctrl` function. This allows the program arguments to be passed to the
core as a parameter instead of reading them from global variables.
This helps with the implicit initialization that was done when the yargs
library was required which caused duplicated output.
Refactored the core functions so that they only process the argument
vector. The parsing of the argument vector is done in maxctrl.js where it
is more appropriate.
Moved and renamed the starting and stopping scripts from the REST API
tests to a common directory. This way the MaxCtrl tests can use the same
scripts to start and stop MaxScale.
Also moved the test configuration file into the `test/` directory and
changed some of the default directory locations.
The script can now be used to run an arbitrary set of Node.js tests as
long as they define the `test` npm target. Refactored REST API tests to
fit into this framework.
As the REST API is a part of the core, it is more appropriate for the
tests to reside there as well. Further refactoring of the testing needs to
be done to allow multiple components to use the same framework but with
different tests.
Making the invocation explicit should allow testing without actually
starting the process fromt the command line. Also returning a promise
allows chaining of commands for testing and verification.
Before creating the users, the master will do a RESET MASTER to remove the
automatically generated binlogs. The servers should now start a lot faster
since they no longer need to replicate the large amounts of data that were
in these generated binlogs.
The service and server tests were deleting the relationships object and
posting a body without it instead of posting an empty relationships object
to delete relationships.
The cli part of the code just passes the process argument vector the the
core part. The core part contains the actual functional parts of the
code. This split is done to make testing easier.
The host and port options were replace with one hosts option which
combines the two. This allows a single command to be executed on multiple
maxscale instances. Added accompanying code for checking responsiveness of
all maxscale instances and handling synchronization of the check
results. The code uses ECMAScript 2016 native promises to do this.
Added a configurable timeout to all requests. This should allow users to
interact with MaxScale over slow and laggy networks.
Before each executed command, all hosts given as parameters are pinged to
make sure they are alive. This should reduce the possibility of partial
execution of commands due to failed MaxScales.
The results of requests are grouped by the values of the hosts
option. This allows users to compare results of multiple servers with
relative ease.
Fixed reversion of the default credentials from mariadb:admin to
admin:mariadb.
The schemarouter should always use Backend::write for communication with
the backend servers. This keeps the backends in the correct state.
This fix solves some of the random test failures in the `sharding` test.
The keyword in the Json is now "match" and MatchRule class substitutes
CaptureRule
"replace": {
"column": "d_code",
"match": "(?<=aaa).*(?=-12)|(?<=-12).*"
},…
The tests should not drop the test database and then recreate it. This
adds an unnecessary burden on replication which will cause false positives
when replication is not fast enough.