3 ms·
How would you write integration tests if you had a rails app that pushed jobs out to goworker? Say a user clicks a link that creates an async job that does a A
by joevandyk 13y ago
How would you write integration tests if you had a rails app that pushed jobs out to goworker?
Say a user clicks a link that creates an async job that does a API call somewhere. What's a good way to test that entire process at once? You can easily test them separately, that clicking a link creates an async job, and that the worker can process the job, but it's useful to test the whole system at once.
- benmanns 13y agoThat's a great question that I haven't thought about before. You could possibly write a Go wrapper that executes your workers, getting the job from a command line argument rather than Redis. https://gist.github.com/benmanns/6584142 https://gist.github.com/benmanns/6584142
- joevandyk 13y agoThe test should use redis though, to test the whole stack. Same question goes for any time of queue system, like quque_classic, which stores the jobs in a postgresql table.