Skip to content

Commit d2065f7

Browse files
committed
Hardcode server options
This is to reduce the variations each test creates, so all tests can pass with the same settings, fixtures.
1 parent 94d5b82 commit d2065f7

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

test/test_helper.rb

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,18 @@ def self.stop_server
2929
end
3030
end
3131

32+
def self.test_server_options
33+
{
34+
custom_schemas: FIXTURES.join('posixGroup.schema.ldif').to_s,
35+
user_fixtures: FIXTURES.join('common/seed.ldif').to_s,
36+
allow_anonymous: true,
37+
verbose: ENV.fetch("VERBOSE", "0") == "1"
38+
}
39+
end
40+
3241
def self.start_server
3342
if test_env == "apacheds"
34-
server_opts = respond_to?(:test_server_options) ? test_server_options : {}
35-
GitHub::Ldap.start_server(server_opts)
43+
GitHub::Ldap.start_server(test_server_options)
3644
end
3745
end
3846

@@ -42,6 +50,8 @@ def options
4250
case self.class.test_env
4351
when "apacheds"
4452
GitHub::Ldap.server_options.merge \
53+
admin_user: 'uid=admin,dc=github,dc=com',
54+
admin_password: 'passworD1',
4555
host: 'localhost',
4656
uid: 'uid',
4757
instrumentation_service: @service
@@ -60,12 +70,6 @@ def options
6070
end
6171

6272
class GitHub::Ldap::UnauthenticatedTest < GitHub::Ldap::Test
63-
def self.start_server
64-
if test_env == "apacheds"
65-
GitHub::Ldap.start_server(:allow_anonymous => true)
66-
end
67-
end
68-
6973
def options
7074
@options ||= begin
7175
super.delete_if {|k, _| [:admin_user, :admin_password].include?(k)}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy