@@ -31,19 +31,30 @@ Rake::TestTask.new('test:unit') do |test|
3131end
3232
3333namespace :test do
34- RSpec ::Core ::RakeTask . new ( :spec )
34+ desc 'Run REST API YAML tests'
35+ RSpec ::Core ::RakeTask . new ( :rest_api ) do |t |
36+ t . pattern = 'spec/xpack/rest_api_yaml_spec.rb'
37+ end
3538
36- desc 'Run rest api yaml tests'
37- Rake ::TestTask . new ( :rest_api ) do |test |
38- `rm Gemfile.lock`
39- test . deps = [ :spec ]
39+ RSpec ::Core ::RakeTask . new ( :spec ) do |t |
40+ t . pattern = 'spec/xpack/**/*_spec.rb'
41+ t . exclude_pattern = 'spec/xpack/rest_api_yaml_spec.rb'
4042 end
4143
4244 desc "Run integration tests"
43- task :integration
45+ task :integration do
46+ Rake ::Task [ 'test:rest_api' ] . invoke
47+ end
48+
49+ desc "Run all tests"
50+ task :all do
51+ Rake ::Task [ 'test:unit' ] . invoke
52+ Rake ::Task [ 'test:spec' ] . invoke
53+ Rake ::Task [ 'test:rest_api' ] . invoke
54+ end
4455
4556 desc "Run Elasticsearch with X-Pack installed (Docker)"
46- task :elasticsearch do
57+ task :elasticsearch , :stack_version do | _ , args |
4758 sh <<-COMMAND . gsub ( /^\s */ , '' ) . gsub ( /\s {1,}/ , ' ' )
4859 docker run \
4960 --name elasticsearch-xpack \
@@ -56,14 +67,13 @@ namespace :test do
5667 --env "path.repo=/tmp" \
5768 --env "repositories.url.allowed_urls=http://snapshot.test*" \
5869 --env "bootstrap.memory_lock=true" \
59- --env "ELASTIC_PASSWORD=MagicWord " \
70+ --env "ELASTIC_PASSWORD=changeme " \
6071 --ulimit nofile=65536:65536 \
6172 --ulimit memlock=-1:-1 \
6273 --publish 9260:9200 \
63- --volume $(pwd)/tmp/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
6474 --memory 4g \
6575 --rm \
66- docker.elastic.co/elasticsearch/elasticsearch:7.0.0-SNAPSHOT
76+ docker.elastic.co/elasticsearch/elasticsearch:#{ args [ :stack_version ] }
6777 COMMAND
6878 end
6979end
0 commit comments