Skip to content

Commit

Permalink
test: Fix failing tests
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <hatake@calyptia.com>
  • Loading branch information
cosmo0920 committed Nov 20, 2023
1 parent 9947832 commit 94aa9c3
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions test/plugin/test_out_elasticsearch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3603,7 +3603,12 @@ def test_hosts_list
def test_hosts_list_with_existing_connection
stub_elastic_info("https://john:password@host1:443/elastic/")
stub_elastic_info("http://host2")
instance = driver.instance
config = %{
path /default_path
user default_user
password default_password
}
instance = driver(config).instance

assert_equal 2, instance.get_connection_options("https://john:password@host1:443/elastic/,http://host2")[:hosts].length
host1, host2 = instance.get_connection_options("https://john:password@host1:443/elastic/,http://host2")[:hosts]
Expand Down Expand Up @@ -3693,7 +3698,12 @@ def test_hosts_list
end

def test_hosts_list_with_existing_connection
instance = driver.instance
config = %{
path /default_path
user default_user
password default_password
}
instance = driver(config).instance

assert_equal 2, instance.get_connection_options("https://john:password@[2404:7a80:d440:3000:192a:a292:bd7f:ca19]:443/elastic/,http://host2")[:hosts].length
host1, host2 = instance.get_connection_options("https://john:password@[2404:7a80:d440:3000:192a:a292:bd7f:ca19]:443/elastic/,http://host2")[:hosts]
Expand Down Expand Up @@ -3759,7 +3769,11 @@ def test_single_host_params_and_defaults
end

def test_single_existing_connection
instance = driver.instance
config = %{
user john
password doe
}
instance = driver(config).instance

assert_equal 1, instance.get_connection_options("logs.google.com")[:hosts].length
host1 = instance.get_connection_options("logs.google.com")[:hosts][0]
Expand Down Expand Up @@ -3827,6 +3841,10 @@ def test_single_host_params_and_defaults
end

def test_single_existing_connection
config = %{
user john
password doe
}
instance = driver(config).instance

assert_equal 1, instance.get_connection_options("2404:7a80:d440:3000:192a:a292:bd7f:ca19")[:hosts].length
Expand Down

0 comments on commit 94aa9c3

Please sign in to comment.