Skip to content

Commit 1232e6f

Browse files
committed
Add OpenSearch module
1 parent 8990459 commit 1232e6f

17 files changed

Lines changed: 404 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ TestContainers is composed of modules for common databases and services. This ch
77
- [ComposeContainer](https://github.com/testcontainers/testcontainers-ruby/tree/main/compose/CHANGELOG.md)
88

99
- [ElasticsearchContainer](https://github.com/testcontainers/testcontainers-ruby/tree/main/elasticsearch/CHANGELOG.md)
10+
- [OpensearchContainer](https://github.com/testcontainers/testcontainers-ruby/tree/main/opensearch/CHANGELOG.md)
1011

1112
- [MariadbContainer](https://github.com/testcontainers/testcontainers-ruby/tree/main/mariadb/CHANGELOG.md)
1213

@@ -32,4 +33,3 @@ TestContainers is composed of modules for common databases and services. This ch
3233

3334
- ComposeContainer. See the [testcontainers-compose readme](https://github.com/testcontainers/testcontainers-ruby/tree/main/compose/README.md) for more information.
3435
- SeleniumContainer. See the [testcontainers-selenium readme](https://github.com/testcontainers/testcontainers-ruby/tree/main/selenium/README.md) for more information.
35-

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ gem "testcontainers-redis", path: "./redis"
1111
gem "testcontainers-postgres", path: "./postgres"
1212
gem "testcontainers-nginx", path: "./nginx"
1313
gem "testcontainers-elasticsearch", path: "./elasticsearch"
14+
gem "testcontainers-opensearch", path: "./opensearch"
1415
gem "testcontainers-mariadb", path: "./mariadb"
1516
gem "testcontainers-mongo", path: "./mongo"
1617
gem "testcontainers-redpanda", path: "./redpanda"

Gemfile.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ PATH
4848
testcontainers-nginx (0.2.0)
4949
testcontainers-core (~> 0.1)
5050

51+
PATH
52+
remote: opensearch
53+
specs:
54+
testcontainers-opensearch (0.1.0)
55+
testcontainers-core (~> 0.1)
56+
5157
PATH
5258
remote: postgres
5359
specs:
@@ -214,6 +220,7 @@ DEPENDENCIES
214220
testcontainers-mongo!
215221
testcontainers-mysql!
216222
testcontainers-nginx!
223+
testcontainers-opensearch!
217224
testcontainers-postgres!
218225
testcontainers-rabbitmq!
219226
testcontainers-redis!

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require "rake/testtask"
66
require "yard"
77
require "standard/rake"
88

9-
MODULES = %w[core mysql redis postgres nginx elasticsearch mariadb mongo redpanda]
9+
MODULES = %w[core mysql redis postgres nginx elasticsearch opensearch mariadb mongo redpanda]
1010

1111
%w[test standard].each do |task_name|
1212
desc "Run #{task_name} task for all projects"

core/lib/testcontainers/docker_container.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,8 @@ def mount_names
818818
# @return [String] The environment variable's value.
819819
# @return [nil] If the environment variable does not exist.
820820
def get_env(key)
821-
env_entry = env.find { |entry| entry.start_with?("#{key}=") }
821+
env_list = env || []
822+
env_entry = env_list.find { |entry| entry.start_with?("#{key}=") }
822823
env_entry&.split("=")&.last
823824
end
824825

module-gen/Gemfile.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ GEM
55

66
PLATFORMS
77
arm64-darwin-21
8+
arm64-darwin-23
89

910
DEPENDENCIES
1011
thor (~> 1.2)

opensearch/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## [Unreleased]
2+
3+
### Added
4+
5+
- Initial release of `testcontainers-opensearch` with an `OpensearchContainer`
6+
configured for single-node development usage.

opensearch/Gemfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
3+
source "https://rubygems.org"
4+
5+
# Specify your gem's dependencies in testcontainers-opensearch.gemspec
6+
gemspec
7+
8+
# Use the latest version of testcontainers-core from the local path
9+
gem "testcontainers-core", path: "../core"

opensearch/Gemfile.lock

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
PATH
2+
remote: ../core
3+
specs:
4+
testcontainers-core (0.2.0)
5+
base64 (~> 0.3)
6+
docker-api (~> 2.4)
7+
java-properties (~> 0.3.0)
8+
9+
PATH
10+
remote: .
11+
specs:
12+
testcontainers-opensearch (0.1.0)
13+
testcontainers-core (~> 0.1)
14+
15+
GEM
16+
remote: https://rubygems.org/
17+
specs:
18+
ast (2.4.3)
19+
base64 (0.3.0)
20+
docker-api (2.4.0)
21+
excon (>= 0.64.0)
22+
multi_json
23+
excon (1.3.0)
24+
logger
25+
faraday (2.14.0)
26+
faraday-net_http (>= 2.0, < 3.5)
27+
json
28+
logger
29+
faraday-net_http (3.4.1)
30+
net-http (>= 0.5.0)
31+
java-properties (0.3.0)
32+
json (2.15.1)
33+
language_server-protocol (3.17.0.5)
34+
lint_roller (1.1.0)
35+
logger (1.7.0)
36+
minitest (5.26.0)
37+
minitest-hooks (1.5.2)
38+
minitest (> 5.3)
39+
multi_json (1.17.0)
40+
net-http (0.6.0)
41+
uri
42+
opensearch-ruby (3.4.0)
43+
faraday (>= 1.0, < 3)
44+
multi_json (>= 1.0)
45+
parallel (1.27.0)
46+
parser (3.3.9.0)
47+
ast (~> 2.4.1)
48+
racc
49+
prism (1.6.0)
50+
racc (1.8.1)
51+
rainbow (3.1.1)
52+
rake (13.3.0)
53+
regexp_parser (2.11.3)
54+
rubocop (1.80.2)
55+
json (~> 2.3)
56+
language_server-protocol (~> 3.17.0.2)
57+
lint_roller (~> 1.1.0)
58+
parallel (~> 1.10)
59+
parser (>= 3.3.0.2)
60+
rainbow (>= 2.2.2, < 4.0)
61+
regexp_parser (>= 2.9.3, < 3.0)
62+
rubocop-ast (>= 1.46.0, < 2.0)
63+
ruby-progressbar (~> 1.7)
64+
unicode-display_width (>= 2.4.0, < 4.0)
65+
rubocop-ast (1.47.1)
66+
parser (>= 3.3.7.2)
67+
prism (~> 1.4)
68+
rubocop-performance (1.25.0)
69+
lint_roller (~> 1.1)
70+
rubocop (>= 1.75.0, < 2.0)
71+
rubocop-ast (>= 1.38.0, < 2.0)
72+
ruby-progressbar (1.13.0)
73+
standard (1.51.1)
74+
language_server-protocol (~> 3.17.0.2)
75+
lint_roller (~> 1.0)
76+
rubocop (~> 1.80.2)
77+
standard-custom (~> 1.0.0)
78+
standard-performance (~> 1.8)
79+
standard-custom (1.0.2)
80+
lint_roller (~> 1.0)
81+
rubocop (~> 1.50)
82+
standard-performance (1.8.0)
83+
lint_roller (~> 1.1)
84+
rubocop-performance (~> 1.25.0)
85+
unicode-display_width (3.2.0)
86+
unicode-emoji (~> 4.1)
87+
unicode-emoji (4.1.0)
88+
uri (1.0.4)
89+
90+
PLATFORMS
91+
arm64-darwin-23
92+
ruby
93+
94+
DEPENDENCIES
95+
minitest (~> 5.0)
96+
minitest-hooks (~> 1.5)
97+
opensearch-ruby (~> 3.0)
98+
rake (~> 13.0)
99+
standard (~> 1.3)
100+
testcontainers-core!
101+
testcontainers-opensearch!
102+
103+
BUNDLED WITH
104+
2.6.9

opensearch/LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2023 Guillermo Iguaran
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

0 commit comments

Comments
 (0)