jneeven / snaketalk

Simple mattermost python bot with webhook support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add tests

jneeven opened this issue · comments

The current code works for python 3.8 (I've tested it manually), but it needs many unit tests and integration tests to ensure it keeps working in the future.

Hi @jneeven, do you plan to use pytest for the testing framework, or did you have something else in mind? In mmpy_bot tests are separated into two types; unit tests and behaviour tests. The former not needing connection to a Mattermost server whilst the latter does. Are you thinking of doing a similar kind of setup?

Perhaps you can get the ball rolling with the initial test framework layout and a couple of basic tests, then I can help with getting more tests written up.

Hi @jneeven, do you plan to use pytest for the testing framework, or did you have something else in mind? In mmpy_bot tests are separated into two types; unit tests and behaviour tests. The former not needing connection to a Mattermost server whilst the latter does. Are you thinking of doing a similar kind of setup?

Yes, I was hoping that we might even be able to run that mattermost server inside a GitHub action, so the tests can all be run automatically. I don't have any real experience with docker, but I think it should be possible to install the server inside a docker container and then run the tests on that docker image 🙏

If not, I think it makes most sense to just send fake messages through the MessageHandler and check what functions were called on the Driver object

Perhaps you can get the ball rolling with the initial test framework layout and a couple of basic tests, then I can help with getting more tests written up.

I haven't had any time to work on it recently, but I hope to get started this weekend 👍 thanks for the support!

Yes, I was hoping that we might even be able to run that mattermost server inside a GitHub action, so the tests can all be run automatically. I don't have any real experience with docker, but I think it should be possible to install the server inside a docker container and then run the tests on that docker image

Good idea, we may be able to use the Local Machine image for this. I can help get that set up if you need.

I haven't had any time to work on it recently, but I hope to get started this weekend

Totally understand. I am in the same predicament, but will try to find some spare cycles for this where I can :)