-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Test Runner] Skips migrate.reindex tests
- Loading branch information
1 parent
f389b6a
commit a3a098e
Showing
5 changed files
with
198 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
elasticsearch-api/spec/unit/actions/async_search/delete_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Licensed to Elasticsearch B.V. under one or more contributor | ||
# license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright | ||
# ownership. Elasticsearch B.V. licenses this file to you under | ||
# the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
require 'spec_helper' | ||
|
||
describe 'async_search.delete' do | ||
let(:expected_args) do | ||
[ | ||
'DELETE', | ||
'_async_search/foo', | ||
{}, | ||
nil, | ||
{}, | ||
{ endpoint: 'count' } | ||
] | ||
end | ||
|
||
it 'performs the request' do | ||
expect(client_double.async_search.delete(id: 'foo')).to be_a Elasticsearch::API::Response | ||
end | ||
end |
35 changes: 35 additions & 0 deletions
35
elasticsearch-api/spec/unit/actions/async_search/get_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Licensed to Elasticsearch B.V. under one or more contributor | ||
# license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright | ||
# ownership. Elasticsearch B.V. licenses this file to you under | ||
# the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
require 'spec_helper' | ||
|
||
describe 'async_search.delete' do | ||
let(:expected_args) do | ||
[ | ||
'GET', | ||
'_async_search/foo', | ||
{}, | ||
nil, | ||
{}, | ||
{ endpoint: 'count' } | ||
] | ||
end | ||
|
||
it 'performs the request' do | ||
expect(client_double.async_search.get(id: 'foo')).to be_a Elasticsearch::API::Response | ||
end | ||
end |
34 changes: 34 additions & 0 deletions
34
elasticsearch-api/spec/unit/actions/async_search/status_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Licensed to Elasticsearch B.V. under one or more contributor | ||
# license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright | ||
# ownership. Elasticsearch B.V. licenses this file to you under | ||
# the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
require 'spec_helper' | ||
|
||
describe 'async_search.delete' do | ||
let(:expected_args) do | ||
[ | ||
'GET', | ||
'_async_search/status/foo', | ||
{}, | ||
nil, | ||
{}, | ||
{ endpoint: 'async_search.status' } | ||
] | ||
end | ||
|
||
it 'performs the request' do | ||
expect(client_double.async_search.status(id: 'foo')).to be_a Elasticsearch::API::Response | ||
end | ||
end |
87 changes: 87 additions & 0 deletions
87
elasticsearch-api/spec/unit/actions/async_search/submit_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# Licensed to Elasticsearch B.V. under one or more contributor | ||
# license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright | ||
# ownership. Elasticsearch B.V. licenses this file to you under | ||
# the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
require 'spec_helper' | ||
|
||
describe 'async_search.submit' do | ||
context 'with no parameters' do | ||
let(:expected_args) do | ||
[ | ||
'POST', | ||
'_async_search', | ||
{}, | ||
nil, | ||
{}, | ||
{ endpoint: 'async_search.submit' } | ||
] | ||
end | ||
|
||
it 'performs the request' do | ||
expect(client_double.async_search.submit).to be_a Elasticsearch::API::Response | ||
end | ||
end | ||
|
||
context 'with index' do | ||
let(:expected_args) do | ||
[ | ||
'DELETE', | ||
'_async_search/foo', | ||
{}, | ||
nil, | ||
{}, | ||
{ endpoint: 'count' } | ||
] | ||
end | ||
|
||
it 'performs the request' do | ||
expect(client_double.async_search.submit).to be_a Elasticsearch::API::Response | ||
end | ||
end | ||
end | ||
|
||
require 'test_helper' | ||
|
||
module Elasticsearch | ||
module Test | ||
class XPackAsyncSearchSubmit < Minitest::Test | ||
subject { FakeClient.new } | ||
|
||
context 'XPack: Async Search Submit' do | ||
should 'perform correct request' do | ||
subject.expects(:perform_request).with do |method, url, params, body| | ||
assert_equal('POST', method) | ||
assert_equal('_async_search', url) | ||
assert_equal({}, params) | ||
assert_nil(body) | ||
end.returns(FakeResponse.new) | ||
|
||
subject.async_search.submit | ||
end | ||
|
||
should 'perform correct request with index' do | ||
subject.expects(:perform_request).with do |method, url, params, body| | ||
assert_equal('POST', method) | ||
assert_equal('foo/_async_search', url) | ||
assert_equal({}, params) | ||
assert_nil(body) | ||
end.returns(FakeResponse.new) | ||
|
||
subject.async_search.submit(index: 'foo') | ||
end | ||
end | ||
end | ||
end | ||
end |