Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/0xdata/h2o
Browse files Browse the repository at this point in the history
  • Loading branch information
dearirenelang committed May 15, 2014
2 parents 81ded95 + 67a420a commit 5f9dca5
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 13 deletions.
60 changes: 60 additions & 0 deletions R/tests/testdir_munging/exec/runit_NOPASS_pub-691.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f")))
source('../../findNSourceUtils.R')

# use this for interactive setup
# library(h2o)
# library(testthat)
# h2o.setLogPath(getwd(), "Command")
# h2o.setLogPath(getwd(), "Error")
# h2o.startLogging()
# conn = h2o.init()

test.cbind <- function(conn) {

a = c(0,0,0)
b = a
h = cbind(a,b)
a.h2o <- c(0,0,0)
b.h2o = a.h2o
h.h2o = cbind(a.h2o,b.h2o)
h.h2o.R = as.matrix(h.h2o)
expect_that(all(h == h.h2o.R), equals(T))


a = c(0,0,0)
b = c(0,0,0)
h = cbind(a,b)
a.h2o = c(0,0,0)
b.h2o = c(0,0,0)
h.h2o = cbind(a.h2o,b.h2o)
h.h2o.R = as.matrix(h.h2o)
expect_that(all(h == h.h2o.R), equals(T))


h <- cbind(c(0,0,0), c(1,1,1))
a=c(0,0,0); b=c(0,0,0); d=c(0,0,0); e=c(0,0,0); f=c(0,0,0); g= c(0,0,0);
b=a; d=a; f=a; g=a;
h <- cbind(a, b)
h <- cbind(a, b, d)
h <- cbind(a, b, d, e)
h <- cbind(a, b, d, e, f)
h <- cbind(a, b, d, e, f, g)
h.h2o <- cbind(c(0,0,0), c(1,1,1))
a.h2o=c(0,0,0); b.h2o=c(0,0,0); d.h2o=c(0,0,0); e.h2o=c(0,0,0); f.h2o=c(0,0,0); g.h2o= c(0,0,0);
b.h2o=a.h2o; d.h2o=a.h2o; f.h2o=a.h2o; g.h2o=a.h2o;
h.h2o <- cbind(a.h2o, b.h2o)
h.h2o <- cbind(a.h2o, b.h2o, d.h2o)
h.h2o <- cbind(a.h2o, b.h2o, d.h2o, e.h2o)
h.h2o <- cbind(a.h2o, b.h2o, d.h2o, e.h2o, f.h2o)
h.h2o <- cbind(a.h2o, b.h2o, d.h2o, e.h2o, f.h2o, g.h2o)
h.h2o.R = as.matrix(h.h2o)
expect_that(all(h == h.h2o.R), equals(T))


testEnd()
}

doTest("Test cbind.", test.cbind)


26 changes: 25 additions & 1 deletion py/testdir_single_jvm_fvec/test_exec2_cbind_fail.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,30 @@ def tearDownClass(cls):

def test_exec2_cbind_fail1(self):

for i in range(5):
# execExpr = "a=c(0,0,0); b=c(0,0,0)"
execExpr = "a=c(0,0,0)"
h2e.exec_expr(execExpr=execExpr, timeoutSecs=30)
execExpr = "b = a"
h2e.exec_expr(execExpr=execExpr, timeoutSecs=30)
execExpr = "h <- cbind(a, b)"
h2e.exec_expr(execExpr=execExpr, timeoutSecs=30)

h2o.check_sandbox_for_errors()

def test_exec2_cbind_fail2(self):

for i in range(5):
execExpr = "a=c(0,0,0); b=c(0,0,0)"
h2e.exec_expr(execExpr=execExpr, timeoutSecs=30)
execExpr = "h <- cbind(a, b)"
h2e.exec_expr(execExpr=execExpr, timeoutSecs=30)

h2o.check_sandbox_for_errors()


def test_exec2_cbind_fail3(self):

for i in range(5):
execExpr = "h <- cbind(c(0,0,0), c(1,1,1))"
h2e.exec_expr(execExpr=execExpr, timeoutSecs=30)
Expand All @@ -43,7 +67,7 @@ def test_exec2_cbind_fail1(self):

h2o.check_sandbox_for_errors()

def test_exec2_cbind_fail2(self):
def test_exec2_cbind_fail4(self):

for i in range(5):
execExpr = "b=c(0,0,0,0,0,0,0,0,0,0,0,0)"
Expand Down
20 changes: 8 additions & 12 deletions py/testdir_single_jvm_fvec/test_exec2_rep_len.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ def setUpClass(cls):
SEED = h2o.setup_random_seed()
localhost = h2o.decide_if_localhost()
if (localhost):
h2o.build_cloud(1)
h2o.build_cloud(1, java_heap_GB=12)
else:
h2o_hosts.build_cloud_with_hosts(1)
h2o_hosts.build_cloud_with_hosts(1, java_heap_GB=12)

@classmethod
def tearDownClass(cls):
Expand All @@ -24,18 +24,14 @@ def test_exec2_rep_len(self):

for i in range(5):
# have to make sure they're created as keys for reuse between execs
execExpr = "a=rep_len(0,10)"
h2e.exec_expr(execExpr=execExpr, timeoutSecs=30)
execExpr = "a=rep_len(0,1000000000); b = runif(a,-1)"
h2e.exec_expr(execExpr=execExpr, timeoutSecs=180)
execExpr = "b=a; d=a; f=a; g=a;"
h2e.exec_expr(execExpr=execExpr, timeoutSecs=30)
execExpr = "j <- c(a, b)"
h2e.exec_expr(execExpr=execExpr, timeoutSecs=30)
execExpr = "j <- c(b, d)"
h2e.exec_expr(execExpr=execExpr, timeoutSecs=30)
execExpr = "j <- c(a, b, d)"
h2e.exec_expr(execExpr=execExpr, timeoutSecs=30)
h2e.exec_expr(execExpr=execExpr, timeoutSecs=180)
execExpr = "h <- cbind(a ,b)"
h2e.exec_expr(execExpr=execExpr, timeoutSecs=180)
execExpr = "h <- cbind(a ,b, d)"
h2e.exec_expr(execExpr=execExpr, timeoutSecs=30)
h2e.exec_expr(execExpr=execExpr, timeoutSecs=180)

h2o.check_sandbox_for_errors()

Expand Down

0 comments on commit 5f9dca5

Please sign in to comment.