Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide a Test command to test a step #29

Open
jstrachan opened this issue Jan 13, 2017 · 1 comment
Open

provide a Test command to test a step #29

jstrachan opened this issue Jan 13, 2017 · 1 comment

Comments

@jstrachan
Copy link
Contributor

it would be nice to be able to choose a sample input message and to test out a single step in an existing flow. Eventually we could package this up as a REST API we can use from consoles but starting with a CLI would be great.

e.g. something like:

$ funktion test-step myflow 3 -f sampleMessage.json -oyaml
testing myflow step setHeader:foo=bar
output:
  foo: 1234

Under the covers we'd need to create a new temporary flow for something like:

funktion create flow mytmp http://localhost setHeader:foo=bar

i.e. pull out the step to be tested and add a http endpoint in front. Then the funktion test-step would wait for a pod to start, when its up, POST the sampleMessage.json to the pod's HTTP port and output/save the results (then removing the flow). We could use a temporary namespace for these 'tests' to avoid it confusing end users too?

@jstrachan
Copy link
Contributor Author

jstrachan commented Jan 13, 2017

over time we maybe wanna get more clever, having pools of 'Test flows' pods around that we update on the fly rather than spin up from scratch - as Java + camel can take a while to startup ;)

So we maybe want a way to have single message mode flows that we update the flow, wait for the response, then the pod stays around until we decide to explicitly kill it (to scale down the pool) or replace the flow with a new step to test.

e.g. if you set the singleMessageMode: true on a flow it will only process 1 message then stop. So we can then just find a pod thats finished; update its flow.yml, fire in a new message and wait for the result.

Another option is to put the sample message into some canonical place (a message store - such as the content-repository HTTP server we use for hosting build maven websites) - then the flow consumes from that URL and posts the results to some place and just poll for the result from the CLI - then we don't need to worry about watching the pod is ready to know if its ready for POSTing to?

It may be simplest to POST to a HTTP endpoint inside the 'test pods', the sample message and the flow and for the HTTP response to come back with the result message? Then we just need a special HTTP connector in the test pods we can use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant