Skip to content

Test Suite for sdf-tests #8

@dbrtly

Description

@dbrtly

Summarize the feature in question.

Professionally test the sdf-tests jinja macros.

  • validate jinja render as intended (and document explicit intentions)
  • validate as sql queries

The sdf tool already excels at validating sql queries are correct, but I don't know how to wire it up.

What team(s) will benefit from this feature request?

Anybody who needs to test the jinja macros. Developer confidence in sdf-labs.

Is this an enhancement to an existing feature? If so, briefly describe the update.

Proposed tasks:

  • Add rust crate "sdf-tests" to the repository

  • add sdf-tests/src/unique.jinja and copy the unique macro to it. Repeat for all the macros in the sdf-tests workspace.

like this example:

https://github.com/mitsuhiko/minijinja/blob/670b67b967f273eab608ef1697e181dd5cfdc787/minijinja/tests/inputs/hello.txt

  • in rust-project/tests/test_templates.rs, create a test harness inspired by this file (especially test_single at line 230)
    https://github.com/mitsuhiko/minijinja/blob/670b67b967f273eab608ef1697e181dd5cfdc787/minijinja/tests/test_templates.rs

  • build the crate

  • migrate test.jinja in the sdf project to 1 jinja file per macro

  • add a build script that exports from the txt files to jinja files in the sdf project. Are post-test scripts a thing in Cargo?

  • enhance the github workflow by adding a new step/s between git-clone and sdf-compile:
    -- test the rust crate
    -- run the build script to export the jinja to sdf-workspace.
    -- sdf compile for all supported integration providers?

Describe alternatives you've considered if applicable.

Yee-haw!!

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions