Skip to content

Commit 09c6c06

Browse files
committed
OTWO-4281 Configured travis ssh setup and its dependencies
1 parent d44618b commit 09c6c06

File tree

10 files changed

+36
-27
lines changed

10 files changed

+36
-27
lines changed

.travis.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
language: ruby
2+
env:
3+
- TRAVIS_CONFIG_DIR=.travis
24
before_install:
3-
- sh .install_multiple_scms.sh
5+
- cd $TRAVIS_CONFIG_DIR
6+
- sh .travis_ssh_setup.sh
47
install:
5-
- gem install posix-spawn
8+
- sh .install_multiple_scms.sh
69
- sh .install_dependencies.sh
10+
- gem install posix-spawn
11+
before_script:
12+
- cd $TRAVIS_BUILD_DIR
File renamed without changes.
File renamed without changes.

.travis/.travis_ssh_setup.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" -q
2+
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
3+
ssh-keyscan -t rsa `hostname` >> ~/.ssh/known_hosts

lib/ohloh_scm/adapters/hglib/cat_file.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module OhlohScm::Adapters
1+
module OhlohScm::Adapters
22
class HglibAdapter < HgAdapter
33

44
def cat_file(commit, diff)

lib/ohloh_scm/adapters/svn/validation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def validate_server_connection
5959
# The current branch_name is overwritten.
6060
def recalc_branch_name
6161
begin
62-
@branch_name = @url ? @url[self.root.length..-1] : @branch_name
62+
@branch_name = @url ? @url[root.length..-1] : @branch_name
6363
rescue RuntimeError => exception
6464
@branch_name = '' if exception.message =~ /(svn:*is not a working copy|Unable to open an ra_local session to URL)/ # we have a file system
6565
end

test/unit/bzr_push_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_local
1717
assert BzrAdapter.new(:url => "src").local?
1818
assert BzrAdapter.new(:url => "/Users/test/src").local?
1919
assert BzrAdapter.new(:url => "file:///Users/test/src").local?
20-
# assert BzrAdapter.new(:url => "bzr+ssh://#{Socket.gethostname}/Users/test/src").local?
20+
assert BzrAdapter.new(:url => "bzr+ssh://#{Socket.gethostname}/Users/test/src").local?
2121
end
2222

2323
def test_path

test/unit/hg_push_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_local
1717
assert HgAdapter.new(:url => "src").local?
1818
assert HgAdapter.new(:url => "/Users/robin/src").local?
1919
assert HgAdapter.new(:url => "file:///Users/robin/src").local?
20-
# assert HgAdapter.new(:url => "ssh://#{Socket.gethostname}/Users/robin/src").local?
20+
assert HgAdapter.new(:url => "ssh://#{Socket.gethostname}/Users/robin/src").local?
2121
end
2222

2323
def test_path

test/unit/svn_pull_test.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ def test_svnadmin_create_local
4646
end
4747
end
4848

49-
# def test_svnadmin_create_remote
50-
# OhlohScm::ScratchDir.new do |dir|
51-
# svn = SvnAdapter.new(:url => "svn+ssh://#{Socket.gethostname}#{dir}")
52-
# svn.svnadmin_create_remote
53-
# assert svn.exist?
54-
# assert FileTest.exist?(File.join(dir, 'hooks', 'pre-revprop-change'))
55-
# assert FileTest.executable?(File.join(dir, 'hooks', 'pre-revprop-change'))
56-
# svn.run File.join(dir, 'hooks', 'pre-revprop-change')
57-
# end
58-
# end
49+
def test_svnadmin_create_remote
50+
OhlohScm::ScratchDir.new do |dir|
51+
svn = SvnAdapter.new(:url => "svn+ssh://#{Socket.gethostname}#{dir}")
52+
svn.svnadmin_create_remote
53+
assert svn.exist?
54+
assert FileTest.exist?(File.join(dir, 'hooks', 'pre-revprop-change'))
55+
assert FileTest.executable?(File.join(dir, 'hooks', 'pre-revprop-change'))
56+
svn.run File.join(dir, 'hooks', 'pre-revprop-change')
57+
end
58+
end
5959
end
6060
end

test/unit/svn_push_test.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@ def test_basic_push_using_svnsync
2121

2222
# Triggers the "ssh" code path by using svn+ssh:// protocol instead of file:// protocol.
2323
# Simulates pushing to another server in our cluster.
24-
# def test_ssh_push_using_svnsync
25-
# with_svn_repository('svn') do |src|
26-
# OhlohScm::ScratchDir.new do |dest_dir|
24+
def test_ssh_push_using_svnsync
25+
with_svn_repository('svn') do |src|
26+
OhlohScm::ScratchDir.new do |dest_dir|
2727

28-
# dest = SvnAdapter.new(:url => "svn+ssh://#{Socket.gethostname}#{File.expand_path(dest_dir)}").normalize
29-
# assert !dest.exist?
28+
dest = SvnAdapter.new(:url => "svn+ssh://#{Socket.gethostname}#{File.expand_path(dest_dir)}").normalize
29+
assert !dest.exist?
3030

31-
# src.push(dest)
32-
# assert dest.exist?
31+
src.push(dest)
32+
assert dest.exist?
3333

34-
# assert_equal src.log, dest.log
35-
# end
36-
# end
37-
# end
34+
assert_equal src.log, dest.log
35+
end
36+
end
37+
end
3838

3939
end
4040
end

0 commit comments

Comments
 (0)