Generates and writes the unit tests to the path (defined when constructing the Generator) based on the passed DataFrames.
Generates and writes the unit tests to the path (defined when constructing the Generator) based on the passed DataFrames.
The name of the component (used for the file name and object call)
All the DataFrames used as an input for the component
The names of the ports for each input DataFrame
All the DataFrames returned as an output for the component
The names of the ports for each output DataFrame
Generates and writes the unit tests to the path (defined when constructing the Generator) based on the passed DataFrames.
Generates and writes the unit tests to the path (defined when constructing the Generator) based on the passed DataFrames. This automatically guesses the port names (in, out1, out2, etc) and applies the limits on each input and output DataFrame.
The name of the component (used for the file name and object call)
All the DataFrames used as an input for the component
All the DataFrames returned as an output for the component
Optional limit on the number of sample input & output rows
Path where all the generated unit tests (both json and scala) are saved
(Since version ) see corresponding Javadoc for more information.
Unit tests generator, generates scalatest's in the Prophecy format for the given component and some input and output DataFrames.
Note that, for the generated unit tests to be correct, this code should be executed on the gold standard datasets.
Example usage:
The above sets up a typical spark graph with additional calls to the UnitTestsGenerator#generateUnitTests method, which executes the spark workflow for the given inputs & outputs and writes the unit tests.
TODO: To increase the performance and reduce the number of spark actions being executed, we can upgrade this to a new Logical Plan operator (similarly like our org.apache.spark.sql.InterimExec). However, due the tests being executed only on a very limited amount of data, for now this should not cause significant performance degradation.