Skip to content

Commit

Permalink
Added a version copied from h2o-test.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkraljevic committed Jul 5, 2013
1 parent 4d0eca1 commit d4ac874
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions py/test_junit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import os, json, unittest, time, shutil, sys, getpass
import h2o

class TestJUnit(unittest.TestCase):

def testAll(self):
try:
h2o.build_cloud(node_count=2)

# we don't have the port or ip configuration here
# that util/h2o.py does? Keep this in synch with spawn_h2o there.
# also don't have --nosigar here?
(ps, stdout, stderr) = h2o.spawn_cmd('junit', [
'java',
'-Dh2o.arg.ice_root='+h2o.tmp_dir('ice.'),
'-Dh2o.arg.name='+h2o.cloud_name(),
'-Dh2o.arg.ip='+h2o.get_ip_address(),
'-ea', '-jar', h2o.find_file('target/h2o.jar'),
'-mainClass', 'org.junit.runner.JUnitCore',
# The tests
#'hex.GLMGridTest',
'hex.HistogramTest',
'hex.GLMTest',
'hex.KMeansTest',
'hex.MinorityClassTest',
'hex.rf.RandomForestTest',
'hex.rf.RFPredDomainTest',
'water.AtomicTest',
'water.AutoSerialTest',
'water.BitCmpTest',
#'water.ConcurrentKeyTest.java',
'water.KeyToString',
'water.KVTest',
#'water.KVSpeedTest',
'water.api.RStringTest',
'water.exec.ExprTest',
'water.exec.RBigDataTest',
'water.parser.DatasetCornerCasesTest',
'water.parser.ParseCompressedAndXLSTest',
'water.parser.ParseFolderTest',
'water.parser.ParseProgressTest',
'water.parser.ParserTest',
'water.parser.RReaderTest',
'water.score.ScorePmmlTest',
'water.score.ScoreTest'
])

rc = ps.wait(None)
out = file(stdout).read()
err = file(stderr).read()
if rc is None:
ps.terminate()
raise Exception("junit timed out.\nstdout:\n%s\n\nstderr:\n%s" % (out, err))
elif rc != 0:
raise Exception("junit failed.\nstdout:\n%s\n\nstderr:\n%s" % (out, err))

finally:
h2o.tear_down_cloud()


if __name__ == '__main__':
h2o.unit_main()

0 comments on commit d4ac874

Please sign in to comment.