Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Run otel tests in 8.x #2537

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/otel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: opentelemetry
on:
push:
branches:
- main
- 8.x
pull_request:
branches:
- main
- 8.x
jobs:
test-otel:
name: 'Test Open Telemetry'
Expand Down
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
Loading