Commit graph

171 commits

Author SHA1 Message Date
Lorenzo Dematté
6c177981d0
Adding option to debug the cli launcher (#102464)
* Adding debug args to cli tools
* Adding instructions
2023-11-28 10:26:09 +01:00
Przemyslaw Gomulka
7a5bc9e9fb
Create gradle service to start mock apm server (#100839)
when running gradlew run it should be possible to quickly setup a fake
apm server that will be simply logging received apm agent requests.
This commits adds a gradle build service that will be run before the RunTask
and will start a simple http server based on https://github.com/elastic/apm-agent-java-plugin-example/blob/main/plugin/src/test/java/co/elastic/apm/mock/MockApmServer.java
2023-10-19 14:09:24 +02:00
Rene Groeschke
d8f1627e27
Remove vagrant support for OS packaging tests (#100987)
- This hasnt been maintained in a while and the vagrant gradle plugin also broke compatibiliy for gradle 
  --configuration-cache. Also this removes a lot maintenance burden.
- Rework DistroTestPlugin and simplify task dependencies
- Rename :qa:os to :qa:packaging
- Update testing doc recommending buildkite tools for debugging packaging tests
2023-10-19 12:10:58 +02:00
Pooya Salehi
216ef17198
Add yaml test debugging tip (#99341) 2023-09-08 11:03:33 +02:00
Mark Vieira
16af105262
Add mechanism to initialize YAML tests against a subset of test cases (#95095)
This commit adds the ability to initialize YAML rest test suites against
a subset of available test cases. Previously, the only way to do this is
via the `tests.rest.suite` system property, but that can only be set at
the test _task_ level. Configuring this at the test _class_ level means
that we can support having multiple test suite classes that execute
subsets of tests within a project. That allows for things like
parallelization, or having different test cluster setups for different
YAML tests within the same project.

For example:

```java
    @ParametersFactory
    public static Iterable<Object[]> parameters() throws Exception {
        return ESClientYamlSuiteTestCase.createParameters(new String[] { "analysis-common", "indices.analyze" });
    }
```

The above example would mean that only tests in the `analysis-common`
and `indices.analyze` directories would be included in this suite.

cc @jdconrad 

Closes #95089
2023-04-06 20:45:48 -04:00
Mark Vieira
7527d6f046 Add intellij run configurations for multi-node clusters 2023-03-22 14:40:10 -07:00
Ignacio Vera
cfea098e12
Show how to disable system assert during testing (#93971)
We only show how to disable user asserts during testing, we should show
how to disable system asserts too.
2023-02-21 07:20:32 -05:00
Jake Landis
7729972df5
Add tls support to gradle run/run-ccs (#90051)
This commit adds TLS for the transport layer and optional support 
for https for `./gradlew run` and `./gradlew run-ccs` tasks.
A new system property --https can be passed to expose https.
Transport layer TLS is always enabled which is always applicable 
for `./gradlew run-css`, but only applicable for `./gradlew run` when multiple nodes are configured.
Additional certificates and instructions for use are also included in the commit.
2022-09-26 18:19:32 -05:00
Jake Landis
54e13093bf
simplify ./gradlew run-ccs (#89711)
This commit reverts the changes introduced via https://github.com/elastic/elasticsearch/pull/89442 / 20ed7e3fd9
and re-implements the same goals but with fewer changes. Also included in this commit 
is the ability to change the proxyMode via system property and mention of this
new run task in the testing documentation.
2022-08-30 12:41:14 -05:00
Jake Landis
d7de930f0a
Better support for multiple nodes via ./gradlew run (#89563)
This commit makes minor changes to support multiple nodes
via ./gradlew run. The specific desired use case, where there 2 nodes
in the cluster where one is a coordinating only node is used as
the example configuration.
2022-08-29 17:26:38 -05:00
Mark Vieira
ac9edce20c Update references to master branch in developer documentation 2022-07-25 10:59:08 -07:00
Jake Landis
430b419f91
add instructions for customization of ./gradlew run (#88484) 2022-07-19 09:51:28 -05:00
Peter Lamar
fc18ee8ea5
Update TESTING.asciidoc (#66563) 2022-07-18 12:53:59 -07:00
Quentin Pradet
51692b6197
Fix TESTING asciidoc syntax (#88106) 2022-06-29 10:40:56 +04:00
Abele Mălan
4eee970264
Fix a few typos in TESTING AsciiDoc (#85505)
This PR corrects some typos/errors spotted in the TESTING.asciidoc file.

Co-authored-by: AbeleMM <AbeleMM@users.noreply.github.com>
2022-04-21 13:55:14 -07:00
Mark Vieira
9ef2873e9f
Remove Eclipse IDE contributor documentation (#84724) 2022-03-07 11:32:15 -08:00
Kxrr
444f716ede
Fix typo in TESTING.asciidoc (#83120)
`-Dtest.class` should be `-Dtests.class ` in TESTING.asciidoc
2022-01-26 17:01:19 +00:00
Rory Hunter
a7fdb08046
Fix docs for passing JVM args to ./gradlew run (#81253)
The instructions in `TESTING.asciidoc` for how to disable assertions
when running `./gradlew run` didn't work. Fix the docs by describing
how to pass JVM args, using disabling assertions as an example.
2021-12-03 09:16:23 +00:00
Rory Hunter
4d18ba65d8
Revise notes in TESTING.asciidoc about building a distro (#80727)
Update the notes in TESTING.asciidoc about how to build a distribution of Elasticsearch.
2021-11-15 18:03:46 +00:00
Mark Vieira
cff383f22b
Allow for debugging of rest test clusters during test execution (#79085) 2021-10-14 12:48:45 -07:00
Nilanshu V Rajmane
abe0c06afd
[DOCS] Change "p0" to "yaml" in example command (#78716)
Relates to https://github.com/elastic/elasticsearch/issues/78631

Co-authored-by: Nilanshu Vithal Rajmane <nil.rajmane@gmail.com>
2021-10-05 17:26:15 -04:00
martinsrun
9ab2e764eb
[DOCS] Fix link (#73810)
Fix dead link on documentation
2021-06-07 09:55:20 -04:00
Rene Groeschke
06103cd9ac
Fix path in TESTING.asciidoctor 2021-06-01 16:56:29 +02:00
James Rodewig
693807a6d3
[DOCS] Fix double spaces (#71082) 2021-03-31 09:57:47 -04:00
bellengao
7a4011dc86
[DOCS] Correct the path of BwcVersions in the Testing doc (#68798) 2021-02-10 12:35:17 -05:00
Ioannis Kakavas
bd873698bc
Ensure CI is run in FIPS 140 approved only mode (#64024)
We were depending on the BouncyCastle FIPS own mechanics to set
itself in approved only mode since we run with the Security
Manager enabled. The check during startup seems to happen before we
set our restrictive SecurityManager though in
org.elasticsearch.bootstrap.Elasticsearch , and this means that
BCFIPS would not be in approved only mode, unless explicitly
configured so.

This commit sets the appropriate JVM property to explicitly set
BCFIPS in approved only mode in CI and adds tests to ensure that we
will be running with BCFIPS in approved only mode when we expect to.
It also sets xpack.security.fips_mode.enabled to true for all test clusters
used in fips mode and sets the distribution to the default one. It adds a
password to the elasticsearch keystore for all test clusters that run in fips
mode.
Moreover, it changes a few unit tests where we would use bcrypt even in
FIPS 140 mode. These would still pass since we are bundling our own
bcrypt implementation, but are now changed to use FIPS 140 approved
algorithms instead for better coverage.

It also addresses a number of tests that would fail in approved only mode
Mainly:

    Tests that use PBKDF2 with a password less than 112 bits (14char). We
    elected to change the passwords used everywhere to be at least 14
    characters long instead of mandating
    the use of pbkdf2_stretch because both pbkdf2 and
    pbkdf2_stretch are supported and allowed in fips mode and it makes sense
    to test with both. We could possibly figure out the password algorithm used
    for each test and adjust password length accordingly only for pbkdf2 but
    there is little value in that. It's good practice to use strong passwords so if
    our docs and tests use longer passwords, then it's for the best. The approach
    is brittle as there is no guarantee that the next test that will be added won't
    use a short password, so we add some testing documentation too.
    This leaves us with a possible coverage gap since we do support passwords
    as short as 6 characters but we only test with > 14 chars but the
    validation itself was not tested even before. Tests can be added in a followup,
    outside of fips related context.

    Tests that use a PKCS12 keystore and were not already muted.

    Tests that depend on running test clusters with a basic license or
    using the OSS distribution as FIPS 140 support is not available in
    neither of these.

Finally, it adds some information around FIPS 140 testing in our testing
documentation reference so that developers can hopefully keep in
mind fips 140 related intricacies when writing/changing docs.
2020-12-23 21:00:49 +02:00
Benjamin Trent
5859c4d6e6
Adding example of running tests without a snapshot build (#65899)
It can be difficult to know how to run release builds. Certain changes require that tests run without a snapshot build (consider testing a feature behind a feature flag).

This adds a small doc line specifying what args to pass to run tests without a snapshot build.
2020-12-07 13:29:41 -05:00
Mark Vieira
1ce323e136
Add option to preserve data in test clusters (#65400) 2020-11-24 11:24:26 -08:00
James Rodewig
4f82e667ae
[DOCS] Fix "the the" typos (#64344) 2020-10-29 10:11:58 -04:00
Jake Landis
ce9e2fd0d9
Update TESTING.asciidoc for recent REST test changes (#62841)
* Remove reference to Runner (no longer valid)
* Remove tests.rest (no longer valid)
* Add reference to javaRestTest
* Brief mention of qa tests
2020-09-24 11:45:36 -05:00
Qaiser Abbasi
682b9460ca
Remove legacy debugger instructions (#60583)
In the past, the only way to run a local Elasticsearch build with a remote debugger was by extracting elasticsearch and passing ES_JAVA_OPTS. However, since switching to gradle, a convenience flag was added, `--debug-jvm` (which is documented elsewhere in the testings docs), when running a local elasticsearch build through gradle. This commit removes the old documentation.
2020-08-21 14:06:12 -07:00
Lee Hinman
c2e07b2996
Add blurb about --data-dir to TESTING.asciidoc (#58963)
This used to be -Dtests.es.path.data=/whatever but changed some time in the past, this updates it
so that it references the correct method.
2020-07-07 15:39:21 -06:00
Jake Landis
333a5d8cdf
Create plugin for yamlTest task (#56841)
This commit creates a new Gradle plugin to provide a separate task name
and source set for running YAML based REST tests. The only project
converted to use the new plugin in this PR is distribution/archives/integ-test-zip.
For which the testing has been moved to :rest-api-spec since it makes the most
sense and it avoids a small but awkward change to the distribution plugin.

The remaining cases in modules, plugins, and x-pack will be handled in followups.

This plugin is distinctly different from the plugin introduced in #55896 since
the YAML REST tests are intended to be black box tests over HTTP. As such they
should not (by default) have access to the classpath for that which they are testing.

The YAML based REST tests will be moved to separate source sets (yamlRestTest).
The which source is the target for the test resources is dependent on if this
new plugin is applied. If it is not applied, it will default to the test source
set.

Further, this introduces a breaking change for plugin developers that
use the YAML testing framework. They will now need to either use the new source set
and matching task, or configure the rest resources to use the old "test" source set that
matches the old integTest task. (The former should be preferred).

As part of this change (which is also breaking for plugin developers) the
rest resources plugin has been removed from the build plugin and now requires
either explicit application or application via the new YAML REST test plugin.

Plugin developers should be able to fix the breaking changes to the YAML tests
by adding apply plugin: 'elasticsearch.yaml-rest-test' and moving the YAML tests
under a yamlRestTest folder (instead of test)
2020-07-06 12:13:01 -05:00
Ryan Ernst
cabe6a3305
Create plugin for internalClusterTest task (#55896)
This commit creates a new gradle plugin to provide a separate task name
and source set for running ESIntegTestCase tests. The only project
converted to use the new plugin in this PR is server, as an example. The
remaining cases in x-pack will be handled in followups.
2020-05-06 17:20:26 -07:00
Mark Vieira
2e617c3b10
Improve IntelliJ IDE integration (#53747)
This commit makes a number of improvements when importing the
Elasticsearch project into IntelliJ IDEA. Specifically:

 - Contributing documentation has been updated to reflect that the
   'idea' task should no long be used and Gradle project import is
   instead the officially supported way of setting up the project.
 - Attempts to run the 'idea' task will result in a failure with a
   message directing folks to our CONTRIBUTING.md document.
 - The project JDK is explicit set rather that using whatever JAVA_HOME
   is.
 - Gradle build operation delegation is disabled, and test execution is
   configured to 'choose per test'.
 - Gradle is configured to inherit the project JDK.
 - Some code style conventions are automatically configured.
 - File encoding is explicitly set to UTF-8.
 - Parallel module compilation is enabled and deprecated feature
   warnings are disabled.
 - A remote debug run configuration using listen mode is created.
 - JUnit runner is configured with required system properties.
 - License headers are configured such that Apache 2 is the default
   notice added to all source files with exception of source in /x-pack
   which will use the Elastic license.
2020-03-19 11:23:15 -07:00
Jake Landis
2d85e4167a
Updates to TESTING.asciidoc for REST testing (#52862)
Update documentation for:
* restResources config (related #52114)
* call out YAML vs. Java based Rest tests
* update example to use newer syntax 
* update example to target a test that is not skipped 
* provide example for bwcRest test (related #52383)
2020-02-27 11:08:38 -06:00
James Rodewig
5bd9f2b036
[DOCS] Add docs build info to TESTING.asciidoc (#52271)
Adds a brief section about Elasticsearch docs and how users can
test/build them locally.
2020-02-12 12:59:24 -05:00
Ryan Ernst
eebd6b3e3b
Remove references to supported platforms in testing docs (#51777)
These are coded into the directory structure, so there is no need to
also list them in testing docs.

relates #51480
2020-02-04 09:44:34 +00:00
Rory Hunter
6816009ae9
Add healthchecks to distro docker-compose.yml (#49710)
If there are environmental reasons why docker-compose can't bring up
containers in the :distribution:docker project, it's not that clear from
the command line output. Add healthchecks to the compose file so that
the cluster's health is explicitly checked.

Also add a note about Docker memory requirements to the testing docs.
2019-12-03 09:43:54 +00:00
Andrei Stefan
451d9cf06f
Detail the IDEs options for configuring the debug step (#48507) 2019-10-25 17:26:22 +03:00
Marios Trivyzas
b84b7e13c8
[Docs] Fix testing docs regarding --debug-jvm (#48293)
Remove extra whitespace and highlight the starting port number.

Follows: #48188
2019-10-21 15:20:33 +02:00
Alpar Torok
832ddb36f5
Switch to debug with server=n (#48188)
Before this change one needed to re-start debugging several times, as we
launched multiple JVMs in debug mode.
With this option the IDE has the option to re-launch and listen for
connections again leading for to a more pleasant experience.
2019-10-21 15:06:03 +03:00
William Brafford
19ae4542b2
Update TESTING.asciidoc for new :qa:os test style (#48023)
* Update testing document for new packaging tests

The TESTING.asciidoc document had gotten out of date due to some new and
wonderful changes in our vagrant testing code. I've removed all of the
instructions that no longer work, and added working examples and descriptions
in their place.
2019-10-16 16:24:50 -04:00
Mark Vieira
3ebb7ae1d6
Rename system property to change bwc checkout behavior (#45574) 2019-08-16 08:43:14 -07:00
Rory Hunter
915dd7afbc
Update testing guidelines (#45617)
The testing guidelines didn't reflect current Gradle usage, so I've
updated them and added a link to the relevant part of the Gradle docs.
2019-08-16 09:25:24 +01:00
Ryan Ernst
b15d62c3ab
Remove the transport client (#42538)
This commit removes the transport client and all remaining uses in the code.
2019-06-05 17:22:37 -07:00
Toby McLaughlin
04ee386aed
Run packaging tests on RHEL 8 (#41662) 2019-05-02 08:53:33 +10:00
Dawid Weiss
82702cf4c8 Corrected typo (annotations -> assertions). (#41481) 2019-04-24 21:15:52 +03:00
Jason Tedor
10834a17ea
Drop support for Ubuntu 14.04 (#40709)
With the 7.0.0 release, we are dropping support for Ubuntu 14.04. This
commit removes this OS from our testing infrastructure.
2019-04-02 08:51:11 -04:00
Ryan Ernst
7d5ff03b82
Add no-jdk distributions (#39882)
This commit adds a variant for every official distribution that omits
the bundled jdk. The "no-jdk" naming is conveyed through the package
classifier, alongside the platform. Package tests are also added for
each new distribution.
2019-03-15 00:55:15 -07:00