Skip to content
Draft
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
12 changes: 12 additions & 0 deletions .ci/docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3'

services:
logstash:
network_mode: host
environment:
- TWITTER_CONSUMER_KEY
- TWITTER_CONSUMER_SECRET
- TWITTER_OAUTH_TOKEN
- TWITTER_OAUTH_TOKEN_SECRET
- SPEC_OPTS
- LOGGER_LEVEL
9 changes: 9 additions & 0 deletions .ci/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
# This is intended to be run inside the docker container as the command of the docker-compose.

# Do not print TWITTER_ (auth) secrets
env | grep -v 'TWITTER_'

set -ex

jruby -rbundler/setup -S rspec -fd
21 changes: 20 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
dist: focal # 20.04 LTS
language: minimal

import:
- logstash-plugins/.ci:travis/travis.yml@1.x
# NOTE: can not be used with dist: focal due docker-ce addon
#- source: logstash-plugins/.ci:travis/travis.yml@1.x
# mode: deep_merge_append
- logstash-plugins/.ci:travis/matrix.yml@1.x
- logstash-plugins/.ci:travis/exec.yml@1.x

addons:
apt:
packages:
- squid

before_install:
- netstat -plunt | grep 3128

env:
jobs:
- SPEC_OPTS="--tag integration" ELASTIC_STACK_VERSION=7.x
13 changes: 11 additions & 2 deletions spec/integration/twitter_pubsub_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
__END__
require_relative "../spec_helper"

Thread.abort_on_exception = true

describe LogStash::Inputs::Twitter do
describe "full integration", :integration => true do

before(:all) do
@_abort_on_exception = Thread.abort_on_exception
Thread.abort_on_exception = true
end

after(:all) do
Thread.abort_on_exception = @_abort_on_exception
end

let(:pub_config) do
{
:consumer_key => ENV['PUB_TWITTER_CONSUMER_KEY'],
Expand Down
3 changes: 0 additions & 3 deletions spec/integration/twitter_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
__END__
# this test is quite unreliable - commenting it out

require_relative "../spec_helper"

describe LogStash::Inputs::Twitter do
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require 'logstash/devutils/rspec/spec_helper'
require 'logstash/inputs/twitter'
require 'twitter'
require 'rspec_sequencing'

require 'logstash/inputs/twitter'

creds_file_path = File.expand_path('spec/integration_credentials.rb')
if File.exist?(creds_file_path)
load creds_file_path
Expand Down