build_test_data: Create unit tests based on a workflow step for an operator

View source: R/test_utils.R

build_test_dataR Documentation

Create unit tests based on a workflow step for an operator

Description

Based on the output table and input projection from an operator, builds the necessary files for a test case.

Usage

build_test_data(
  res_table,
  ctx,
  test_name,
  test_folder = NULL,
  version = "",
  absTol = NULL,
  relTol = NULL,
  r2 = NULL,
  gen_schema = FALSE,
  skipCols = c(),
  props = c(),
  forcejoincol = NULL,
  forcejoinrow = NULL
)

Arguments

ctx

Tercen context.

test_name

Name identifying the test.

test_folder

Path where test files are stored.

version

Corresponding operator version when test was created.

absTol

Absolute tolerance parameter.

relTol

Relative tolerance parameter.

r2

Squared correlation parameter.

gen_schema

Should schema files for output tabls be generated default: FALSE

skipCols

Column names (without namespace) to be skipped during comparisons.

props

Array containing properties to be set for specific stepIds.

forcejoincol

Logical array matching num. of out_table to force relation to column (when join was not made through .ci).

forcejoinrow

Logical array matching num. of out_table to force relation to row (when join was not made through .ri).

out_table

operator output table with namespace

Examples

build_test_data( tbl, ctx, paste0(step_name, "_absTol"),
version = '0.0.1',
absTol = 0.001)

build_test_data( tbl, ctx, paste0(step_name, "_absTol"),
version = '0.0.1',
absTol = 0.001,
forcejoincol = c(TRUE, FALSE))

tercen/tim documentation built on May 3, 2023, 10:43 p.m.