Commit Graph

12 Commits

Author SHA1 Message Date
javanna 1b996defcf [TEST] cat.allocation/One index: allow leading spaces in unassigned shards lines 2014-05-22 10:10:50 +02:00
Andrew Selden 35f046e24f Fix _cat/allocation rest test
The rest test for _cat/allocation was failing due to a regular
expression not accounting for space-padded right-justified text.

Also added Improvements to regular expressions to be smarter about optional values
and to use '+' instead of '*' where applicable.
2014-05-07 13:10:31 -07:00
Zachary Tong f4c5cde8af [TEST] Replace folded blocks with literal blocks
The regex tests are formatted with blocks for readability.  Previously,
they were formatted using folded style blocks (e.g. using `>`). Folded
blocks convert newlines into spaces.  This is problematic for our regex,
since comments can only be terminated with a newline.

Effectively, anything after a comment will be commented out, making many
of the regex "silently pass".

This commit replaces them with scalar-style blocks (e.g. using `|`), which
treats newlines as significant, and thus correctly terminates comments
inside the regex.

Also fixes a regex test (`cat.thread_pool/10_basic.yaml`) that started
to fail after the block was fixed.  The test was missing a `\s+` before
the closing newline.
2014-05-02 18:30:48 -04:00
javanna a414e4f2f3 [TEST] randomly introduced a client node within test cluster
The default number of clients nodes is randomized between 0 and 1, applied to all cluster scopes (global, suite and test). Can be changed through the newly added `@ClusterScope#numClientNodes`.

In our tests we currently refer to nodes in a generic way. All the tests that either stop or start nodes rely on the fact that those nodes hold data though. Made that clearer as that becomes more important when introducing other types of nodes within the test cluster. Reflected this by adapting and renaming the following methods in `TestCluster`:

- ensureAtLeastNumNodes to ensureAtLeastNumDataNodes
- ensureAtMostNumNodes to ensureAtMostNumDataNodes
- stopRandomNode to stopRandomDataNode

and the following ones in `ElasticsearchIntegrationTest`:

- allowNodes to allowDataNodes
- dataNodes to numDataNodes.
- @ClusterScope#numNodes to numDataNodes
- @ClusterScope#minNumNodes to minNumDataNodes
- @ClusterScope#maxNumNodes to maxNumDataNodes

Added facilities to be able to deal with data nodes specifically, like for instance retrieve a client to a data node, or retrieve an instance of a class through guice only from data nodes.

Adapted existing tests to successfully run although there's a node client around.

Fixed _cat/allocation REST tests to make disk.total, disk.avail and disk.percent optional as client nodes won't return that info.

Closes #5949
2014-04-28 16:31:36 +02:00
javanna 1ec4f8f04b [TEST] Replaced RestTestSuiteRunner with parametrized test that uses RandomizedRunner directly
ElasticsearchRestTests extends now ElasticsearchIntegrationTest and makes use of our ordinary test infrastructure, in particular all randomized aspects now come for free instead of having to maintain a separate (custom) tests runner

We previously parsed only the tests that needed to be run given the version of the cluster the tests are running against. This doesn't happen anymore as it didn't buy much and it would be harder to support as the tests get now parsed before the test cluster gets started. Thus all the tests are now parsed regardless of their skip sections, afterwards the ones that don't need to be run will be skipped through assume directives.

Fixed REST tests that rely on a specific number of shards as this change introduces also random number of shards and replicas (through randomIndexTemplate)

Closes #5654
2014-04-07 17:08:05 +02:00
javanna 34e9f8e83b [TEST] Removed skip regex sections as all the runners implemented the feature 2014-03-28 12:19:46 +01:00
Clinton Gormley 8bf302f6e2 [TEST] Removed nested quantifier in cat.allocation regex and made node name regex more liberal 2014-02-09 14:19:59 +01:00
Clinton Gormley cd679b9e57 [TESTS] Looks like Java character classes require explicit \s 2014-02-07 18:28:00 +01:00
Luca Cavanna 8ef82f9bdf [TEST] fixed cat/allocation REST tests 2014-02-07 18:22:07 +01:00
Clinton Gormley 8d98dbead0 [TESTS] Make cat.allocation tests handle different disk sizes 2014-02-07 17:54:38 +01:00
Clinton Gormley 027a418930 [TESTS] Fixed cat.allocation tests to work with one node cluster 2014-02-07 17:44:41 +01:00
Clinton Gormley 3bd0f6cb63 [TEST] Added cat.allocation and cat.aliases tests 2014-02-07 17:36:01 +01:00