Skip to content

Commit

Permalink
Removes dependency on extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed Mar 5, 2021
1 parent ce57cc1 commit ed070b8
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 52 deletions.
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
source 'https://rubygems.org'

gem "rake", "~> 12"

gem 'elasticsearch-extensions'

gem "elasticsearch"
gem "pry"
gem "ansi"
gem "cane"
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,7 @@ You can also unit, integration, or both tests for all sub-projects from the top-

rake test:all

The test suite expects an Elasticsearch cluster running on port 9250, and **will delete all the data**. You can launch an isolated, in-memory Elasticsearch cluster with the following Rake task:

TEST_CLUSTER_COMMAND=/tmp/builds/elasticsearch-2.0.0-SNAPSHOT/bin/elasticsearch TEST_CLUSTER_NODES=1 bundle exec rake test:cluster:start

See more information in the documentation for the [`elasticsearch-extensions`](https://github.com/elastic/elasticsearch-ruby/tree/master/elasticsearch-extensions#testcluster) gem.
The test suite expects an Elasticsearch cluster running on port 9250, and **will delete all the data**.

## License

Expand Down
41 changes: 1 addition & 40 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# under the License.

require 'pathname'
require 'elasticsearch'

subprojects = ['elasticsearch-rails', 'elasticsearch-persistence']
subprojects << 'elasticsearch-model' unless defined?(JRUBY_VERSION)
Expand Down Expand Up @@ -97,26 +98,6 @@ namespace :test do
end
end

desc "Run Elasticsearch (Docker)"
task :setup_elasticsearch_docker do
begin
sh <<-COMMAND.gsub(/^\s*/, '').gsub(/\s{1,}/, ' ')
docker run -d=true \
--env "discovery.type=single-node" \
--env "cluster.name=elasticsearch-rails" \
--env "http.port=9200" \
--env "cluster.routing.allocation.disk.threshold_enabled=false" \
--publish 9250:9200 \
--rm \
docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION}
COMMAND
require 'elasticsearch/extensions/test/cluster'
Elasticsearch::Extensions::Test::Cluster::Cluster.new(version: ENV['ELASTICSEARCH_VERSION'],
number_of_nodes: 1).wait_for_green
rescue
end
end

desc "Setup MongoDB (Docker)"
task :setup_mongodb_docker do
begin
Expand Down Expand Up @@ -167,26 +148,6 @@ namespace :test do
puts "\n"
end
end

namespace :cluster do
desc "Start Elasticsearch nodes for tests"
task :start do
require 'elasticsearch/extensions/test/cluster'
Elasticsearch::Extensions::Test::Cluster.start
end

desc "Stop Elasticsearch nodes for tests"
task :stop do
require 'elasticsearch/extensions/test/cluster'
Elasticsearch::Extensions::Test::Cluster.stop
end

task :status do
require 'elasticsearch/extensions/test/cluster'
(puts "\e[31m[!] Test cluster not running\e[0m"; exit(1)) unless Elasticsearch::Extensions::Test::Cluster.running?
Elasticsearch::Extensions::Test::Cluster.__print_cluster_info(ENV['TEST_CLUSTER_PORT'] || 9250)
end
end
end


Expand Down
1 change: 0 additions & 1 deletion elasticsearch-model/elasticsearch-model.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ Gem::Specification.new do |s|
s.add_development_dependency 'activemodel', '> 3'
s.add_development_dependency 'bundler'
s.add_development_dependency 'cane'
s.add_development_dependency 'elasticsearch-extensions'
s.add_development_dependency 'kaminari'
s.add_development_dependency 'minitest'
s.add_development_dependency 'mocha'
Expand Down
2 changes: 0 additions & 2 deletions elasticsearch-persistence/elasticsearch-persistence.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ Gem::Specification.new do |s|

s.add_development_dependency "rails", '> 4'

s.add_development_dependency "elasticsearch-extensions"

s.add_development_dependency "minitest"
s.add_development_dependency "test-unit"
s.add_development_dependency "shoulda-context"
Expand Down
1 change: 0 additions & 1 deletion elasticsearch-rails/elasticsearch-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ Gem::Specification.new do |s|

s.add_development_dependency 'bundler'
s.add_development_dependency 'cane'
s.add_development_dependency 'elasticsearch-extensions'
s.add_development_dependency 'lograge'
s.add_development_dependency 'minitest'
s.add_development_dependency 'mocha'
Expand Down

0 comments on commit ed070b8

Please sign in to comment.