fix tests for redis cluster

This commit is contained in:
Brian Gough 2017-05-08 16:02:40 +01:00
parent 79d8fced49
commit e2f70aca1a
2 changed files with 12 additions and 0 deletions

View file

@ -19,6 +19,12 @@ describe 'LockManager - releasing the lock', ()->
error:-> error:->
"redis-sharelatex": "redis-sharelatex":
createClient : () => @client createClient : () => @client
"settings-sharelatex": {
redis:
lock:
key_schema:
blockingKey: ({doc_id}) -> "Blocking:#{doc_id}"
}
"./Metrics": {inc: () ->} "./Metrics": {inc: () ->}
@LockManager = SandboxedModule.require(modulePath, requires: mocks) @LockManager = SandboxedModule.require(modulePath, requires: mocks)
@lockValue = "lock-value-stub" @lockValue = "lock-value-stub"

View file

@ -13,6 +13,12 @@ describe 'LockManager - trying the lock', ->
auth:-> auth:->
set: @set = sinon.stub() set: @set = sinon.stub()
"./Metrics": {inc: () ->} "./Metrics": {inc: () ->}
"settings-sharelatex": {
redis:
lock:
key_schema:
blockingKey: ({doc_id}) -> "Blocking:#{doc_id}"
}
@callback = sinon.stub() @callback = sinon.stub()
@doc_id = "doc-id-123" @doc_id = "doc-id-123"