iegomez / mosquitto-go-auth

Auth plugin for mosquitto.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve testing

iegomez opened this issue · comments

The test suite was written long ago while starting to develop this plugin and it hasn't aged well: I knew very little Go by then and there are some basic mistakes I did that are starting to creep into new changes. So testing needs a major refactor and rewrite that include at least these:

  1. Switch from goconvey to simple table driven tests and use something like testify/assert to ease checks.
  2. Don't ask users to have every damn service running just so they can be sure tests are passing. Instead, build some Docker or similar environment where services are installed and ran for tests to be held.
  3. Leverage said environment to add a CI service such as CircleCI, Github actions, etc., that will run the test suite for every PR commit and block merging on failure.
  4. Refactor go-auth.go extracting initialization and other work to its own package so it may be properly tested.