/
The testing environment

The testing environment

Rationale

Code executed in R requires an environment, that manages the variables and R object used during execution. The latter is a data structure that provides the R programmer the ability to scope. Scoping makes available some variables visible from one element to another.

Test_that uses its own environment, that differs from the .GlobalEnv environment. The latter is used by default, when some R scripts and notebooks are interpreted and executed by R. By initialising, managing and clearing a new environment, then the DataSHIELD testing framework can provide all the tools and support every developer to write some tests. Also, any connections to an Opal server can be managed from the start to the end of some execution of tests.

ds.test_env environment

During its initialisation process, DataSHIELD testing framework creates the ds.test_env environment. The latter is destroyed once all the test have been executed. The ds.test_env environment defines the variables listed and described below. Each of them must be referred as ds.test_env$[name.variable].

Connection information

These variables are defined and initialised in the file /test/testthat/connection_to_datasets/login_details.R. These variables are either initialised by the functions named with init at the start (see Connecting to the Testing dataset ) or in the /test/testthat/connection_to_datasets/login_details.R file.

Name of variables

Data Type

Description

Name of variables

Data Type