telegram-bot-api icon indicating copy to clipboard operation
telegram-bot-api copied to clipboard

Improve tests

Open Syfaro opened this issue 3 years ago • 1 comments

Currently tests are run against the live Bot API. While this is great for ensuring compatibility, it has a few issues.

  • The main issue is that it frequently gets rate limited. When running multiple sets of tests in short succession (merging multiple PRs, etc.) it can cause errors. This requires waiting long periods of time to attempt the test again.
  • It also is distributing a bot token into the public, which could be abused. Moving the token into a secret would prevent other developers from locally running tests, making it a poor solution.

I think ideally tests would be run against a mocked implementation of the Bot API with an option to run them against the live API when provided with a token.

~~There should also be integration with Codecov (or similar, let me know what other options are) to monitor the coverage of tests.~~

Alternative approaches are also appreciated! I'm not sure if this is the best way to solve the problem.

Syfaro avatar Jul 27 '20 03:07 Syfaro

I'm doing some work to improve the test situation on the improve-tests branch.

Syfaro avatar Dec 07 '21 05:12 Syfaro