Commit graph

46 commits

Author SHA1 Message Date
github-actions[bot]
b908f6ea1a
Follow up to #15900 -- fix remaining acceptance tests (#15907) (#15953)
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

(cherry picked from commit 54f73e5d22)

Co-authored-by: Dimitrios Liappis <dimitrios.liappis@gmail.com>
2024-02-15 12:52:19 +02:00
Dimitrios Liappis
a6839e0c69
Fix service startup with acceptance tests (#15900) (#15905)
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

(cherry picked from commit b66dc7f460)
2024-02-06 18:17:06 +02:00
github-actions[bot]
a2f258c0fb
Fix acceptance/packaging upgrade test near a release (#15826) (#15830)
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

(cherry picked from commit 15e19a96c2)

Co-authored-by: Dimitrios Liappis <dimitrios.liappis@gmail.com>
2024-01-22 21:21:14 +02:00
Dimitrios Liappis
e74c0679fd
Refactor qa/acceptance tests to get away from vagrant (#15696) (#15754)
This commit modernizes the qa/acceptance (packaging) test framework by
moving away from Vagrant and having the tests operate locally.

Relates: https://github.com/elastic/ingest-dev/issues/1722

(cherry picked from commit cebe4a7537)
2024-01-17 09:55:40 +02:00
Rob Bavey
292b2ebb57
Backport PR #13351 to 7.16: Fix bundler handling of 'without' (#13362)
Backport PR #13351 to 7.16 branch. Original message:

* 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 18:36:14 -04:00
Andrea Selva
82993fa6f1
[backport 7.x] Use LS_JAVA_HOME in favor of JAVA_HOME #12725 (#13213)
Backport of #13204 #13207 to 7.x branch, introduces the LS_JAVA_HOME as preferred environment variable over JAVA_HOME which is deprecated.
2021-09-08 15:20:34 +02:00
Rob Bavey
2ac869a9c4
Backport PR #13015 to 7.x: Bundler: freeze lockfile on run, and "norm… (#13140)
* Backport PR #13015 to 7.x: Bundler: freeze lockfile on run, and "normalize" platform on plugin changes

Backport PR #13015 to 7.x branch. Original Message:

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.

* 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

(cherry picked from commit 4707cb)

* Remove code pinning bundler to ~> 1.17
2021-08-17 20:31:26 -04:00
Rob Bavey
3c5f7d5e9b
Backport PR #13071 to 7.x: [Test] Fix Unix acceptance tests (#13074)
Backport PR #13071 to 7.x branch. Original message:

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 11:36:57 -04:00
kaisecheng
b852daf202
Allow plugin manager uninstall plugin regardless of working directory (#12786) (#12808)
Fixed: #10781
2021-04-08 18:25:58 +02:00
Rob Bavey
813e059a9d 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-30 05:44:42 -07:00
João Duarte
1fc169b7f6 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:54:32 +00:00
Joao Duarte
81e7b18b25 don't rely on expect match and last_match in qa test
Fixes #11273
2019-10-31 09:14:07 +00:00
Joao Duarte
b9039dcb57 ensure output of plugin list is utf8
Fixes #11246
2019-10-18 16:52:51 +00:00
Ry Biesemeyer
0a89c4cee2 validate plugin list output respecting integration plugins
Fixes #11240
2019-10-18 08:54:33 +00:00
Rob Bavey
2d5df520bf 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
Pere Urbon-Bayes
7dbdf2b517 Introduction of an update scenario for artifacts, including snapshot/restore for VM's and initial schema for this scenario.
Some other minor changes include:

* add back the user level boostrap scripts, useful in that case to pull latest released LS
* cleanup formatting for specs and fixed bootstrap scripts for redhats
* make the latest logstash version available from the current platform config file
* make sure debian based machines use java8
* make sure to use hostname and not just ip:port address when reporting the names

Fixes #5350
2016-06-02 14:37:15 +00:00
Pere Urbon-Bayes
1be0d271d3 Introduce the concept of a single spec for the tests, we removed the platform depant test as they where mostly similar, but only used with small platform dependant metadata, this all has been moved to factory methods. make sure platforms uses canonicals "former" names, so no "ubuntu" platfrom as is debian based, and no "centos" as is redhat based.
Also:

* Refactored the specs organization to make the resoning behind simplier,
introducing the idea of an artifact subject that it wraps the
interactions with the platform.

* Add methods to destroy, bootstrap and halt a list of machines either all of them or the ones listed under a given platform name.

* Introduced more clear namespacing in the rakefile.

* Updated the list of available platforms for acceptance testing, including latest ubuntu, oel, fedora, debian and suse versions

Fixes #5350
2016-06-02 14:37:15 +00:00
Pier-Hugues Pellerin
f74e339e77 Allow to run acceptance test with the local logstash
This change introduce a new command ci/ci_acceptance which is
responsable of building the packages, bootstraping the acceptance test
environment, launching the VMs and running the tests.

You can use the following command to target specific platform.

```
ci/ci_acceptance.sh all
ci/ci_acceptance.sh centos
ci/ci_acceptance.sh debian
```

This PR also add a new rake task to build all the artifacts in a single
run called rake artifact:all it make sure we only install the plugin
only once and make the build process faster.

Fixes #5350
2016-06-02 14:37:15 +00:00
Tal Levy
34edb9773f update SNAPSHOT tests to run
Fixes #5350
2016-06-02 14:37:15 +00:00
Pier-Hugues Pellerin
99b7f772cf Introduce the use of a platforms.json file where to keep all platforms information to simplify the vagrantfile structure. Also make the vagrant execution more elegant under rake
Fixes #5350
2016-06-02 14:37:14 +00:00
Pere Urbon-Bayes
6c4a09c631 first iteration of a QA acceptance and integration test framework, this initial run include only very basic infraestructure and is for sure going to evolve as necessary to make it a reality.
Fixes #5350
2016-06-02 14:37:14 +00:00