Skip to main content

validate_unit_test

Function validate_unit_test 

Source
pub(super) fn validate_unit_test(
    test: &UnitTest,
    target_id: &ObjectId,
    get_columns: &dyn Fn(&ObjectId) -> Option<BTreeMap<String, ColumnType>>,
    dependencies: &BTreeSet<ObjectId>,
) -> Result<(), TestValidationError>
Expand description

Validate a unit test against the known types.

This function performs three validations:

  1. All dependencies of the target view are mocked
  2. Each mock’s columns match the actual schema of the mocked object
  3. The expected output columns match the target view’s output schema

§Arguments

  • test - The unit test to validate
  • target_id - The ObjectId of the target view
  • get_columns - Lookup for the column schema of an object, sourced from types.lock (external) and the build artifact database (internal)
  • dependencies - Dependencies of the target view from the project’s dependency graph