Commit graph

56 commits

Author SHA1 Message Date
Cas Donoghue
27a1d4354a
Fix acceptance test assertions for updated plugin remove (#17122) (#17132)
This commit updates the acceptance tests to expect messages in the updated
format for removing plugins. See https://github.com/elastic/logstash/pull/17030
for change.
2025-02-21 12:21:57 -08:00
Ry Biesemeyer
5109867459
Fix acceptance test assertions for updated plugin remove (#17126) (#17131)
This commit updates the acceptance tests to expect messages in the updated
format for removing plugins. See https://github.com/elastic/logstash/pull/17030
for change.

Co-authored-by: Cas Donoghue <cas.donoghue@gmail.com>
2025-02-20 09:52:16 -08:00
Dimitrios Liappis
54f73e5d22
Follow up to #15900 -- fix remaining acceptance tests (#15907)
PR#15900 missed a few more places where Logstash is installed but
a working minimal pipeline config is added.
This commit fixes that and stabilizes all acceptance tests, thus
minizing the need for time consuming BK retries of corresponding
steps.

Relates #15900
Relates https://github.com/elastic/logstash/issues/15784
2024-02-15 11:33:17 +02:00
Dimitrios Liappis
be3f75e346
Clean up left over scripts after CI migration (#15926)
Following the CI migration from Jenkins to Buildkite, this commit
removes a number of left over helper scripts that aren't needed
anymore.

Closes https://github.com/elastic/ingest-dev/issues/2850
2024-02-12 11:26:28 +02:00
Dimitrios Liappis
b66dc7f460
Fix service startup with acceptance tests (#15900)
This commit fixes the startup of the Logstash service during packaging
tests by adding a minimal pipeline config. Without it, the service was
flapping from start to start and vice versa causing test flakiness.

Relates https://github.com/elastic/logstash/issues/15784
2024-02-06 17:38:12 +02:00
Dimitrios Liappis
15e19a96c2
Fix acceptance/packaging upgrade test near a release (#15826)
The current mechanism of discovering the latest released version per
branch (via ARTIFACTS_API) isn't foolproof near the time of a new
release, as it may be pick a version that hasn't been released
yet. This leads to failures[^1] of the packaging upgrade tests, as we
attempt to download a package file that doesn't exist yet.

This commit switches to an API that that is more up to date regarding
the release version truth.

[^1]: https://buildkite.com/elastic/logstash-exhaustive-tests-pipeline/builds/125#018d319b-9a33-4306-b7f2-5b41937a8881/1033-1125
2024-01-22 20:58:32 +02:00
Dimitrios Liappis
cebe4a7537
Refactor qa/acceptance tests to get away from vagrant (#15696)
This commit modernizes the qa/acceptance (packaging) test framework by
moving away from Vagrant and having the tests operate locally.

As we are migrating to Buildkite, the expectation is that those tests
will run on dedicated vms thus removing the necessity of vagrant.

Relates: https://github.com/elastic/ingest-dev/issues/1722
2024-01-08 09:40:58 +02:00
Andres Rodriguez
cf67cb1377
Rubocop: Enable most SpaceInside cops (#15201)
Enabled:
* SpaceInsideArrayLiteralBrackets
* SpaceInsideParens
* SpaceInsidePercentLiteralDelimiters
* SpaceInsideStringInterpolation
* Add enforced style for SpaceInsideStringInterpolation

Enabled without offenses:
* SpaceInsideArrayPercentLiteral
* Layout/SpaceInsideRangeLiteral
* Layout/SpaceInsideReferenceBrackets
2023-07-20 09:49:46 -04:00
Andres Rodriguez
4255a8fd1c
Rubocop: Enable SpaceAround cops (#15196)
* Enable SpaceARoundBlockParameters
* Enable SpaceAroundEqualsInParameterDefault
* Enable SpaceAroundKeyword
* Enable SpaceAroundOperators
* Enable SpaceBeforeBlockBraces, which yields no changes
2023-07-18 21:11:57 -04:00
Andres Rodriguez
acd87a69e7
Rubocop: Enable various EmptyLine cops (#15194)
Disabled:
 * EmptyLineAfterGuardClause
 * EmptyLineAfterMultilineCondition
 * EmptyLinesAroundAccessModifier

Enabled:
 * Layout/EmptyLineAfterMagicComment
 * Layout/EmptyLineBetweenDefs
 * Layout/EmptyLines
 * Layout/EmptyLinesAroundArguments
 * Layout/EmptyLinesAroundAttributeAccessor
 * Layout/EmptyLinesAroundBeginBody
 * Layout/EmptyLinesAroundBlockBody
 * Layout/EmptyLinesAroundExceptionHandlingKeywords
 * Layout/EmptyLinesAroundMethodBody
 * Layout/EmptyLinesAroundModuleBody
2023-07-18 16:49:16 -04:00
Andres Rodriguez
26ff2f7db9
Enable Style/TrailingEmptyLines and fix ocurrences (#15179) 2023-07-14 14:46:33 -04:00
Andres Rodriguez
5e34aacc6e
Enable trailing whitespace formating (#15174)
* Enable Layout/TrailingWhitespace cop formation
* Remove Trailing Whitespaces
2023-07-14 13:22:02 -04:00
Rob Bavey
330b28eb92
[Test] Fix acceptance tests to deal with Java 8 removal (#13728)
The acceptance tests are used to test a variety of scenarios installing, running and updating
logstash on a variety of Linux distributions.

The vagrant distributions we test on are old, and use java8 by default. This commit removes
the java8 tests and changes the tests to only test the jdk included distribution.
2022-02-09 09:56:42 -05:00
Rob Bavey
a6e3914d6b
Fix bundler handling of 'without' (#13351)
* Fix bundler handling of 'without'

Prior to this change, the values set in `set_local` are ignored when invoking
bundler via the command line, as is used with `invoke!`. This commit sets those
values in `ENV` variables instead, fixing the functionality to not install
development gems.
* Update bundler spec to check ENV variable
* Added test to ensure kramdown gem not vendored
* Re-add set_local setting to play nice with `expand_logstash_mixin_dependencies`
* logstash service needs to be installed
* gem_vendored? needs to use full path to vendor files
* use `stdout` from `cat` command to generate spec temporary file
* Removed unnecessary support for supplying a block from #gem_vendored?

Co-authored-by: Ry Biesemeyer <ry.biesemeyer@elastic.co>
2021-10-26 17:48:03 -04:00
Andrea Selva
d51afe54d5
Removed JAVA_HOME using only LS_JAVA_HOME (#13214)
Removes the usage of JAVA_HOME completely which is not anymore used for JDK path resolution.

Updated all the Logstash launching scripts to use only LS_JAVA_HOME as environment variable to
determine the JDK to use to launch Logstash. JAVA_HOME is abandoned for this job.
2021-09-15 09:29:07 +02:00
Andrea Selva
979ea21c5e
Introduce LS_JAVA_HOME environment variable (#13204)
This commit modifies the launch scripts to take care of the LS_JAVA_HOME giving precedence over the JAVA_HOME, which is still used it the first is not found.
2021-09-06 10:22:51 +02:00
Rob Bavey
4707cbd94c
Bundler: freeze lockfile on run, and "normalize" platform on plugin changes (#13015)
This PR enables the upgrade of bundler to the latest version.

Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler > `2.23` making runtime changes to `Gemfile.lock` (unless the lock file was `frozen`) based on the specific platform the application was being run on, overriding any platforms (including generic `java` platform) set during build time. This was in conflict with changes made in #12782, which prevented the logstash user writing to files in `/usr/share/logstash`.

This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic `java` platform, and not changed to the specific platform for the runtime JVM.

This PR also introduces a new runtime flag, `--enable-local-plugin-development`. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, eg

```
gem "logstash-integration-kafka", :path => '/users/developer/code/plugins/logstash-integration-kafka'
```

to facilitate quick and simple plugin testing.

This PR also sets the `silence_root_warning` flag to avoid bundler printing out alarming looking warning messages when `sudo` is used. This warning message was concerning for users - it would be printed out during normal operation of `bin/logstash-plugin install/update/remove` when run under `sudo`, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages. 

This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests.

## Release notes

* Updated Bundler to latest version
* Ensured that `Gemfile.lock` are appropriately frozen
* Added new developer-only flag to facilitate local plugin development to allow unfrozen lockfile in a development environment
2021-08-17 09:35:30 -04:00
Rob Bavey
4545671b4e
[Test] Fix Unix acceptance tests (#13071)
This PR contains commits attempting to fix the broken acceptance tests:

* Fix the set of test platforms used to run unix acceptance tests

Modernizes the list of OS's used in acceptance tests, to the most modern OS's available at https://app.vagrantup.com/elastic,. This removes the centos-6 platform from the build, which is past end-of-life and fails vagrant bootstrapping, causing the build to fail.

This is more of band-aid than anything - in the longer term, we should remove these vagrant based tests completely, and rely
on the build infrastructure to perform OS-based acceptance tests. 

* Fix regexes for plugin list tests. …

Fixes tests to support the plugin alias feature. This introduced a new format for
entries emitted by `bin/logstash-plugin list`:

eg
```
└── logstash-input-elastic_agent (alias)
```

This commit fixes the test to account for this change, and whitespace variances.
2021-07-14 09:15:07 -04:00
kaisecheng
efa12c048b
Allow plugin manager uninstall plugin regardless of working directory (#12786)
Fixed: #10781
2021-04-08 17:59:06 +02:00
Rob Bavey
5c7d5ac8c0 Bundle JDK (AdoptOpenJDK 11) in Logstash artifacts (x86_64)
Create new artifacts with bundled JDK for the supported platforms on x86_64. Download JDK packages from AdoptOpenJDK site, the selected version is loaded from `versions.yml`.
Changed also the launch scripts to give precedence to JAVA_HOME, then fallback on bundled JDK if present, as last resource go to the system Java.

New artifacts produced with bundled JDK are:
- tar.gz with JDK for Linux and Darwin
- zip file for Windows
- dep and rpm
- Docker image

All artifacts without JDK are now postfixed with '-no-jdk' while the ones with JDK included has the architecture extension.

Covered with tests the touched parts

Co-authored-by: Rob Bavey <robbavey@users.noreply.github.com>
2020-09-23 08:18:31 -07:00
João Duarte
e9c9865f40
Add apache and elastic license headers to source code files (#11673)
* add license header to ruby and java files
* add license header to erb and rake files
* add license headers to gradle files
2020-03-11 11:53:38 +00:00
Joao Duarte
4dcf53cbde don't rely on expect match and last_match in qa test
Fixes #11273
2019-10-31 09:14:07 +00:00
Joao Duarte
bec396e5e8 ensure output of plugin list is utf8
Fixes #11246
2019-10-18 16:52:51 +00:00
Ry Biesemeyer
2854132ce8 validate plugin list output respecting integration plugins
Fixes #11240
2019-10-18 08:54:33 +00:00
Rob Bavey
6cd7329080 Mute CLI integration plugin acceptance test
Test is failing CI
https://github.com/elastic/logstash/issues/10459

Fixes #10460
2019-02-15 22:08:39 +00:00
Joao Duarte
859cbaaea9 Support for integration plugins in plugin manager
* List action shows integration and provided plugins
* List action shows integration when searching by inner plugin
* Install action removed plugins provided by integration
* Install action aborts if plugin is provided by an integration
* Remove action aborts if plugin is provided by an integration

Fixes #9802

Fixes #9811
2018-09-27 10:07:26 +00:00
Pier-Hugues Pellerin
76286b4f0e use jruby 9.1.9.0
Work done by @guyboertje and @ph

Since JRuby 1.7.25 is now EOL we are migrating Logstash to use JRuby 9k and JDK8 only,
Not much needed updating to make this work, its was mostly a drop in replacement from the previous version.

The major point was the change in the implementation of Time in JRuby, JRuby now use `java.time`
instead of joda time, this allow JRuby to have nanoseconds precision on time object.
2017-06-12 12:35:10 -04:00
Pier-Hugues Pellerin
ef991b65c0 Fix the acceptance on Debian family
This commit fixes an issue when the debian 8 machine was not correctly bootstrapped and made the suite,
We also disable the test introduced by #6879 they need to be redone so they actually test the content fo the generated gem.

Fixes: #7123

Fixes #7187
2017-05-24 14:44:21 +00:00
Joao Duarte
30dc1b83a7 fix syntax error in logstash-plugin generate test
Fixes #7182
2017-05-22 18:41:32 +00:00
Wainer dos Santos Moschetta
f67cc94c42 Add test for logstash-plugin generate command.
This change adds an acceptance test that creates a plugin template
for each type with logstash-plugin generate command,
then proceed to check they can be installed.

Fixes #6183.

Fixes #6879
2017-04-18 19:49:16 +00:00
Josh Soref
a06dc211ff Spelling fixes (#6806)
Spelling fixes across the board.
2017-03-29 19:33:26 -07:00
Pier-Hugues Pellerin
d669540123 Relax the acceptance test expectation to match only the exception message
Fixes: #6310

Fixes #6325
2016-11-29 14:24:36 -05:00
Suyog Rao
28f77818a3 Fix acceptance tests
Fixes #6051
2016-10-13 11:51:14 -04:00
Suyog Rao
44a52ff18e Deprecate uninstall for Plugin Manager
Adds remove and deprecates uninstall

Fixes #6041

Fixes #6042
2016-10-13 10:12:22 -04:00
Pere Urbon-Bayes
d087b78d0d make redhat test uninstall a packege after test are done also making sure install errors are raised only when an error code is != 0
Fixes #5936
2016-09-16 12:05:26 -04:00
Joao Duarte
b8cb201d13 make sure sed replacements are posix compliant
using \s will not work in some systems, use [[:space]] instead

Fixes #5812
2016-08-23 13:57:48 -04:00
Pier-Hugues Pellerin
9f9de6dd88 Fix an issue with the logstash-plugin list acceptance test
The previous regexp used to match the version did not take into
consideration pre-release version.

Fixes #5700
2016-07-27 16:00:20 -04:00
Pere Urbon-Bayes
612c9b8a6d Add specific tests in the plugin manager acceptance test for --no-verify flag
Fixes #5538
2016-06-29 08:16:37 -04:00
Pere Urbon-Bayes
739713b518 add --no-verify to all plugin install commands and prefix also all of them with JAR_SKIP in to improve speed of the acceptance test
exclude jar-dependency when running the plugin manager tests

Fixes #5538
2016-06-29 08:16:37 -04:00
Joao Duarte
72b277404b make -V/--version fast on *nix 2016-06-21 14:30:15 +01:00
Pere Urbón
20b928392d make acceptance test understand there are artifacts that are snapshots and ones that not (#2)
Fixes #5522
2016-06-21 06:57:23 -04:00
Joao Duarte
bd43b28764 Revert "add acceptance test"
This reverts commit fc39bba223.
2016-06-17 10:00:44 +01:00
Pere Urbon-Bayes
3d8608f5a5 make LS_QA_EXPERIMENTAL be LS_QA_EXPERIMENTAL_OS
Fixes #5506
2016-06-17 03:03:35 -04:00
Pere Urbon-Bayes
85e39d99f1 Add the idea of experimental platforms for the acceptance testing framework, this will let us keep focus on platforms inside the support matrix, but also do some testing on upcoming platforms without mixing boths ideas.
Fixes #5506
2016-06-17 03:03:35 -04:00
Joao Duarte
fc39bba223 add acceptance test 2016-06-16 12:46:30 +01:00
Pere Urbon-Bayes
e254d9f67d rework the acceptance update scenario to avoid using snapshort restore, this might be a temporary solution for ssh issues in vagrant and ubuntu hosts
Fixes #5456
2016-06-08 09:27:50 -04:00
Pere Urbon-Bayes
c5610505c7 Enhance QA acceptance test framework docs by adding comments and and upgraded readme in order to provide more context and knowledge around it.
Fixes #5436
2016-06-03 13:16:39 +00:00
Pere Urbon-Bayes
1c7640bb07 pass the settings file location as required by the new package structure
Fixes #5399

Fixes #5350
2016-06-02 14:37:15 +00:00
Pere Urbon-Bayes
21777bae40 Collection of small bootstrap related fixes like
* make sure downloaded logstashes use the new (arch independant files name)
* add specific privileged bootstrap script for debian 8 that is able to install java8 for this distro
* wrap the bootstrap scripts within the platform class, like this logic is in one specific place to select platform specific components
* add platform specific bootstrap file for sles-12 and also scripts to download latest logstash rpm version
* add custom bootstrap script for ubuntu-1404 to be sure it loads all ca certificates into the system
* make the necessary changes to compile with the new package system
* correct logstash path usage
* remove unnecessary dependancy to rake inside the acceptance test framework
* fix script execution under ubuntu environments, making sure it runs on bash

Fixes #5350
2016-06-02 14:37:15 +00:00
Pier-Hugues Pellerin
7b38e798c2 Migration of the CLI script to run under Vagrant VMs.
This is the First pass to add the `integration` test for the CLI, the
Logstash and the logstash-plugin command.

Fixes #5259

Fixes #5350
2016-06-02 14:37:15 +00:00