From 0966f694da11509c906f0a3362427baa042f637c Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 27 Apr 2017 10:14:44 +0100 Subject: [PATCH] fix acceptance tests to work with redis cluster --- .../acceptance/coffee/helpers/TrackChangesClient.coffee | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/services/track-changes/test/acceptance/coffee/helpers/TrackChangesClient.coffee b/services/track-changes/test/acceptance/coffee/helpers/TrackChangesClient.coffee index 4e1d1d1eff..e927333004 100644 --- a/services/track-changes/test/acceptance/coffee/helpers/TrackChangesClient.coffee +++ b/services/track-changes/test/acceptance/coffee/helpers/TrackChangesClient.coffee @@ -1,9 +1,10 @@ async = require 'async' zlib = require 'zlib' request = require "request" -rclient = require("redis").createClient() # Only works locally for now -{db, ObjectId} = require "../../../../app/js/mongojs" Settings = require "settings-sharelatex" +rclient = require("redis-sharelatex").createClient(Settings.redis.history) # Only works locally for now +Keys = Settings.redis.history.key_schema +{db, ObjectId} = require "../../../../app/js/mongojs" module.exports = TrackChangesClient = flushAndGetCompressedUpdates: (project_id, doc_id, callback = (error, updates) ->) -> @@ -49,9 +50,9 @@ module.exports = TrackChangesClient = }, callback pushRawUpdates: (project_id, doc_id, updates, callback = (error) ->) -> - rclient.sadd "DocsWithHistoryOps:#{project_id}", doc_id, (error) -> + rclient.sadd Keys.docsWithHistoryOps({project_id}), doc_id, (error) -> return callback(error) if error? - rclient.rpush "UncompressedHistoryOps:#{doc_id}", (JSON.stringify(u) for u in updates)..., callback + rclient.rpush Keys.uncompressedHistoryOps({doc_id}), (JSON.stringify(u) for u in updates)..., callback getDiff: (project_id, doc_id, from, to, callback = (error, diff) ->) -> request.get {