diff options
author | Pierre de La Morinerie <kemenaran@gmail.com> | 2018-02-12 22:16:32 +0530 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2018-02-12 08:46:32 -0800 |
commit | 07fd7aeeb8eb2b198b01b713a4ab57f6352faef2 (patch) | |
tree | 002eb93e9258b91553f3784629a1acdff6f6fc49 /model/license_test.go | |
parent | 3e0c3eff9f2ddec241cdb3f7a91230fd7c51a5f6 (diff) | |
download | chat-07fd7aeeb8eb2b198b01b713a4ab57f6352faef2.tar.gz chat-07fd7aeeb8eb2b198b01b713a4ab57f6352faef2.tar.bz2 chat-07fd7aeeb8eb2b198b01b713a4ab57f6352faef2.zip |
Add tests for the `platform server` command (#8231)
* Cleanup app state on initialization error
When returning an initialization error, the app state was not cleaned
up. This is especially visible during tests, as `appCount` is not
decremented, and makes the new app initialization fail.
* Test the `platform server` command
As the `platform server` command only exits when interrupted by
a signal, it is not possible to test it as the other cobra
commands. Instead we directly test the actual command function.
The internal command handler is slighly refactored to take
a channel in argument, and registers it as the signal handler.
Nothing very different—except than controlling this channel
from the outside allows the test to send the system signal
itself, thus preventing the server to run forever.
Diffstat (limited to 'model/license_test.go')
0 files changed, 0 insertions, 0 deletions