Commit graph

228 commits

Author SHA1 Message Date
Joe Gallo
78fb1ec970
Fix log message format bugs (#118354) (#118387) 2024-12-11 08:59:16 +11:00
Rene Groeschke
581b9ab7c0
[8.16] [Gradle] Remove static use of BuildParams (#115122) (#117434)
* [Gradle] Remove static use of BuildParams (#115122)

Static fields dont do well in Gradle with configuration cache enabled.

- Use buildParams extension in build scripts
- Keep BuildParams.ci for now for easy serverless migration
-  Tweak testing doc

(cherry picked from commit 13c8aaeffa)

# Conflicts:
#	TESTING.asciidoc
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPlugin.java
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestTestBasePlugin.java
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/AbstractYamlRestCompatTestPlugin.java
#	build.gradle
#	modules/ingest-geoip/qa/full-cluster-restart/build.gradle
#	qa/mixed-cluster/build.gradle
#	x-pack/plugin/ent-search/qa/full-cluster-restart/build.gradle
#	x-pack/plugin/eql/qa/rest/build.gradle
#	x-pack/plugin/fleet/qa/rest/build.gradle
#	x-pack/plugin/kql/build.gradle
#	x-pack/plugin/mapper-unsigned-long/build.gradle
#	x-pack/plugin/ml/qa/multi-cluster-tests-with-security/build.gradle
#	x-pack/plugin/security/qa/multi-cluster/build.gradle
#	x-pack/plugin/sql/qa/jdbc/build.gradle
#	x-pack/plugin/transform/qa/multi-cluster-tests-with-security/build.gradle

* Fix merge

* [Build] Fix fips testing after buildparams rework (#116934)

* More Cleanup

* [Build] Fix checkstyle exclusions on windows (#115185)

* More merge fixes

* Delete x-pack/plugin/kql/build.gradle
2024-11-27 12:34:32 +01:00
Simon Cooper
eda35e62c7
[8.16] Make snapshot restore release version check more lenient (#116727) (#116803)
* Make snapshot restore release version check more lenient (#116727)

* Add unmutes
2024-11-15 00:56:54 +11:00
Luca Cavanna
74f523d4cc
Span term query to convert to match no docs when unmapped field is targeted (#113251)
SpanTermQueryBuilder currently creates a valid SpanTermQuery against unmapped fields.
In practice, if the field is unmapped, there won't be a match. This commit changes
the toQuery impl to return a MatchNoDocsQuery instead like we do in similar scenarios.
2024-10-08 08:48:53 +02:00
Mark Vieira
0279c0a909
Add AGPLv3 as a supported license 2024-09-13 14:30:33 -07:00
Armin Braun
bf7be8e23a
Save 400 LoC in tests by using indexSettings shortcut (#111573)
It's in the title, randomly saw a bunch of spots where we're
not using the shortcut, figured I'd clean this up quickly to save ~400 lines.
2024-08-05 10:21:13 +02:00
Oleksandr Kolomiiets
5e6c2e533c
Fix LogsIndexModeFullClusterRestartIT (#111362) 2024-07-29 12:34:32 -07:00
Salvatore Campagna
2fa5400e23
Test LogsDB backward compatibility (#110180)
Test LogsDB backward compatibility with a rolling upgrade and full cluster restart.
We try to start indexing logs using a `standard` index, then we switch to a `LogsDB` index.
We also improve the existing test which switches between the two index modes, `standard`
and `logs`.
2024-07-25 15:15:27 +02:00
Martijn van Groningen
696191d1c7
Fix testMapperDynamicIndexSetting() failures (#109574)
Currently these tests run against any old cluster older than 8.0.0, but
the fix that allowed `index.mapper.dynamic` to exist is only available
in 7.17.22.

Adjust these tests to only run if old cluster is after version 7.17.21
and before 8.0.0
2024-06-12 12:06:41 +10:00
Martijn van Groningen
09fc32090c
Re-define index.mapper.dynamic setting in 8.x (#109341)
Currently when upgrading a 7.x cluster to 8.x with
`index.mapper.dynamic` index setting defined the following happens:

- In case of a full cluster restart upgrade, then the index setting gets archived and after the upgrade the cluster is in a green health.
- In case of a rolling cluster restart upgrade, then shards of indices with the index setting fail to allocate as nodes start with 8.x version. The result is that the cluster has a red health and the index setting isn't archived. Closing and opening the index should archive the index setting and allocate the shards.

The change is about ensuring the same behavior happens when upgrading a
cluster from 7.x to 8.x with indices that have the
`index.mapper.dynamic` index setting defined.  By re-defining the
`index.mapper.dynamic `index setting with
`IndexSettingDeprecatedInV7AndRemovedInV8` property, the index is
allowed to exist in 7.x indices, but can't be defined in new indices
after the upgrade. This way we don't have to rely on index archiving and
upgrading via full cluster restart or rolling restart will yield the
same outcome.

Based on the test in #109301. Relates to #109160 and #96075
2024-06-11 18:17:48 +10:00
Simon Cooper
b6b20a5d6f
Update several references to IndexVersion.toString to use toReleaseVersion (#107828) 2024-04-25 10:37:02 +01:00
Moritz Mack
1f5e04b721
Migrate YAML REST tests to synthetic cluster feature check (#107068)
To simplify the migration away from version based skip checks in YAML specs, 
this PR adds a synthetic version feature `gte_vX.Y.Z` for any version at or before 8.14.0.

New test specs for 8.14 or later are expected to use respective new cluster features,
or a test-only feature supplied via ESRestTestCase#createAdditionalFeatureSpecifications
if sufficient.
2024-04-11 18:22:38 +02:00
Kostas Krikellas
755226df23
[TEST] Add full cluster restart test for downsampling (#107053)
This is a copy of the test added for rolling upgrade in #107036
2024-04-03 11:09:17 -04:00
Lorenzo Dematté
f437b7416a
Introduce oldClusterHasFeatures to full-cluster-restart (#104462)
Remove Version-based prerequisites in favour of feature-based prerequisites in ParameterizedFullClusterRestartTestCase and derived.

Follows #104279
2024-01-18 14:24:22 +01:00
Joe Gallo
af50962ec3
Fix CoreFullClusterRestartIT testRollover (#104373) 2024-01-16 10:54:17 -05:00
Mark Vieira
c6752e18f4
Fix failing test in release mode (#103883) 2024-01-03 15:27:32 -08:00
David Turner
60b833bb6d
Add utils for general XContent REST requests (#103711)
Tests that send REST requests with bodies must today build up a separate
`String` containing the body contents as JSON. This is kinda ugly, and
also means we do not cover the other supported body formats in these
tests. This commit introduces a utility to allow construction of REST
requests with `XContent` bodies directly, and generalizes things to
choose randomly between JSON and other supported body formats.
2024-01-02 13:39:21 +00:00
James Baiera
f4d791f8b4
Add failure store feature flag to bwc testing (#103341)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2023-12-12 15:01:11 -05:00
Lorenzo Dematté
93bd1abf2a
Addressing more Version usages in tests (#102803) 2023-12-12 16:44:24 +01:00
Lorenzo Dematté
bbe9f115cc
More version removal/mitigation (#102867) 2023-12-05 10:18:49 +01:00
Lorenzo Dematté
4e81494361
Introducing TestFeatureService to ESRestTestCase (#102243)
* Introducing TestFeatureService to ESRestTestCase

- Added RestTestLegacyFeatures to encompass legacy (historical) features that have been removed from production code but are still needed by REST tests
- Encapsulated Mark's getHistoricalFeatures method inside a FeatureProvider (ESRestTestCaseHistoricalFeatures)
- ESRestTestCaseHistoricalFeatures is not yet used, as we need to figure out how to deal with old cluster tests
2023-11-22 16:35:39 +01:00
Lorenzo Dematté
db53786601
Moved Version checks to IndexVersion to reflect production code (#102217)
Checks for soft delete support (and deprecation of non-soft delete), peer recovery retention leases and replication of closed indices are using IndexVersion in production code. Moving these checks from Version to IndexVersion in rest tests too.
2023-11-15 13:45:22 +01:00
Iraklis Psaroudakis
aa862640e5
Remove translog from bwc testRecovery (#101068)
When the test was trying to test recovering translog ops,
since we flush on close/shutdown, it failed because it never
recovered any translog ops.

The code for translog recovery is irrelevant due to that and
this PR proposes to remove it.

Alternatively, we could simulate killing nodes forcibly before
upgrading, but (a) that seems out of the ordinary for upgrades,
and (b) in trying that, it did not consistently pass the test
because sometimes the flush on close still happened.

Fixes #52031
2023-10-19 10:52:44 +03:00
William Brafford
04e478ae36
Hardcode version condition instead of calling minimumCompatibilityVersion() (#100102)
This is one of the few uses of Version#minimumCompatibilityVersion that isn't covered by other planned work. Since the minimum compatibility version for 7.14.0 is always going to be 6.8.0, we can just hardcode the value.
2023-10-02 09:59:07 -04:00
Simon Cooper
5f43cd8f46
Retry rolling upgrade junit tests (#99760)
Re-applies the changes from #99572 to move some bwc tests to a junit-based build infrastructure. Some tests that did not handle the move well have been kept in rolling-upgrade-legacy using the old gradle-based infrastructure
2023-09-22 15:52:59 +01:00
Simon Cooper
06f09d861d
Revert "Migrate rolling upgrade tests to new junit format" (#99750)
Reverts elastic/elasticsearch#99572 and #99733

The new tests are unstable, and don't work on CI. This re-opens
https://github.com/elastic/elasticsearch/issues/97200
2023-09-21 09:42:04 -04:00
Simon Cooper
1b8df61bd6
Limit test parallelism to 1 for junit bwc tests (#99733)
gradle runs test tasks in parallel, this results in multiple test clusters being created, which breaks CI.
2023-09-21 11:16:37 +01:00
Simon Cooper
cafa545786
Read index version from the old deployed cluster instead of inferring it in full restart tests (#99524)
The index version is needed to check the output against an upgraded cluster. Now the junit tests share a JVM between the old & upgraded clusters, we can store the old index version in the class to be read when needed
2023-09-18 08:46:19 +01:00
Mark Vieira
7be3d2c191
Increase flexibility of test cluster execution environments (#99437) 2023-09-13 11:18:40 -07:00
Simon Cooper
bebe2538b1
Bump to first non-release IndexVersion (#98478)
This bumps to an IndexVersion that is not associated with any specific release version. From this point, index metadata/data versioning will be handled in the same way as TransportVersion - a new constant for every change
2023-08-31 15:10:40 +01:00
Simon Cooper
a399fa877c
Update test version check to also include 8.10 patch releases (#99004) 2023-08-30 09:51:55 +01:00
Simon Cooper
b67a9e1ec3
Move text references to index created version to IndexVersion (#98727) 2023-08-23 10:51:56 +01:00
Simon Cooper
547947d465
Specify correct current IndexVersion after 8.10 release (#98574)
The current IndexVersion wasn't bumped by the release automation as it should have been
2023-08-17 09:28:34 +01:00
Tim Vernum
136a60c92a
Mute upgrades.FullClusterRestartIT.testClusterState (#98556)
Relates: #98555
2023-08-17 00:06:34 -04:00
Simon Cooper
cbec47f541
Modify upgrade test version check to include 8.10 (#98536)
IndexVersion hasn't yet been separated from Version. So it's ok to modify this check to allow 8.10 releases to run the test.
2023-08-16 15:04:08 +01:00
Simon Cooper
52a6820813
Migrate some full-cluster restart tests to use IndexVersion (#97368)
This infers the index version from the specified node version. Note that this will break when 8.10 is released, and BwC tests try to use 8.10 nodes. #97200 should be implemented before 8.10 is released to properly specify IndexVersion, without requiring inference.
2023-07-10 10:48:51 +01:00
Simon Cooper
5486667d73
Convert snapshot version to IndexVersion (#96857) 2023-06-28 16:04:19 +01:00
Simon Cooper
a873e26cf7
Convert IndexVersion.CURRENT to a method with a pluggable interface (#97132) 2023-06-27 14:47:32 +01:00
Simon Cooper
ec6b7900a9
Migrate some uses of Version.luceneVersion() to IndexVersion (#96300)
Redirect some uses of `Version.luceneVersion` to use
`IndexVersion.luceneVersion` instead
2023-06-08 11:13:15 -04:00
Simon Cooper
84a85901ac
Change Version.luceneVersion to a method (#96244) 2023-05-22 14:54:54 +01:00
Armin Braun
c41bda9e3a
Dry up remaining verbose index setting building in tests (#95652)
Lasts spots I could easily find via regex.
Follow-up to #95569
2023-04-28 11:18:07 +02:00
Simon Cooper
9fa7612d2d
Use separate transportversion for percolator query serialization (#94517)
This changes the serialization format for queries - when the index version is >=8.8.0, it serializes the actual transport version used into the stream. For BwC with old query formats, it uses the mapped TransportVersion for the index version.

This can be modified later if needed to re-interpret the vint used to store TransportVersion to something else, allowing the format to be further modified if necessary.
2023-04-05 13:13:14 +01:00
Simon Cooper
4c46ccacaa
Migrate the remaining uses of Version to TransportVersion (#93384)
Remove get/setVersion methods
2023-02-13 09:15:53 +00:00
Mark Vieira
43d9a6a0c8
Convert full cluster restart tests to new rest testing framework (#93477) 2023-02-02 13:13:54 -08:00
Nikolaj Volgushev
221c93531b
Revert "Convert full cluster restart tests to new rest testing framework (#93422)" (#93444)
Reverts #93422

Should address: #93442 and possibly #93440
2023-02-02 11:29:41 +01:00
Mark Vieira
820ba5af23
Convert full cluster restart tests to new rest testing framework (#93422) 2023-02-01 11:34:21 -08:00
Craig Taverner
bc7a31fd08
Revert "Convert full cluster restart tests to new rest testing framework (#93062)" (#93407)
This reverts commit 013b2e5d5e.
2023-02-01 12:57:50 +01:00
Mark Vieira
013b2e5d5e
Convert full cluster restart tests to new rest testing framework (#93062) 2023-01-31 12:26:45 -08:00
Artem Prigoda
2bc7398754
Use Strings.format instead of String.format(Locale.ROOT, ...) in tests (#92106)
Use local-independent `Strings.format` method instead of `String.format(Locale.ROOT, ...)`. 
Inline `ESTestCase.forbidden` calls with `Strings.format` for the consistency sake.
Add `Strings.format` alias in `common.Strings`
2023-01-03 19:28:27 +01:00
Rene Groeschke
43a0377735
Update forbiddenapis to 3.4 (#90624)
Fix breaking changes to source validation after change in default jdk rule set
2022-10-06 16:52:06 +02:00