Cobular / distest

A library used to do integration testing on discord bots
MIT License
29 stars 8 forks source link

Implement CI/CD with the bot on itself #10

Closed Cobular closed 3 years ago

Cobular commented 5 years ago

This is a huge ask, but it needs to be done at some point so it gets an issue! When I start working on this (eventually...), I will make a new feature branch (or a new repo - IDK how this will end up working)

Cobular commented 5 years ago

I have a few ideas, thought I would get them down.

  1. We should probably take a well tested and known good version of the bot and either make a dedicated branch that it lives on and never changes or make a whole new repo for that frozen bot. Then, we use that bot to run tests on this bot while in interactive mode. We won't be able to test the code that only runs in CLI mode, but I don't anticipate that becoming a big issue.
  2. We can also try to refactor the whole bot to pull out as much logic as possible from the tests but since the tests are pretty slim to start with, this probably isn't worthwhile to pursue. Let me know if you think it is, tho.

Nothing is being done now (other than the automatic code review thing I set up see #8 ).

JosephFKnight commented 5 years ago

Unfortunately I think the only real way to test this framework is with application testing via a test suite designed to test every function in the interface. Our example modules can serve this purpose nicely, I think.

Cobular commented 5 years ago

That's true. You suggest running the two example bots as a test? I can setup something on some CI/CD service that just does that every commit. I did a code coverage test, and with CLI we hit 71% (IIRC) of the code. If we also launch in interactive, even if we don't do any tests and just let startup happen, that should be almost all the code being run and should catch just about anything wrong.

JosephFKnight commented 5 years ago

perfect. two birds, one stone.

On Mon, May 27, 2019, 11:30 AM J Cover notifications@github.com wrote:

That's true. You suggest running the two example bots as a test? I can setup something on some CI/CD service that just does that every commit. I did a code coverage test, and with CLI we hit 71% (IIRC) of the code. If we also launch in interactive, even if we don't do any tests and just let startup happen, that should be almost all the code being run and should catch just about anything wrong.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JakeCover/distest/issues/10?email_source=notifications&email_token=AK6KUYN5GJ24J52SUGWUAVTPXQEBZA5CNFSM4HPMNYU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWKFRMI#issuecomment-496261297, or mute the thread https://github.com/notifications/unsubscribe-auth/AK6KUYLBS4UQNCAKBCNJXZDPXQEBZANCNFSM4HPMNYUQ .

Cobular commented 5 years ago

Ok this works now? I'm going to leave this open for a little while tho in case things aren't going as planned

Cobular commented 5 years ago

Actually I might want to try to run the tests with some code coverage on them, which I will do soonly (tm)

Cobular commented 5 years ago

image It's all working right now!