Skip to content

Commit

Permalink
[Test Runner] Skips migrate.reindex tests
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed Dec 11, 2024
1 parent f389b6a commit a3a098e
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 0 deletions.
7 changes: 7 additions & 0 deletions elasticsearch-api/spec/rest_api/skipped_tests_platinum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,10 @@
-
:file: 'esql/150_lookup.yml'
:description: '*'
# TODO: once migrate is available in spec
-
:file: 'migrate/10_reindex.yml'
:description: '*'
-
:file: 'migrate/20_reindex_status.yml'
:description: '*'
35 changes: 35 additions & 0 deletions elasticsearch-api/spec/unit/actions/async_search/delete_spec.rb
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 elasticsearch-api/spec/unit/actions/async_search/get_spec.rb
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 elasticsearch-api/spec/unit/actions/async_search/status_spec.rb
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 elasticsearch-api/spec/unit/actions/async_search/submit_spec.rb
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

0 comments on commit a3a098e

Please sign in to comment.