Skip to content

Commit

Permalink
Add note on test features
Browse files Browse the repository at this point in the history
  • Loading branch information
thecoop committed Sep 27, 2024
1 parent d453c8b commit a1f9d82
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions VERSIONING.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,12 @@ and the feature checks removed from the code of major version N.
Tests often want to check if a certain feature is implemented / available on all nodes,
particularly BwC or mixed cluster test.

Note that cluster features are not meant to be fine-grained, and should be introduced
sparingly; it is not appropriate to introduce a cluster feature just to use
as a test condition. Capabilities should be used instead.
Rather than introducing a production feature just for a test condition,
this can be done by adding a _test feature_ in an implementation of
`FeatureSpecification.getTestFeatures`. These features will only be set
on clusters running as part of an integration test. Even so, cluster features
should be used sparingly if possible; Capabilities is generally a better
option for test conditions.

In Java Rest tests, checking cluster features can be done using
`ESRestTestCase.clusterHasFeature(feature)`
Expand All @@ -245,7 +248,7 @@ that use cluster features; see [here](https://github.com/elastic/elasticsearch/b
To aid with backwards compatibility tests, the test framework adds synthetic features
for each previously released Elasticsearch version, of the form `gte_v{VERSION}`
(for example `gte_v8.14.2`).
This can be used to add conditions based on previous releases. It cannot be used
This can be used to add conditions based on previous releases. It _cannot_ be used
to check the current snapshot version; real features or capabilities should be
used instead.

Expand Down

0 comments on commit a1f9d82

Please sign in to comment.