Skip to content

Commit

Permalink
Ignored mulTree actual runnings (conflicts with Travis)
Browse files Browse the repository at this point in the history
  • Loading branch information
TGuillerme committed Jan 22, 2016
1 parent 9e9ba02 commit 3d240ab
Showing 1 changed file with 31 additions and 27 deletions.
58 changes: 31 additions & 27 deletions tests/testthat/test-mulTree.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,33 +95,37 @@ test_that("Quick mulTree example works", {
#Priors are not a lits
expect_error(mulTree(mulTree.data, formula = var1 ~ var2, parameters = c(10000, 10, 1000), chains = 2, prior = 1, output = "quick_example", convergence = 1.1, ESS = 100))

#First example works
set.seed(1)
mulTree_test1 <- system.time(mulTree(mulTree.data, formula = var1 ~ var2, parameters = c(100, 10, 10), chains = 2, prior = priors, output = "mulTree_testing", verbose = FALSE))
#Generates 9 files
expect_equal(length(list.files(pattern = "mulTree_testing")), 9)
expect_equal(length(list.files(pattern = "mulTree_testing-tree1_chain")), 2)
expect_equal(length(list.files(pattern = "mulTree_testing-tree2_chain")), 2)
expect_equal(length(list.files(pattern = "mulTree_testing-tree3_chain")), 2)
expect_equal(length(list.files(pattern = "mulTree_testing-tree1_conv")), 1)
expect_equal(length(list.files(pattern = "mulTree_testing-tree2_conv")), 1)
expect_equal(length(list.files(pattern = "mulTree_testing-tree3_conv")), 1)
#File remove successful
expect_true(all(file.remove(list.files(pattern = "mulTree_testing"))))
#
# Does not run on Travis!
#

# #First example works
# set.seed(1)
# mulTree_test1 <- system.time(mulTree(mulTree.data, formula = var1 ~ var2, parameters = c(100, 10, 10), chains = 2, prior = priors, output = "mulTree_testing", verbose = FALSE))
# #Generates 9 files
# expect_equal(length(list.files(pattern = "mulTree_testing")), 9)
# expect_equal(length(list.files(pattern = "mulTree_testing-tree1_chain")), 2)
# expect_equal(length(list.files(pattern = "mulTree_testing-tree2_chain")), 2)
# expect_equal(length(list.files(pattern = "mulTree_testing-tree3_chain")), 2)
# expect_equal(length(list.files(pattern = "mulTree_testing-tree1_conv")), 1)
# expect_equal(length(list.files(pattern = "mulTree_testing-tree2_conv")), 1)
# expect_equal(length(list.files(pattern = "mulTree_testing-tree3_conv")), 1)
# #File remove successful
# expect_true(all(file.remove(list.files(pattern = "mulTree_testing"))))

#Second example (parallel) works
set.seed(1)
mulTree_test2 <- system.time(mulTree(mulTree.data, formula = var1 ~ var2, parameters = c(100, 10, 10), chains = 2, prior = priors, output = "mulTree_testing", parallel = "SOCK", verbose = FALSE))
#Generates 9 files
expect_equal(length(list.files(pattern = "mulTree_testing")), 9)
expect_equal(length(list.files(pattern = "mulTree_testing-tree1_chain")), 2)
expect_equal(length(list.files(pattern = "mulTree_testing-tree2_chain")), 2)
expect_equal(length(list.files(pattern = "mulTree_testing-tree3_chain")), 2)
expect_equal(length(list.files(pattern = "mulTree_testing-tree1_conv")), 1)
expect_equal(length(list.files(pattern = "mulTree_testing-tree2_conv")), 1)
expect_equal(length(list.files(pattern = "mulTree_testing-tree3_conv")), 1)
#File remove successful
expect_true(all(file.remove(list.files(pattern = "mulTree_testing"))))
# Timer test
# #Second example (parallel) works
# set.seed(1)
# mulTree_test2 <- system.time(mulTree(mulTree.data, formula = var1 ~ var2, parameters = c(100, 10, 10), chains = 2, prior = priors, output = "mulTree_testing", parallel = "SOCK", verbose = FALSE))
# #Generates 9 files
# expect_equal(length(list.files(pattern = "mulTree_testing")), 9)
# expect_equal(length(list.files(pattern = "mulTree_testing-tree1_chain")), 2)
# expect_equal(length(list.files(pattern = "mulTree_testing-tree2_chain")), 2)
# expect_equal(length(list.files(pattern = "mulTree_testing-tree3_chain")), 2)
# expect_equal(length(list.files(pattern = "mulTree_testing-tree1_conv")), 1)
# expect_equal(length(list.files(pattern = "mulTree_testing-tree2_conv")), 1)
# expect_equal(length(list.files(pattern = "mulTree_testing-tree3_conv")), 1)
# #File remove successful
# expect_true(all(file.remove(list.files(pattern = "mulTree_testing"))))
# # Timer test

})

0 comments on commit 3d240ab

Please sign in to comment.