-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide a way to the developers to deploy and launch the Clouseau search module more easily, therefore making it more accessible. This can help with running the Search-based Elixir tests as well as the Mango `text` search tests. This could allow us to catch more bugs ahead of time and might even inspire more improvements in the area. The extension is designed in a way to make it simple to integrate with the CI — only the Java environment of the proper version needs to be deployed, everything else could be managed from this repository. Such as bumping the version of Clouseau or fine-tuning the configuration parameters. This is an opt-in feature on two levels. First, one has to tell `./configure --enable-clouseau` to instantiate Clouseau locally. This will create the `clouseau` sub-directory that holds the contents of the Clouseau distribution of the specified version, which currently defaults to 2.22.0 (the latest). If an older version is needed, use the `--clouseau-version` flag. Then the `mango-test` and `elixir-search` targets will try to use Clouseau automatically just to make it easy to use in the old way. However, the `dev/run` script will not do the same. It requires the `--with-clouseau` flag to be passed for that. That is because the developer may not necessarily want to launch Clouseau ad hoc, even if it is available. With this, note that `elixir-search` is added to the `check` target. In lack of a configured Clouseau instance, it will become a no-op and a warning is emitted.
- Loading branch information
Showing
4 changed files
with
264 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,9 +152,9 @@ Configure the source by running:: | |
|
||
./configure | ||
|
||
If you intend to run the test suites:: | ||
If you intend to run the test suites with Clouseau:: | ||
|
||
./configure -c | ||
./configure --enable-clouseau | ||
|
||
If you don't want to build Fauxton or documentation specify | ||
``--disable-fauxton`` and/or ``--disable-docs`` arguments for ``configure`` to | ||
|
@@ -237,14 +237,8 @@ but it could be done manually via the corresponding target:: | |
|
||
make elixir-search | ||
|
||
Note that this requires a running Clouseau instance with the name | ||
``[email protected]``. The easiest way to get it is to clone the | ||
`cloudant-labs/clouseau <https://github.com/cloudant-labs/clouseau>`_ | ||
repository and launch it run there once all the prerequisites (JDK, | ||
Scala, and Maven) have been installed successfully, e.g.:: | ||
|
||
git clone https://github.com/cloudant-labs/clouseau | ||
mvn -f clouseau/pom.xml scala:run | ||
Note that this requires Clouseau to be configured for running, see | ||
above. | ||
|
||
Mango Integration Tests | ||
~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
@@ -262,7 +256,7 @@ the implementation. Consult its documentation for more information. | |
|
||
Tests that rely on text indexes are run only if the ``search`` feature | ||
is reported to be available (i.e. a working Clouseau instance is | ||
connected), otherwise they will be skipped. | ||
configured and working), otherwise they will be skipped. | ||
|
||
Note that the databases that are created during the tests will be all | ||
removed after each of the suites completed. However, with the help of | ||
|
@@ -272,6 +266,50 @@ to keep those databases around for further investigation:: | |
MANGO_TESTS_KEEP_DBS=please \ | ||
make mango-test MANGO_TEST_OPTS='03-operator-test' | ||
|
||
Running Clouseau | ||
~~~~~~~~~~~~~~~~ | ||
|
||
When configured with the ``./configure`` script, the ``dev/run`` | ||
script is capable of launching Clouseau instances alongside the | ||
CouchDB nodes and hooking them up. This is what the ``mango-test`` | ||
and ``elixir-search`` targets also use to run their respective test | ||
suites and let Clouseau automatically managed for them. | ||
|
||
Although the ``./configure`` and the ``dev/run`` scripts try to take | ||
care of the details of the Clouseau deployment, it is still the | ||
responsibility of the user to provide a suitable Java environment for | ||
running. Clouseau can run with JDK 1.7 and 1.8 only. Also, when | ||
Nouveau is in use, which uses a more recent Java environment, the old | ||
JDK has to be installed separately and the ``CLOUSEAU_JAVA_HOME`` | ||
environment variable has to be set to point its location. | ||
|
||
Fortunately, the ```asdf`` tool <https://asdf-vm.com/>` provides a | ||
convenient way to install old versions of JDK through its ```java`` | ||
plugin <https://github.com/halcyon/asdf-java>`:: | ||
|
||
asdf plugin add java | ||
|
||
Then use ``asdf`` to install it:: | ||
|
||
asdf install java zulu-8.74.0.17 | ||
|
||
Finally, use ``asdf`` to set the ``CLOUSEAU_JAVA_HOME`` environment | ||
variable:: | ||
|
||
export CLOUSEAU_JAVA_HOME=$(asdf where java zulu-8.74.0.17) | ||
|
||
If the use of ``asdf`` is not an option, `the Zulu site | ||
<https://cdn.azul.com/zulu/bin/>` could be used directly to get the | ||
distribution package for the appropriate JDK version. But this is | ||
just one of the possibilities to access installers for old Java | ||
environments. | ||
|
||
Once both Clouseau and the corresponding Java environment are set, | ||
they are not put in use automatically. In order to do so, the | ||
``dev/run`` script needs to be run with Clouseau enabled as follows:: | ||
|
||
dev/run --with-clouseau | ||
|
||
Static Code Analysis | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.