serokell / coffer

Multi-backend password store with multiple frontends
4 stars 2 forks source link

Add a `bats` test suite #23

Closed dcastro closed 2 years ago

dcastro commented 2 years ago

We should setup a bats test suite for end-to-end tests for the CLI.


Once we do that, we should also delete the doctests in Backend.Vault.Kv.Internal.Routes.

-- $setup
-- >>> import Network.HTTP.Client.TLS (tlsManagerSettings)
-- >>> import Network.HTTP.Client     (newManager)
-- >>> import Servant.Clieng          (BaseUrl, Https)
--
-- >>> let vaultToken   = "TOKEN"
-- >>> let vaultAddress = "vault.example.org"
--
-- >>>     manager     <- newManager tlsManagerSettings
-- >>> let clientEnv   <- mkClientEnv manager (BaseUrl Https vaultAddress 8200 "")

Doctests should not depend on external services, we should be able to run them in isolation without any additional setup. So bats is a much better tool for this purpose than doctest.