Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e7de8e7

Browse filesBrowse files
committed
Setup test hosts for connection caching
1 parent 2b80058 commit e7de8e7
Copy full SHA for e7de8e7

File tree

Expand file treeCollapse file tree

2 files changed

+11
-13
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-13
lines changed

‎.travis.yml

Copy file name to clipboardExpand all lines: .travis.yml
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ env:
77
- TESTENV=openldap
88
- TESTENV=apacheds
99

10+
# https://docs.travis-ci.com/user/hosts/
11+
addons:
12+
hosts:
13+
- ad1.ghe.dev
14+
- ad2.ghe.dev
15+
1016
install:
1117
- if [ "$TESTENV" = "openldap" ]; then ./script/install-openldap; fi
1218
- bundle install

‎test/connection_cache_test.rb

Copy file name to clipboardExpand all lines: test/connection_cache_test.rb
+5-13Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,16 @@
22

33
class GitHubLdapConnectionCacheTestCases < GitHub::Ldap::Test
44

5-
def options
6-
{
7-
admin_user: "uid=admin,dc=github,dc=com",
8-
admin_password: "passworD1",
9-
port: 389
10-
}
11-
end
12-
135
def test_returns_cached_connection
14-
conn1 = GitHub::Ldap::ConnectionCache.get_connection(options.merge(:host => "ghe.gh"))
15-
conn2 = GitHub::Ldap::ConnectionCache.get_connection(options.merge(:host => "ghe.gh"))
6+
conn1 = GitHub::Ldap::ConnectionCache.get_connection(options.merge(:host => "ad1.ghe.dev"))
7+
conn2 = GitHub::Ldap::ConnectionCache.get_connection(options.merge(:host => "ad1.ghe.dev"))
168
assert_equal conn1.object_id, conn2.object_id
179
end
1810

1911
def test_creates_new_connections_per_host
20-
conn1 = GitHub::Ldap::ConnectionCache.get_connection(options.merge(:host => "ghe.gh"))
21-
conn2 = GitHub::Ldap::ConnectionCache.get_connection(options.merge(:host => "ghe.dev"))
22-
conn3 = GitHub::Ldap::ConnectionCache.get_connection(options.merge(:host => "ghe.dev"))
12+
conn1 = GitHub::Ldap::ConnectionCache.get_connection(options.merge(:host => "ad1.ghe.dev"))
13+
conn2 = GitHub::Ldap::ConnectionCache.get_connection(options.merge(:host => "ad2.ghe.dev"))
14+
conn3 = GitHub::Ldap::ConnectionCache.get_connection(options.merge(:host => "ad2.ghe.dev"))
2315
refute_equal conn1.object_id, conn2.object_id
2416
assert_equal conn2.object_id, conn3.object_id
2517
end

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.