Skip to content

WIP: unhide rspec's integration tests results and give all elasticsearch p… #437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/integration/outputs/update_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def get_es_output( options={} )
'script_type' => 'inline'
})
subject.register
subject.multi_receive([LogStash::Event.new("count" => 3 )])
subject.multi_receive([LogStash::Event.new("counter" => 3 )])
r = @es.get(:index => 'logstash-update', :type => 'logs', :id => "123", :refresh => true)
insist { r["_source"]["counter"] } == 4
end
Expand Down
24 changes: 19 additions & 5 deletions travis-run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/bin/bash
set -ex

function finish {
last_result=$?
set +e
[[ $last_result -ne 0 ]] && cat /tmp/elasticsearch.log
}
trap finish EXIT

setup_es() {
download_url=$1
curl -sL $download_url > elasticsearch.tar.gz
Expand All @@ -10,10 +17,17 @@ setup_es() {
}

start_es() {
es_args=$1
es_args=$@
elasticsearch/bin/elasticsearch $es_args > /tmp/elasticsearch.log &
sleep 10
curl http://localhost:9200 && echo "ES is up!" || cat /tmp/elasticsearch.log
count=120
echo "Waiting for elasticsearch to respond..."
while ! curl --silent localhost:9200 && [[ $count -ne 0 ]]; do
count=$(( $count - 1 ))
[[ $count -eq 0 ]] && return 1
sleep 1
done
echo "Elasticsearch is Up !"
return 0
}

if [[ "$INTEGRATION" != "true" ]]; then
Expand All @@ -22,10 +36,10 @@ else
if [[ "$ES_VERSION" == 5.* ]]; then
setup_es https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/$ES_VERSION/elasticsearch-$ES_VERSION.tar.gz
start_es -Ees.script.inline=true -Ees.script.indexed=true -Ees.script.file=true
bundle exec rspec -fd spec --tag integration --tag version_5x || cat /tmp/elasticsearch.log
bundle exec rspec -fd spec --tag integration --tag version_5x
else
setup_es https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-$ES_VERSION.tar.gz
start_es -Des.script.inline=on -Des.script.indexed=on -Des.script.file=on
bundle exec rspec -fd spec --tag integration --tag ~version_5x || cat /tmp/elasticsearch.log
bundle exec rspec -fd spec --tag integration --tag ~version_5x
fi
fi