From 48d6ab5b3feb0a3533919618f9295a1b439048b1 Mon Sep 17 00:00:00 2001 From: Pere Urbon-Bayes Date: Wed, 18 Feb 2015 11:50:43 +0100 Subject: [PATCH] Add a set of scripts that simplify: * The necessary setup for the CI test to be executed. * The actuall CI test execution, having a different scripts for each different workflow. This makes the test execution simpler and standard, so changes in internal task don't need big changes in the CI config. It also documents and makes easy for developers to run the tests. ci scripts renaming wrap up all different test workflows into a single script with an argument Fixes #2639 --- ci/ci_setup.sh | 11 +++++++++++ ci/ci_test.sh | 23 +++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100755 ci/ci_setup.sh create mode 100755 ci/ci_test.sh diff --git a/ci/ci_setup.sh b/ci/ci_setup.sh new file mode 100755 index 000000000..01909da26 --- /dev/null +++ b/ci/ci_setup.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +#squid proxy work, so if there is a proxy it can be cached. +sed -i.bak 's/https:/http:/' tools/Gemfile + +# Clean up some possible stale directories +rm -rf vendor # make sure there are no vendorized dependencies +rm -rf spec/reports # no stale spec reports from previous executions + +# Setup the environment +rake bootstrap # Bootstrap your logstash instance diff --git a/ci/ci_test.sh b/ci/ci_test.sh new file mode 100755 index 000000000..2b4b770b6 --- /dev/null +++ b/ci/ci_test.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +## +# Keep in mind to run ci/ci_setup.sh if you need to setup/clean up your environment before +# running the test suites here. +## + +SELECTED_TEST_SUITE=$1 + +if [[ $SELECTED_TEST_SUITE == $"all" ]]; then + echo "Running all plugins tests" + rake plugin:install-all # Install all plugins, using the file at tools/Gemfile.plugins.all + rake vendor:append_development_dependencies\[tools/Gemfile.plugins.all\] # Append development dependencies to run the test + rake plugin:install-all # Install previously appended development dependencies + + #Run the specs test from all previously installed logstash plugins + ./bin/logstash rspec --order rand vendor/bundle/jruby/1.9/gems/logstash-*/spec/{input,filter,codec,output}s/*_spec.rb +else + echo "Running core tests" + rake test:prep # setup the necessary plugins and dependencies for testing + # Execute the test + ./bin/logstash rspec --order rand --format CI::Reporter::RSpec spec/**/*_spec.rb spec/*_spec.rb +fi