mirror of https://github.com/go-redis/redis.git
Merge pull request #274 from go-redis/fix/go-standard-paths
Use go standard path for test data
This commit is contained in:
commit
3f9a83634d
|
@ -1,2 +1,2 @@
|
|||
*.rdb
|
||||
.test/
|
||||
testdata/*/
|
||||
|
|
6
Makefile
6
Makefile
|
@ -2,13 +2,13 @@ all: testdeps
|
|||
go test ./... -test.v -test.cpu=1,2,4
|
||||
go test ./... -test.v -test.short -test.race
|
||||
|
||||
testdeps: .test/redis/src/redis-server
|
||||
testdeps: testdata/redis/src/redis-server
|
||||
|
||||
.PHONY: all test testdeps
|
||||
|
||||
.test/redis:
|
||||
testdata/redis:
|
||||
mkdir -p $@
|
||||
wget -qO- https://github.com/antirez/redis/archive/unstable.tar.gz | tar xvz --strip-components=1 -C $@
|
||||
|
||||
.test/redis/src/redis-server: .test/redis
|
||||
testdata/redis/src/redis-server: testdata/redis
|
||||
cd $< && make all
|
||||
|
|
|
@ -171,12 +171,12 @@ func (p *redisProcess) Close() error {
|
|||
}
|
||||
|
||||
var (
|
||||
redisServerBin, _ = filepath.Abs(filepath.Join(".test", "redis", "src", "redis-server"))
|
||||
redisServerConf, _ = filepath.Abs(filepath.Join(".test", "redis.conf"))
|
||||
redisServerBin, _ = filepath.Abs(filepath.Join("testdata", "redis", "src", "redis-server"))
|
||||
redisServerConf, _ = filepath.Abs(filepath.Join("testdata", "redis.conf"))
|
||||
)
|
||||
|
||||
func redisDir(port string) (string, error) {
|
||||
dir, err := filepath.Abs(filepath.Join(".test", "instances", port))
|
||||
dir, err := filepath.Abs(filepath.Join("testdata", "instances", port))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue