Commit Graph

14 Commits

Author SHA1 Message Date
7fc3527e1d Check for Docker in run_npm_test.sh
Lack of Docker can cause build failure
To avoid it if Docker is not available
test is not started, simply returns 0
It is hard to make Docker installation reliable especially for very old or very new distros
2019-04-18 12:10:24 +03:00
1572e088bf Run REST API and MaxCtrl unit tests
Install Docker when building on CentOS 7. This allows the REST API and
MaxCtrl unit tests to be run.
2018-08-13 10:54:25 +03:00
064ad8fa4f Improve MaxScale startup and shutdown in NPM tests
The tests are now less violent in how they stop MaxScale. Also the logs
are now removed before a new test run is executed.
2018-08-13 10:28:03 +03:00
a399c58df3 Make NPM tests runnable by root
The tests can now be run as root. This is most likely required in some
cases and it should not break things if they are run as root (e.g. inside
a VM with no other users).

NPM prevents the use of the root user (due to modules getting root access)
and uses an unprivileged user to install the modules. As maxctrl has to
generate the version information at install time, running `npm install` as
root will fail due to missing privileges to the current working
directory. To work around this, an explicit step was added.

Also changed the maxadmin checks to maxctrl to remove the dependency on
the socket file location being writable by non-root users
(/var/run/maxscale/ might not be accessible to all users).
2018-08-13 10:28:00 +03:00
7438a0f186 Remove unnecessary MaxScale parts for NPM tests
Some of the CMake arguments were redundant, unnecessary or just a
hindrance to testing.
2018-08-13 10:28:00 +03:00
a05b8c3ab4 Fix run_npm_test.sh
`docker exec` must be invoked without the -t flag as no terminal is
present.
2018-08-09 12:56:53 +03:00
207a8609dc Use docker directly in NPM test runner
The checking of the container status should use docker directly.
2018-08-09 12:56:49 +03:00
37d9c09c5f Make NPM tests faster
The test now builds with multiple jobs.
2018-08-09 12:56:49 +03:00
055043b5b8 Fail faster in NPM tests
The test script now stops if the configuration or build steps fail.
2018-08-07 22:14:33 +03:00
446116a8bb MXS-1999: Fix removal of undefined relationships
If a relationship isn't defined, it should not be removed. Only if a
relationship is change to a null relationship, should it be removed.

Also fixed the maxctrl test suite to verify that both it and the REST API
tests pass.
2018-08-07 22:14:33 +03:00
2f7251a769 Reuse same MariaDB cluster for testing
The test created a cluster for each test. Reusing the same servers allows
faster testing by reusing the already running servers.
2017-08-09 11:39:24 +03:00
64c5d6d610 Control npm testing with environment variables
The NPM based tests can now skip the stopping of the docker-compose
cluster by defining the SKIP_SHUTDOWN environment variable.
2017-07-18 11:37:18 +03:00
67b2654f50 Move REST API test scripts into a common directory
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.
2017-07-18 11:37:18 +03:00
173a97ae70 Refactor REST API test script into a npm test framework
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.
2017-07-18 11:37:18 +03:00