Skip to content

Commit

Permalink
[Truffle] Check out test port before running integration or gem tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Sep 29, 2016
1 parent 439882b commit 2d40fd5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tool/jt.rb
Expand Up @@ -875,6 +875,16 @@ def test_report(component)
sh 'ant', '-f', 'spec/truffle/buildTestReports.xml'
end
private :test_cexts

def check_test_port
lsof = `lsof -i :14873`
unless lsof.empty?
STDERR.puts 'Someone is already listening on port 14873 - our tests can\'t run'
STDERR.puts lsof
exit 1
end
end
private :check_test_port

def test_integration(env={}, *args)
env_vars = env
Expand All @@ -897,6 +907,7 @@ def test_integration(env={}, *args)
test_names = single_test ? '{' + args.join(',') + '}' : '*'

Dir["#{tests_path}/#{test_names}.sh"].sort.each do |test_script|
check_test_port
sh env_vars, test_script
end
end
Expand All @@ -919,6 +930,7 @@ def test_gems(env={}, *args)

Dir["#{tests_path}/#{test_names}.sh"].sort.each do |test_script|
next if test_script.end_with?('/install-gems.sh')
check_test_port
sh env_vars, test_script
end
end
Expand Down

0 comments on commit 2d40fd5

Please sign in to comment.