cli icon indicating copy to clipboard operation
cli copied to clipboard

omg run should be able to use a running container

Open wilzbach opened this issue 6 years ago • 5 comments

This is very useful for testing subscriptions.

  1. Set up event listener
omg subscribe listen events -a eventName='heartbeat'
  1. Send events
omg run publish -a eventName=heartbeat -a data='{"time":"foo"}'

Currently this spawns a new docker container and there's no option to use an existing one.

wilzbach avatar Apr 06 '19 17:04 wilzbach

Similarly, it would be helpful if omg subscribe could attach to a running container too, s.t. we can easily test multiple subscribe endpoints.

wilzbach avatar Apr 06 '19 18:04 wilzbach

For clarification, imagine if someone specifies different env variables in both omg invocations, do we still re-use?

ghost avatar Oct 07 '19 03:10 ghost

I think for now it's okay to error when the user specified different environment variables in the omg run publishcommand.

wilzbach avatar Oct 07 '19 04:10 wilzbach

Bumping the priority here as there's no (easy) way without this to test OMS events. Even for our templates we had to add fake events to be able to test them:

https://github.com/microservices/node-events/blob/51f7c6b468bcd64d6c6d37722e466cf2b83663cc/src/index.js#L113-L119

wilzbach avatar Oct 29 '19 14:10 wilzbach

Related issue: https://github.com/microservices/oms/issues/183 (no validation of received events)

wilzbach avatar Oct 30 '19 05:10 wilzbach