Skip to content

Commit 017d7c5

Browse files
committed
blurt less in tests
logging, progess bars, and the java heap message are all suppressed by setting options at the start of each test. This only works if the test is run in a fresh session, before the JVM is loaded (sigh)
1 parent 2f27dc7 commit 017d7c5

12 files changed

+37
-0
lines changed

tests/testthat/test-align.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
context("model alignment")
22

33
library(dplyr)
4+
options(java.parameters="-Xmx2g",
5+
dfrtopics.mallet_logging="none",
6+
dplyr.show_progress=FALSE)
47

58
# run a scrap model: we're just doing manipulation here, not worrying
69
# about quality

tests/testthat/test-browser_export.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ context("dfr-browser export")
22

33
library(dplyr)
44
library(Matrix)
5+
options(java.parameters="-Xmx2g",
6+
dfrtopics.mallet_logging="none",
7+
dplyr.show_progress=FALSE)
8+
59

610
clear_files <- function (fs, ...) {
711
for (f in fs) {

tests/testthat/test-diagnostics.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
context("MALLET diagnostics")
2+
options(java.parameters="-Xmx2g",
3+
dfrtopics.mallet_logging="none",
4+
dplyr.show_progress=FALSE)
25

36
# run a scrap model: we're just doing manipulation here, not worrying
47
# about quality

tests/testthat/test-foreign.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
context("Using models from other packages")
2+
options(java.parameters="-Xmx2g",
3+
dfrtopics.mallet_logging="none",
4+
dplyr.show_progress=FALSE)
25

36
clear_files <- function (fs, ...) {
47
for (f in fs) {

tests/testthat/test-inferencer.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
context("Topic inference support")
2+
options(java.parameters="-Xmx2g",
3+
dfrtopics.mallet_logging="none",
4+
dplyr.show_progress=FALSE)
25

36
data_dir <- file.path(path.package("dfrtopics"),
47
"test-data", "pmla-modphil1905-1915")

tests/testthat/test-loading.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
context("writing/loading model output files")
2+
options(java.parameters="-Xmx2g",
3+
dfrtopics.mallet_logging="none",
4+
dplyr.show_progress=FALSE)
25

36
out_dir <- file.path(tempdir(), "test-loading")
47
if (!file.exists(out_dir)) {

tests/testthat/test-mi.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
context("Mutual Information")
2+
options(java.parameters="-Xmx2g",
3+
dfrtopics.mallet_logging="none",
4+
dplyr.show_progress=FALSE)
25

36
# 5 vectors summing to 1
47
p <- t(rmultinom(5, 100, runif(8)) / 100)

tests/testthat/test-model_documents.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
context("Modeling")
2+
options(java.parameters="-Xmx2g",
3+
dfrtopics.mallet_logging="none",
4+
dplyr.show_progress=FALSE)
25

36
data_dir <- file.path(path.package("dfrtopics"),
47
"test-data", "pmla-modphil1905-1915")

tests/testthat/test-model_info.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
context("Model inspection with topic info functions")
2+
options(java.parameters="-Xmx2g",
3+
dfrtopics.mallet_logging="none",
4+
dplyr.show_progress=FALSE)
25

36
# construct a dummy trial model. We're not going for quality here,
47
# since this is just to check that all the formatters and extractors

tests/testthat/test-plots.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
context("Plot utilities")
2+
options(java.parameters="-Xmx2g",
3+
dfrtopics.mallet_logging="none",
4+
dplyr.show_progress=FALSE)
25

36
data_dir <- file.path(path.package("dfrtopics"),
47
"test-data", "pmla-modphil1905-1915")

0 commit comments

Comments
 (0)