LineaLabs / lineapy

Move fast from data science prototype to pipeline. Capture, analyze, and transform messy notebooks into data pipelines with just two lines of code.
https://lineapy.org
Apache License 2.0
662 stars 58 forks source link

Change snapshotting and e2e tests for pipelines #830

Closed andycui97 closed 1 year ago

andycui97 commented 1 year ago

Description

Changes to pipeline tests.

Originallytests/test_pipeline_run_airflow.py and tests/test_pipeline_run_script.py tested our pipeline generation "end to end" by grabbing the expected files and running them. This test is now changed to generate the pipeline files and test if they run in the same test.

Originally tests/test_writer.py simply tested to see if the generated files matched the snapshot of the file in expected directory. This made it very difficult to update the expected directory if changes are indeed expected to the snapshots. This has been updated now to use pytest snapshot.

Small changes:

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Ensure new tests pass. Ensure new snapshot tests actually snapshot all the generated files by inspecting contents of tests/unit/plugins/__snapshots__/test_writer.ambr manually.