Skip to content

Commit

Permalink
Expose #50
Browse files Browse the repository at this point in the history
  • Loading branch information
richelbilderbeek committed Oct 27, 2019
1 parent 339c2e2 commit c673b28
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions tests/testthat/test-run_beast2_from_options.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,46 @@ test_that("show proper error message when using CBS with too few taxa", {
"'group_sizes_dimension' .* must be less than the number of taxa"
)
})


test_that("BEAST2 freezes when treelog file already exists", {

skip("Issue 50, Issue #50")

if (!is_beast2_installed()) return()

beast2_xml_filename <- tempfile(
pattern = "beast2_", tmpdir = rappdirs::user_cache_dir(),
fileext = ".xml"
)

beautier::create_beast2_input_file_from_model(
input_filename = beautier::get_fasta_filename(),
output_filename = beast2_xml_filename,
inference_model = beautier::create_test_inference_model(
mcmc = beautier::create_test_mcmc(
screenlog = beautier::create_screenlog(filename = "")
)
)
)
testit::assert(file.exists(beast2_xml_filename))

# First run works fine, takes approx 1 sec on my computer
beastier::run_beast2_from_options(
beastier::create_beast2_options(
input_filename = beast2_xml_filename,
overwrite = FALSE,
verbose = TRUE
)
)

# Second run causes BEAST2 to freeze
beastier::run_beast2_from_options(
beastier::create_beast2_options(
input_filename = beast2_xml_filename,
overwrite = FALSE,
verbose = TRUE
)
)

})

2 comments on commit c673b28

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R/create_temp_output_state_filename.R:2:20: style: Trailing whitespace is superfluous.

#' stores its state 
                   ^

R/create_temp_output_state_filename.R:4:1: style: Variable and function names should not be longer than 30 characters.

create_temp_output_state_filename <- function() {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R/create_temp_output_state_filename.R:2:20: style: Trailing whitespace is superfluous.

#' stores its state 
                   ^

R/create_temp_output_state_filename.R:4:1: style: Variable and function names should not be longer than 30 characters.

create_temp_output_state_filename <- function() {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Please sign in to comment.