[10:05:59] o/ Amir1 [10:06:06] Added some notes to https://github.com/wikimedia/ores/pull/306 [10:06:08] hey [10:06:14] Already answered all [10:06:31] I think we should pull redis-service out of the unit tests. You should be able to construct the Redis score_cache with a mock Redis connection. [10:07:02] That's a lot of work [10:07:08] for little gain [10:07:15] Is it? It seems like mocking two function calls is pretty straightforward [10:07:19] It's standard practice for a reason. [10:07:30] Two function calls: get/set [10:08:20] https://github.com/wikimedia/ores/blob/a80bdfa13bc79a8c68be326379a12f254fa9360e/ores/score_caches/redis.py#L30 [10:08:31] https://github.com/wikimedia/ores/blob/a80bdfa13bc79a8c68be326379a12f254fa9360e/ores/score_caches/redis.py#L43 [10:08:33] *setex [10:08:33] * travis-ci (~travis-ci@ec2-54-163-139-160.compute-1.amazonaws.com) has joined [10:08:34] wikimedia/ores#1228 (celery_tests - 03208cd : Amir Sarabadani): The build has errored. https://travis-ci.org/wikimedia/ores/builds/470578788 [10:08:34] * travis-ci (~travis-ci@ec2-54-163-139-160.compute-1.amazonaws.com) has left [10:09:18] the thing is in any case that redis is not available you can just skip all redis by running pytest -m "not redis" [10:13:19] + how you are going to mock redis in celery tests? I'm writing tests for that too [10:20:44] In all cases, redis just needs get and setex mocked. They are simple key-value set and get patterns so it should be really easy. [10:21:27] I'd say that redis is possibly the easiest thing to mock that I have ever come across. [10:21:30] :P [10:21:45] * basile is now known as guillom [10:23:37] yes but how I'm going to inject the mock into celery app? [10:23:52] apps? [10:24:12] Oh I see what you mean. I think celery will need to be mocked. [10:24:41] http://docs.celeryproject.org/en/latest/userguide/testing.html [10:24:49] "To test task behavior in unit tests the preferred method is mocking." [10:26:12] I think you can just run celery in single thread mode too. [10:26:47] This seems relevant: http://docs.celeryproject.org/en/3.1/configuration.html#celery-always-eager