This repository was archived by the owner on Apr 20, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +36
-5
lines changed
Expand file tree Collapse file tree 2 files changed +36
-5
lines changed Original file line number Diff line number Diff line change 1+ FROM rust:latest as builder
2+
3+ ENV LIBDIR /usr/lib/redis/modules
4+ ENV DEPS "python python-setuptools python-pip wget unzip build-essential clang-6.0 cmake"
5+ # Set up a build environment
6+ RUN set -ex;\
7+ deps="$DEPS" ;\
8+ apt-get update; \
9+ apt-get install -y --no-install-recommends $deps;\
10+ pip install rmtest;
11+
12+ # Build the source
13+ ADD . /REJSON
14+ WORKDIR /REJSON
15+ RUN set -ex;\
16+ cargo build --release; \
17+ python ./test/pytest/test.py target/release/libredisjson.so;
18+
19+ # Package the runner
20+ FROM redis:latest
21+ ENV LIBDIR /usr/lib/redis/modules
22+ WORKDIR /data
23+ RUN set -ex;\
24+ mkdir -p "$LIBDIR" ;
25+ COPY --from=builder /REJSON/target/release/libredisjson.so "$LIBDIR"
26+
27+ CMD ["redis-server" , "--loadmodule" , "/usr/lib/redis/modules/libredisjson.so" ]
Original file line number Diff line number Diff line change 55import redis
66import unittest
77import json
8+ import sys
89import os
910
1011# Path to JSON test case files
6667 },
6768}
6869
69- rmtest .config .REDIS_MODULE = os .path .abspath (os .path .join (os .getcwd (), 'target/debug/libredisjson.so' ))
70+ if len (sys .argv ) >= 2 :
71+ lib_file = sys .argv [1 ]
72+ del sys .argv [1 :]
73+ else :
74+ lib_file = 'target/debug/libredisjson.so'
75+
76+ rmtest .config .REDIS_MODULE = os .path .abspath (os .path .join (os .getcwd (), lib_file ))
7077
7178class BaseReJSONTest (BaseModuleTestCase ):
7279 def getCacheInfo (self ):
@@ -76,9 +83,6 @@ def getCacheInfo(self):
7683 ret [res [x ]] = res [x + 1 ]
7784 return ret
7885
79-
80-
81-
8286class ReJSONTestCase (BaseReJSONTest ):
8387 """Tests ReJSON Redis module in vitro"""
8488
@@ -887,4 +891,4 @@ def testDoubleParse(self):
887891# self.assertEqual(0, cacheItems())
888892
889893if __name__ == '__main__' :
890- unittest .main ()
894+ unittest .main ()
You can’t perform that action at this time.
0 commit comments