-
Notifications
You must be signed in to change notification settings - Fork 40
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
support testing one robot (shared brain) present in multiple rooms #32
Comments
At this time, there is no way to share brain 😢 |
This is something I do as well, but I haven't written tests for my custom scripts yet - in an Enterprise level organization, we have hundreds of rooms our Hubot is in. I've written a few custom scripts to support Authentication based on level of user in a Room, the room a user is in, or the room a request comes from. Ours also provides the ability to message users across rooms by mentioning a nick that's designated to the hubot "i.e. @hubot this room belongs to Perf", then anyone who mentions @Perf the bot will transmit the message to their private room. I'm looking at implementing some custom test scripts this week, I'll let you know what challenges I run into. |
Would also like to do this. I'm testing scripts for a platform with many rooms, where use cases need hubot to remember past interactions and context with a user across rooms. Ran into a wall trying to test some uncommon behaviour for fairly specific interactions. e.g. it should respond to a given user in any room, but not other users - or - it will respond to any user in a given room, but not other rooms. I have similar requirements to this example from Hubot-Conversation but would prefer to find an approach consistent with my other tests using hubot-test-helper. e.g.
I discovered one easy tip for anyone trying this, that the |
Here's a really simple test case: I have a hubot script which can be triggered in any room that the bot is in, and the result is that it should emit a message to a configured target room. Here's the script: https://github.com/18F/18f-bot/blob/master/scripts/love.coffee However, this test case only works because EDITED TO ADD: @timkinnane, I only just noticed |
@yozlet - Cool! You'll be the first user afaik. I think it's pretty good and have used it extensively in my own project. I tried to write clear and comprehensive tests, but I'd be really interested to get your feedback - it's easy to miss things when you're the creator and only user. |
We'd like to go forward with the confidence of application keep on working. Ideal situation would be to hold a set of tests, covering each line of code in our system. This however proves to be difficult for different reasons. For instance, I'd like to test that `lit` command when successful would create a message in a separate channel. Sounds simple, yet the hubot testing helper does not support the functionality of multiple rooms. This issue has already been raised with upstream [1] and needs yet to be resolved. In order to keep hubot happy, I had to separate the script tests into a separate directory. In fact, two of them, as I've separated the response messages from script file, to be DRY about it when using in tests. The `.messages.js` file is obsolete and _should_ be removed once we come out with ideal configuration system. I took the lousy approach of implementing tests for the other functions. I'm sorry. [1] mtsmfm/hubot-test-helper#32
We'd like to go forward with the confidence of application keep on working. Ideal situation would be to hold a set of tests, covering each line of code in our system. This however proves to be difficult for different reasons. For instance, I'd like to test that `lit` command when successful would create a message in a separate channel. Sounds simple, yet the hubot testing helper does not support the functionality of multiple rooms. This issue has already been raised with upstream [1] and needs yet to be resolved. In order to keep hubot happy, I had to separate the script tests into a separate directory. In fact, two of them, as I've separated the response messages from script file, to be DRY about it when using in tests. The `.messages.js` file is obsolete and _should_ be removed once we come out with ideal configuration system. I took the lousy approach of implementing tests for the other functions. I'm sorry. [1] mtsmfm/hubot-test-helper#32
We'd like to go forward with the confidence of application keep on working. Ideal situation would be to hold a set of tests, covering each line of code in our system. This however proves to be difficult for different reasons. For instance, I'd like to test that `lit` command when successful would create a message in a separate channel. Sounds simple, yet the hubot testing helper does not support the functionality of multiple rooms. This issue has already been raised with upstream [1] and needs yet to be resolved. In order to keep hubot happy, I had to separate the script tests into a separate directory. In fact, two of them, as I've separated the response messages from script file, to be DRY about it when using in tests. The `.messages.js` file is obsolete and _should_ be removed once we come out with ideal configuration system. I took the lousy approach of implementing tests for the other functions. I'm sorry. [1] mtsmfm/hubot-test-helper#32
We'd like to go forward with the confidence of application keep on working. Ideal situation would be to hold a set of tests, covering each line of code in our system. This however proves to be difficult for different reasons. For instance, I'd like to test that `lit` command when successful would create a message in a separate channel. Sounds simple, yet the hubot testing helper does not support the functionality of multiple rooms. This issue has already been raised with upstream [1] and needs yet to be resolved. In order to keep hubot happy, I had to separate the script tests into a separate directory. In fact, two of them, as I've separated the response messages from script file, to be DRY about it when using in tests. The `.messages.js` file is obsolete and _should_ be removed once we come out with ideal configuration system. I took the lousy approach of implementing tests for the other functions. I'm sorry. [1] mtsmfm/hubot-test-helper#32
We'd like to go forward with the confidence of application keep on working. Ideal situation would be to hold a set of tests, covering each line of code in our system. This however proves to be difficult for different reasons. For instance, I'd like to test that `lit` command when successful would create a message in a separate channel. Sounds simple, yet the hubot testing helper does not support the functionality of multiple rooms. This issue has already been raised with upstream [1] and needs yet to be resolved. In order to keep hubot happy, I had to separate the script tests into a separate directory. In fact, two of them, as I've separated the response messages from script file, to be DRY about it when using in tests. The `.messages.js` file is obsolete and _should_ be removed once we come out with ideal configuration system. I took the lousy approach of implementing tests for the other functions. I'm sorry. [1] mtsmfm/hubot-test-helper#32
Did anything come of this? |
@ummaycoc I'm working on a new framework of the whole stack I developed based on hubot, nubot/playbook/pretend - it will provide multi room testing tools, but is still a little way off. If you'd like to get early access please email me: [email protected] For now, here's the updated link from above, for using Pretend to do multi-room tests... https://github.com/timkinnane/hubot-pretend/blob/master/test/usage/02-rooms_test.js |
not sure about other implementations, but in slack, hubot can be in multiple rooms (channels), but there is only one instance of the robot and brain
is there a way to test this functionality with the current test-helper and I'm missing it?
if not, can we add on this functionality? i'd be glad to implement and PR with some guidance, but at this point I don't quite have a lot of background on test-helper or hubot architecture.
thanks!
Matt
The text was updated successfully, but these errors were encountered: