obs-status-service: Add a command line option to run in test mode #113
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It could be nice to have an optional argument for the
obs-status-servicetool, to be able to run the service and develop without the need of a Redis server.It could be a new argument
--test-run, for example:To do this we will need to "mock" the
redis.Clientin theredis.gofile. Right now there are only two calls to the redisClient, so it should be easy to mock:map[string]stringfor a query key likeresult.PROJECT/REPO/ARCH.[]stringlikeresult.PROJECT/REPO/ARCH.So for to summarize, we can mock the redis client implementing two functions, the
ScanTypethat returns a list of mock projects, for example:And the
HGetAllresult could be mocked like: