-
Notifications
You must be signed in to change notification settings - Fork 5
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
Added a bot test mode #2
base: master
Are you sure you want to change the base?
Conversation
I'll need more background here certainly. Can you provide an example of how this feature would be used. If something needed to tweak or consolidate payload depending on HTTP Headers, I would opt for a proxy architecture, such as the one I created for the webhook-affinity proxy If a bot test framework was to be built, I would suggest to add an instrumentation mode (which is certainly close to the BOT_UNDER_TEST env proposed here), so that the emulator would send real-time notifications, or may be add some kind of "monitor feature" like Spark has for Cisco internal needs. Again let's start from a sample of what needs to be achieved. |
Here's a project with an example: https://github.com/jpjpjp/bot-test-framework-example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I finally got more time to dig into this PR
Now looking at the best way to integrate 3rd party middleware to the emulator, so that the bot-test tool could integrate incremental updates & fixes from the emulator.
I see 2 possible approaches:
- the emulator is turned to a library, and delivered to npm
- or a dynamically loaded middleware strategy is added (similarly to the botkit-template with plugins support: https://github.com/CiscoDevNet/botkit-template/tree/plugin)
Note: I've integrated the non bot-test related parts of the PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About:
POST /messages create a new message.
I am not getting this mention, since this is not a Webex feature. If it something specific to the bot-test module ?
If the payload includes a personId, will create a new one on one space if one does not already exist. (personEmail not yet supported)
Added the ability to run the emulator in "bot test mode" if the environment BOT_UNDER_TEST is set to an email of one of the identities specified in tokens.json. When this occurs the emulator will intercept responses sent to test requests that have an X-Bot-Responses header. It will wait until it gets requests from the BOT_UNDER_TEST and build a consolidate response body so that that a test framework can inspect the bot requests that were generated in response to any given test input.