Commit Graph

82 Commits

Author SHA1 Message Date
Jake Landis 26dfe02a0b
Update task names for rest compatiblity (#75267)
This commit updates two task names:
```
yamlRestCompatTest -> yamlRestTestV7CompatTest
transformV7RestTests -> yamlRestTestV7CompatTransform 
```

`7` is the N-1 version and calculated, such that when `8` is 
N-1 version the task names will be  `yamlRestTestV8CompatTest` and 
`yamlRestTestV8CompatTransform`

The motivation for `yamlRestCompatTest -> yamlRestTestV7CompatTest`  is that 
many projects have configured `yamlRestCompatTest` 
but that configuration is specific to the N-1 version. For example, 
if we blacklist tests when running compatibility with v7, we don't also
want to blacklist those tests when running compatibility with v8.

By introducing a version-specific identifier in the name, the task will not
even exist when bumping the version creating the need to (correctly) remove
the version-specific condition.

The motivation for `transformV7RestTests -> yamlRestTestV7CompatTransform` 
is to provide more consistent naming. 

The idea behind the naming is the main task people
are likely familiar with is :

`yamlRestTest` so we will use that as a base.
`yamlRestTestV7CompatTest` to run the version-specific compat tests
`yamlRestTestV7CompatTransform` to run the version-specific transformations for the compat tests

CI should be un-effected since since we introduced a lifecycle task 
name `checkRestCompat` which is what CI should be configured to use.
2021-09-03 11:26:11 -05:00
Nik Everett aa2aa9b1bf
Format `AbstractFilteringTestCase` (#77217)
`AbstractFilteringTestCase` had a ton of carefully formatted
`XContentBuilder` calls that would have been totally unreadable after
the formatter worked its magic. So I formatted a bunch of them by hand
and extracted the rest to json files.
2021-09-03 08:59:00 -04:00
Rene Groeschke 93f36077f1
Simplify test build output normalization (#77172)
* Simplify test build output normalization
2021-09-03 12:22:28 +02:00
Armin Braun 0305f95d67
Mute ReleaseNotesIndexGeneratorTest (#77193)
This is failing constantly on CI https://github.com/elastic/elasticsearch/issues/77190
2021-09-02 15:45:12 +02:00
Alan Woodward 5d48fdc741
Replace Lucene DataInput/DataOutput with Elasticsearch StreamInput/StreamOutput (#77118)
In a number of places, we read and write binary data into byte arrays using lucene's
DataInput and DataOutput abstractions. In lucene 9 these abstractions are changing
the endianness of their read/writeInt methods. To avoid dealing with this formatting
change, this commit changes things to use elasticsearch StreamInput/StreamOutput
abstractions instead, which have basically the same API but will preserve endianness.

Relates to #73324
2021-09-01 16:21:26 +01:00
Rory Hunter be6d1ba2af
Rework how we render groovy templates for docs (#77125)
On Windows, rendered Groovy templates contain carriage returns, which
breaks the unit tests and results in them sneaking into the output. Fix
this by rendering into a string and removing the carriage returns.
2021-09-01 15:45:41 +01:00
Rory Hunter ac803f078c
Drop version field from changelog YAML (#76985)
The changelog generation process currently relies on version
information being present in the changelog YAML descriptors. However,
this makes them difficult to update in some scenarios. For example,
if a PR is merged and subsequently labelled for backporting, our
automation won't update the versions in the changelog YAML.

We can make the process more flexible by removing version data from
the changelog YAML files, and instead inferring the versions from
each changelog YAML file's existence in the git tree at each tag
in the minor series.

This change makes the process more ergonomic for developers, but
harder to test, since I can't simply concoct YAML data for a range
of versions. Instead, I've added a number of unit tests, and tried
to exercise all the relevant parts.

It is now an error to include `versions` the YAML file.
2021-09-01 07:25:29 +01:00
Rene Groeschke 35ec6f348c
Introduce simple public yaml-rest-test plugin (#76554)
This introduces a basic public yaml rest test plugin that is supposed to be used by external 
elasticsearch plugin authors. This is driven by #76215

- Rename yaml-rest-test to intern-yaml-rest-test
- Use public yaml plugin in example plugins

Co-authored-by: Mark Vieira <portugee@gmail.com>
2021-08-31 08:45:52 +02:00
Mark Tozzi d715449766
Apply spotless to aggregations (#76682)
* spotless apply for core analytics code

* spotless apply for x-pack:plugin:analytics

* spotless apply for matrix stats

* don't format huge lists of HLL constants

* Spotless for Rollups

* Don't exclude HLLPP, we added narrower inline exclusions
2021-08-30 13:42:20 -04:00
Mark Vieira 8a9ea85657
Remove no-jdk distributions (#76896) 2021-08-25 09:52:15 -07:00
Rory Hunter 5c00587edf
Update Azul JVM on Apple M1 (#76923)
Closes #76901. Bump the Azul JVM version for aarch64 M1 i.e. Apple silicon.
2021-08-25 17:07:04 +01:00
Nikola Grcevski 98f0f4b9ec
[TEST] Implement HotThreads unit tests (#76857)
* [TEST] Implement HotThreads unit tests

Add unit tests for the internal HotThreads logic for calculating and
sorting threads by CPU, Wait and Blocked "hotness". Also adds tests
for identifying certain threads as idle, as well as supported report
types (e.g. cpu, wait, blocked).

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-08-24 18:14:49 -04:00
Rory Hunter a6f2a4df8b
Introduce Cloud docker variant (#74980)
Closes #74795.

Introduce two Docker image variants for Cloud. The first bundles
(actually installs) the S3, Azure and GCS repository plugins. The
second bundles all official plugins, but only installs the repository
plugins.

Both images also bundle Filebeat and Metricbeat.

The testing utils have been refactored to introduce a `docker`
sub-package. This allows the static `Docker.containerId` to be
shared without needing all the code in one big class. The code for
checking file ownership / permissions has also been refactored to
a more Hamcrest style, using a custom Docker file matcher.
2021-08-20 20:11:05 +01:00
Rory Hunter bf4e01e98e
Fix spotless gradle config (#76701)
An attempt to apply the spotless plugin everywhere and then disable
where it wasn't appropriate didn't work, and instead everything was
formatted. Revert how we apply the pluing, and use a different approach
to applying extra configuration in build files.
2021-08-19 14:38:21 +01:00
Mark Vieira 13795c4e5e
Use Adoptium builds for bundled JDK (#76631) 2021-08-18 09:52:22 -07:00
Rory Hunter d01efa4fd6
Changes to keep Checkstyle happy after reformatting (#76464)
* Reformatting to keep Checkstyle after formatting

* Configure spotless everywhere, and disable the tasks if necessary

* Add XContentBuilder helpers, fix test

* Tweaks

* Add a TODO

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-08-18 07:15:55 -04:00
Rene Groeschke 86a577227e
Update Gradle wrapper to 7.2 (#75894)
* Update Gradle wrapper to 7.2-rc-1

Fix deprecation warnings on the go

* Remove deprecated lambda based Gradle task actions

* Remove usage of deprecated BasePluginConvention

* Update wrapper to 7.2-rc-2

* Update gradle wrapper to 7.2-rc-3

* Update gradle wrapper to 7.2
2021-08-18 05:11:28 -04:00
Rene Groeschke 1435e48578
Provide better error message when jdk metadata cannot be resolved (#76607)
This should help track down problems with the GlobalInfoPlugin people reported
2021-08-17 06:02:58 -04:00
Ryan Ernst 96627dfa14
Remove quota-aware-fs plugin (#76352)
The quota aware filesystem was added as a means of allowing
Elasticsearch to track the used space of the underlying filesystem in
virtualized environments. However, the need for it was due to a bug in a
much earlier version of Elasticsearch that always found the underlying
mount and checked it directely for usage. That bug has already been
fixed, so the there is no longer a need for this plugin. This commit
removes the plugin. We should consider separately whether there is still
a need for bootstrap plugins.

closes #70309
2021-08-11 15:12:50 -07:00
Joe Gallo c7516b35d9
Re-enable deprecated _xpack/ssl routes via REST compatibility (#75950) 2021-08-09 14:47:13 -04:00
Rene Groeschke b323726ebd
Resolve system properties in build scripts via provider factory (#76199)
This allows tracking system properties used in the build configuration and brings us
one step closer to be gradle configuration cache compliant.
2021-08-09 09:39:30 +02:00
Rene Groeschke 09260570b9
Introduce Gradle plugin for setup gradle test security policies (#76167)
Test execution hangs when building Elasticsearch plugins and extending ESTestCase

fixes #76136
2021-08-05 20:56:52 +02:00
Armin Braun d510fa4841
Upgrade to Netty 4.1.66 (#76135)
Upgrade to 4.1.66 which might bring some helpful
improvements to how TLS exceptions are propagated.
2021-08-05 09:24:52 +02:00
Mark Vieira 705a40850b
Bump bundled JDK to 16.0.2 (#75981) 2021-08-03 09:09:15 -07:00
Lee Hinman a76ee40d5b
Flip node shutdown feature flag to default to true on snapshot builds (#75962)
* Flip node shutdown feature flag to default to true on snapshot builds

It previously defaulted to false. The setting can still only be set to 'true' on a
non-release (snapshot) build of Elasticsearch.

Relates to #70338

* Handle case where operator privileges are enabled
2021-08-02 13:15:36 -04:00
Rory Hunter f34d9adc49
New release notes generator tasks (#71125)
Part of #67335.

Add tasks for generating release notes, using information stored in files
in the repository:

   * `generateReleaseNotes` - generates new release notes, release
     highlights and breaking changes
   * `validateChangelogs` - validates that all the changelog YAML files are
     well-formed (confirm to schema, have required fields depending on the
     `type` value)

I also changed `Version` to allow a `v` prefix in relaxed mode
2021-07-28 12:09:58 +01:00
Przemyslaw Gomulka 6b93aff066
[Rest Api Compatibility] Licence accept_enterprise and response changes (#75479)
in #50067 for _license the accept_enterprise = false was no longer supported. This
commit allows it under rest compatibility and is showing enterprise licenses as platinum
The same change had to be applied to _xpack endpoint #58217

in #50735 max_resource_units was introduced to be more accurate. For v7 requests, which do not know about enterprise license we will return max_node which will be set from max_resource_units (it assumes that one resource unit is 32GB - which corresponds to 1 node)

relates #51816
2021-07-27 12:37:15 +02:00
mark-vieira 7a6b6916e0 Fix license check failures on Windows 2021-07-26 17:12:58 -07:00
Przemko Robakowski bbfc6d2a45
Update licenses and attributions for GeoIP module (#75178)
Update licenses and attributions for GeoIP module
2021-07-26 14:16:14 +02:00
Mark Vieira d7f6a1b659
Fix reported branch in build scans for pull request CI jobs (#75600) 2021-07-21 13:40:34 -07:00
Rory Hunter 123a06f588
Enable compiler warnings in x-pack security (#75473)
Part of #40366.
2021-07-21 19:58:39 +01:00
Albert Zaharovits b9bc7a6f3f
Configure security for the initial node cli (#74868)
This introduces a new cmd line tool that generates the security configuration
for a new node in a new cluster (as opposed to joining an existing cluster).
The security configuration consists of TLS key and certificates, which
are stored in a directory inside the config path, as well as settings appended
to the elasticsearch.yml referencing the aforementioned certs.
2021-07-21 07:45:39 +03:00
Jake Landis 4553bf03d5
Remove MavenFilteringHack (#73637) 2021-07-20 17:05:16 -04:00
Przemyslaw Gomulka 2320a38833
[Rest Api Compatibility] Allow transforming warnings per test (#75187)
Warning related transformations missed the possibility to apply per single test only.
Also a warning changed in #67158 for indices.close so this PR also applies the transformation for 7.x test

relates #51816
2021-07-15 10:50:42 +02:00
Jake Landis a7ce8e37ac
Introduce key/value REST test transform (#75193)
This commit introduces replaceValueTextByKeyValue which allows
replacements based on a given key/value pair. This is useful
for REST test transforms that that may not have a well known structure.

This commit also implements this new transform to fix a Watcher compat test.
This commit also fixes a latent bug that would prevent the traversal when multiple
differing transforms matched.
2021-07-12 12:42:01 -05:00
Przemyslaw Gomulka 9bb473427b
[Rest Api Compatibility] Add conditions to InjectHeaders transformation (#75001)
adding a conditions that has to be satisfied in order to apply headers in InjectHeaders.
this will allow to skip the transformation for cat operations
relates #51816
2021-07-07 17:48:06 +02:00
Rene Groeschke cbcb41a332
Fix fips tests for vanilla Test tasks (#74969)
This fixes a regression introduced with #74670.
Vanilla test tasks (of plain type Test) must also dependOn `fipsResources`
when build is run in FIPS mode. Otherwise we see the plain test task failing with

"SHA MessageDigest not available"

Fixes #74922
2021-07-06 16:32:44 +02:00
Rene Groeschke 1db75f75ca
Polish and cleanup test related plugins (#74673)
- avoid eagerly created test cluster
- remove duplicate superflous configuration
- resolve system properties via provider factory
- move common test configuration / setup into rest test base plugin
2021-07-05 10:34:36 +02:00
Rene Groeschke 854661b8bf
Updating Gradle wrapper to version 7.1.1 (#74886) 2021-07-05 03:42:33 -04:00
Rene Groeschke 1ea7e5000e
Fix gradle func tests running in idea (#74811)
* Fix gradle func tests running in idea

* Tweak wrapper task
2021-07-01 05:43:51 -04:00
Mark Vieira 631c313886
Ensure tests that leverage Mockito can be run from the IDE (#74794) 2021-06-30 13:50:58 -07:00
Mark Vieira 8bbba5f8ff
Fix unit test classpath when testing shadow jar projects (#74783) 2021-06-30 12:30:03 -07:00
Mark Vieira 75d8079c37 Update .backportrc.json 2021-06-30 11:21:15 -07:00
Nhat Nguyen 174f65ef82
Upgrade to Lucene 8.9.0 (#74729) 2021-06-30 08:49:53 -04:00
Rene Groeschke d8e4e48a3b
Avoid creating unused test tasks (#74644)
With the overall theme of trying to configure and add less to the build instead of just disabling it later,
we're replacing standalone-test by standalone-rest tasks avoids creating the
unused test tasks.

Standalone rest test plugin and the other rest test plugins behave a little bit different in the sense how source sets and test tasks are wired.

The standalone rest test plugin assumes that all RestTestTasks are using the same sourceSet (test). The yaml, java Rest test plugins use one dedicated sourceSet per test task.

In the long run we probably will migrate standalone-rest-test usages to one of the other plugins and deprecate standalone-rest-test
2021-06-30 14:11:25 +02:00
Rene Groeschke 36ae5ac229
Make test cluster tasks depend on fipsResources when fips enabled (#74670)
The fips specific cluster specification depends on files that are declared
as output of the fips-resources task. So far there has not been an explicit
dependency of all TestClustersAware tasks (so far only for Test tasks) to this
resources task in our build and.

implicit usage of task outputs without any explicit task dependency has been
deprecated in Gradle as the build tool detects that these file are outputs of
this task and urges users to have this  explicit dependency declared in a build.

RestIntegTestTask had this dependencies explicitly declared by us having defined a dependency
by declaring

`tasks.withType(Test) { dependsOn 'fipsResources'}`.

This has be replaced by with this PR by

`tasks.withType(TestClustersAware) { dependsOn 'fipsResources'}`

which also covers usages of `DefaultTestClustersTask` as used in the
`:x-pack:plugin:eql:qa:multi-cluster-with-security` project which
fails in #74664

fixes #74664
2021-06-29 10:36:26 +02:00
Rene Groeschke 4ab100b7be
Cleanup root build script (#74183)
- No manual show task dependencies logic needed. we can use build scans instead for that.
- Move common plugin configuration into according plugins
- Reduce overall callbacks in root script, remove unneeded logic in afterEvaluate hooks
2021-06-28 11:15:24 +02:00
Rene Groeschke 54738fc067
Avoid unused sourcesets and tasks in javaRestTest plugin (#74492)
We only need the javaRestTest sourceSet and can avoid main and test sourceSet by
just using the new introduced ElasticsearchJavaBase instead of ElasticsearchJava plugin
2021-06-28 09:54:59 +02:00
Mark Vieira a02e73245e
Clean up build tools dependencies and fix maven coordinates (#74520) 2021-06-24 08:55:21 -07:00
Mark Vieira 17c7c8f6a2
Improve error message when minimum compiler version is not met (#74512) 2021-06-24 08:46:09 -07:00