Skip to content

Commit

Permalink
Update end to end tests
Browse files Browse the repository at this point in the history
Use the testing harness that uses schema webhook instead of runscope.

Other relevant changes:
- Moved e2e tests from Travis.yml to Makefile
- Refined list of files to include in gems, so that other files in
directory don't cause installation problems (like .gem files)
- Remove old e2e only code.
  • Loading branch information
f2prateek committed Sep 10, 2018
1 parent 479e689 commit 60a1dfe
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 99 deletions.
13 changes: 13 additions & 0 deletions .buildscript/e2e.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

set -ex

if [ "$RUN_E2E_TESTS" != "true" ]; then
echo "Skipping end to end tests."
else
echo "Running end to end tests..."
wget https://github.com/segmentio/library-e2e-tester/releases/download/0.2.1/tester_linux_amd64 -O tester
chmod +x tester
./tester -path='./bin/analytics'
echo "End to end tests completed!"
fi
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ rvm:
- 2.4.3
- 2.5.0 # Performs deploys. Change condition below when changing this.

script: make check
script:
- make check

# Deploy tagged commits to Rubygems
# See https://docs.travis-ci.com/user/deployment/rubygems/ for more details
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ dependencies:
bundle install --verbose

# Run all tests and checks (including linters).
check:
check: install # Installation required for testing binary
bundle exec rake
sh .buildscript/e2e.sh

# Compile the code and produce any binaries where applicable.
build:
rm -f analytics-ruby-*.gem
gem build ./analytics-ruby.gemspec

install: build
gem install analytics-ruby-*.gem
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ default_tasks = []

RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = 'spec/segment/**/*_spec.rb'
spec.rspec_opts = "--tag ~e2e" if ENV["RUN_E2E_TESTS"] != "true"
end

default_tasks << :spec
Expand Down
4 changes: 1 addition & 3 deletions analytics-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require File.expand_path('../lib/segment/analytics/version', __FILE__)
Gem::Specification.new do |spec|
spec.name = 'analytics-ruby'
spec.version = Segment::Analytics::VERSION
spec.files = Dir.glob('**/*')
spec.files = Dir.glob("{lib,bin}/**/*")
spec.require_paths = ['lib']
spec.bindir = 'bin'
spec.executables = ['analytics']
Expand All @@ -22,8 +22,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'tzinfo', '1.2.1'
spec.add_development_dependency 'activesupport', '~> 4.1.11'
spec.add_development_dependency 'faraday', '~> 0.13'
spec.add_development_dependency 'pmap', '~> 1.1'

if RUBY_VERSION >= '2.0' && RUBY_PLATFORM != 'java'
spec.add_development_dependency 'oj', '~> 3.6.2'
Expand Down
38 changes: 0 additions & 38 deletions spec/helpers/runscope_client.rb

This file was deleted.

54 changes: 0 additions & 54 deletions spec/segment/analytics/e2e_spec.rb

This file was deleted.

1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

require 'segment/analytics'
require 'active_support/time'
require './spec/helpers/runscope_client'

# Setting timezone for ActiveSupport::TimeWithZone to UTC
Time.zone = 'UTC'
Expand Down

0 comments on commit 60a1dfe

Please sign in to comment.