Commit graph

16 commits

Author SHA1 Message Date
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
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
Andrea Selva
c5b6a853d6
Introduced JDK environment variable to explicitly pass the JAVA_HOME to use and defined .ci/ with OS and JDK preferences (#11934) 2020-05-27 16:48:39 +02:00
Ry Biesemeyer
5b1cd67311 ci: ensure bundle installed before invoking bundle exec in cleanup
DRYs up cleanup code and prevents error that is raised when we attempt
to `bundle exec rake qa:vm:halt` when the bundle has not yet been installed.

Fixes #9803
2018-07-02 17:26:27 +00:00
Armin
0f1be10565 BUILD: Force utf-8 file encoding in java compilation
Fixes #9685
2018-05-30 09:53:57 +00:00
Andrew Cholakian
eae1cc0d0a Correctly CD between dirs in ci/acceptance-tests.sh
This correctly CDs back and forth between dirs and tracks things
with variables to make it easier on the brain than relative paths like '..'

Fixes #9657
2018-05-24 19:49:30 +00:00
Andrew Cholakian
03427d81a2 Fix VM halt task for acceptance tasks by CDing correctly
We were in the wrong dir before, we need to be in the qa dir to shutdown correctly

Fixes #9651
2018-05-24 14:01:31 +00:00
Andrew Cholakian
f8afd2fb39 Make commands to run all acceptance VMs actually do that.
Also, take conservative approach of halting any somehow stale VMs before building

Fixes #9642
2018-05-23 19:23:39 +00:00
Andrew Cholakian
55cd1875a2 Always halt vagrant instances when on CI server.
We were having issues with lots of stale VMs being left around. This, hopefully, fixes it.

Fixes #9642
2018-05-23 19:23:39 +00:00
Jenkins CI
93cad10da1 Migrate x-pack-logstash source to logstash 2018-04-24 10:46:15 -05:00
Andrew Cholakian
ee987ef5fc Set gradle log level to info on CI
Fixes #9240
2018-03-14 22:02:27 +00:00
Andrew Cholakian
041fca924f Never use gradle daemon on CI servers
We've had some issues with builds crashing the gradle daemon on CI servers. This can obfuscate errors.
This patch removes its usage in CI.

This is considered a gradle best practice: https://docs.gradle.org/current/userguide/gradle_daemon.html#sec:stopping_an_existing_daemon

Fixes #9240
2018-03-14 22:02:27 +00:00
Armin
86bf8dbb37 BUILD: Run rake tasks in Gradle JVM
Fixes #8941
2018-01-17 11:57:16 +00:00
Armin
c7b7025cc1 #8216 Use standard name for Gemfile.lock
Fixes #8525
2017-10-26 08:33:03 +00:00
Jake Landis
aef8c7a255 Instruct Jenkins to not abort other Vagrant hosts
See: https://stackoverflow.com/questions/19736862/vagrant-aborted-at-end-of-jenkins-job
and: https://wiki.jenkins.io/display/JENKINS/ProcessTreeKiller

Note - the existing vagrant lifecycle instructs a `destroy` before bootstrapping that will ensure a clean start if last process did not die properly.

Fixes #8380
2017-09-24 01:13:11 +00:00
Jake Landis
196d1a1f7e Introduce docker for CI builds.
This commit includes:
* A base Dockerfile and script to push to a Docker repo
* A per-build Dockerfile (derived from the base)
* Updates to the test scripts to allow for more parallel builds
* Docker wrappers for the tests scripts
* Update for the integration test readme to manually run the tests
* Clean up the output of the Java tests
* Remove offline tag for tests (no longer needed that we don't use docker dependent services)

This commit does NOT include:
* Changes needed for the CI system to use Docker

Fixes #8223
2017-09-14 18:55:41 +00:00