Skip to content

Commit

Permalink
adding *conditional tests* through environment variables COVID19ANALY…
Browse files Browse the repository at this point in the history
…TICS = "full.test"
  • Loading branch information
mponce0 committed Mar 23, 2021
1 parent 8d4f031 commit 8500dc5
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion tests/testthat/test_examples.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,25 @@ test_that("integrity/consistency", {

#####################################################################

##### CONTIONAL TESTS ####### ==> to reduce testing time
# flag to control how many test need to be run...
# using *either*
# an OS enviroment variable COVID19ANALYTICS = "full.test"
# OR
# an R variable covid19analytics.testing = "full.test"

# check OS environment variable
c19fulltest_OS <- Sys.getenv("COVID19ANALYTICS")=="full.test"
# check R enviroment variable
c19fulltest_R <- ( ("covid19analytics.testing" %in% ls()) && (covid19analytics.testing == "full.test") )

message(c19fulltest_OS)
message(c19fulltest_R)

# check if the fulltest flags were activated...
if (c19fulltest_OS | c19fulltest_R) {

message("Running FULL batery of TEST for covid19.analytics...")

### TOTS.PER.LOCATION()

Expand All @@ -98,7 +117,6 @@ test_that("TOTS.PER.LOCATION fn", {
#pdf(paste0("Japan_",i.case,".pdf"))
expect_invisible(tots.per.location(all.data,"Japan"))
#dev.off()

}
})

Expand Down Expand Up @@ -192,6 +210,7 @@ world.SIR.model <- generate.SIR.model(data,"ALL", t0=1,t1=15, tot.population=7.8
plt.SIR.model(world.SIR.model,"World",interactiveFig=FALSE,fileName="world.SIR.model")


}

####
# clean up
Expand Down

0 comments on commit 8500dc5

Please sign in to comment.