nifikop
nifikop copied to clipboard
[NiFiDataflowTest] Extends Operator to manage Flow test validation
From nifikop created by erdrix: Orange-OpenSource/nifikop#115
Feature Request
Is your feature request related to a problem? Please describe.
There is no way to automate NiFi datafllow validation test.
Describe the solution you'd like to see
Define a resource like NifiDataflowFunctionalTest
to define a list of test to play.
Something like :
nifiDataflowTest:
nifiDataflowRef: NifiDataflowSpec
inputsData:
- content: string
attributes: map[string]string
injectComponentRef: string
checkAssertions:
- connectionRef: string
content:
kind: [exactlyMatch | regexMatch]
value: string
attributes: map[string]{kind: [exactlyMatch | regexMatch], value: string}
disableComponentRefs: list(string)
With a logic :
- Deploy the nifi flow specified in the
nifiDataflowTest.nifiDataflowRef
, - Disable all components referenced in
nifiDataflowTest.disableComponentRefs
, - Stop all components with an incoming connection listed in
nifiDataflowTest.checkAssertions[*].connectionRef
, - Create a
GenerateFlowfile
for each elements ofnifiDataflowTest.inputsData
and create a connection to the component referenced innifiDataflowTest.inputsData[*].injectComponentRef
- Then start all the other components,
- check, for all elements of
nifiDataflowTest.checkAssertions[*].connectionRef
,if the connection contains an element, if so, compare the content and attributes of the flowfile with the associated. assertion If it doesn't match = Test failed, if it does match, start the output component of the connection. And this until one assertion fails or all assertions have