You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by "Adam J. Shook" <ad...@gmail.com> on 2017/10/02 14:44:15 UTC

Re: Template Test Harness?

Thanks, Andy.  This is kind of what I had in mind, but having some tool
where you could configure a test for a template and it would handle
uploading the template, creating/wiring the input/output processors and do
the validation.  Looks like Matt has started down this road with the
ExecuteScript processor -- I'll update the group with whatever we end up
with.

Thanks again,
--Adam

On Fri, Sep 29, 2017 at 6:34 PM, Andy LoPresto <al...@apache.org> wrote:

> Adam,
>
> It might sound crazy but I would actually suggest doing this inside
> another NiFi flow (cue the Inception drone sound). Place the components
> under test inside a process group with an input and output port, and in the
> parent group, use GenerateFlowFile or GetFile to supply known data to the
> input port. Then take the data coming from the output port and verify it
> using ValidateRecord, RouteOnAttribute, FuzzyHashContent, etc. Once you
> have the flow verified, you can simply export the process group as your
> template. With the existing parent flow, you can also drag on new templates
> into a PG and connect the input(s) (test fixtures) and output(s)
> (verifiers) to make this fairly quick.
>
> As far as automating it programmatically, I don’t have a great suggestion
> here but I know Matt Burgess has done work on a unit tester [1] for the
> scripts used by ExecuteScript, which isn’t quite the same but might be a
> good starting point.
>
> Any insights you gain would certainly be welcomed by the community.
> Thanks.
>
> [1] https://funnifi.blogspot.com/2016/06/testing-executescript-processor-
> scripts.html
>
>
> Andy LoPresto
> alopresto@apache.org
> *alopresto.apache@gmail.com <al...@gmail.com>*
> PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69
>
> On Sep 29, 2017, at 8:19 AM, Adam J. Shook <ad...@gmail.com> wrote:
>
> Hello all,
>
> I am curious if anyone has done any work/design around creating a harness
> for testing templates?  I'm looking for a (relatively) easy way to create a
> template within NiFi, export it, and have some unit-test-like functionality
> for validating output based on different types of input -- clean data,
> malformed data, wrong schema, etc.  Integration with other tools like Kafka
> is extra credit.  I feel like this could be an interesting use case for
> MiNiFi.
>
> Thank you,
> --Adam
>
>
>