-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Handles mutex_m issue with Ruby 3.4 in tests
- Loading branch information
1 parent
93cbc5c
commit fd282f7
Showing
6 changed files
with
148 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
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,29 @@ | ||
# 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. | ||
|
||
source 'https://rubygems.org' | ||
|
||
# $ BUNDLE_GEMFILE=./Gemfile-excon.gemfile bundle install | ||
# $ BUNDLE_GEMFILE=./Gemfile-excon.gemfile bundle exec rake test:adapters | ||
gemspec | ||
|
||
gem 'rspec' | ||
gem 'elasticsearch' | ||
|
||
group :excon do | ||
gem 'faraday-excon' | ||
end |
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,31 @@ | ||
# 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. | ||
|
||
namespace :test do | ||
namespace :adapters do | ||
desc 'Run excon test' | ||
task :excon do | ||
# sh "BUNDLE_GEMFILE=#{FARADAY1_GEMFILE} bundle exec rspec" | ||
# test.test_files = FileList[''] | ||
# test.verbose = false | ||
# test.warning = false | ||
# sh "BUNDLE_GEMFILE=#{FARADAY1_GEMFILE} ruby -Ilib:test #{test}" | ||
test = File.expand_path('./excon_spec.rb', __dir__) | ||
sh "bundle exec rspec #{test}" | ||
end | ||
end | ||
end |
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,24 @@ | ||
# 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. | ||
|
||
source 'https://rubygems.org' | ||
|
||
# $ BUNDLE_GEMFILE=./Gemfile-excon.gemfile bundle install | ||
# $ BUNDLE_GEMFILE=./Gemfile-excon.gemfile bundle exec rake test:adapters | ||
gemspec | ||
|
||
gem 'faraday-excon' |
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,62 @@ | ||
# 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 'bundler/inline' | ||
gemfile do | ||
source 'https://rubygems.org' | ||
|
||
gem 'faraday-excon' | ||
gem 'elasticsearch' | ||
gem 'rspec' | ||
gem 'debug' | ||
gemspec | ||
end | ||
|
||
require 'elasticsearch' | ||
require 'faraday/excon' | ||
require 'spec_helper' | ||
|
||
describe 'Excon Adapter' do | ||
let(:client) do | ||
Elasticsearch::Client.new( | ||
hosts: ELASTICSEARCH_HOSTS, | ||
adapter: :excon, | ||
transport_options: { ssl: { verify: false } } | ||
) | ||
end | ||
|
||
context 'Integrates with elasticsearch API' do | ||
it 'should perform the API methods' do | ||
expect do | ||
# Index a document | ||
client.index(index: 'test-index', id: '1', body: { title: 'Test' }) | ||
|
||
# Refresh the index | ||
client.indices.refresh(index: 'test-index') | ||
|
||
# Search | ||
response = client.search(index: 'test-index', body: { query: { match: { title: 'test' } } }) | ||
|
||
expect(response['hits']['total']['value']).to eq 1 | ||
expect(response['hits']['hits'][0]['_source']['title']).to eq 'Test' | ||
|
||
# Delete the index | ||
client.indices.delete(index: 'test-index') | ||
end.not_to raise_error | ||
end | ||
end | ||
end |
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