Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make mprovements + change integration test name #362

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Install Redis
run: (cd ./integration && ./get_redis.sh)
- name: Test
run: make int testrace
run: make conformance testrace
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/integration/redis_src/
/integration/dump.rdb
/conformance/redis_src/
/conformance/dump.rdb
/conformance/nodes.conf
*.swp
/integration/nodes.conf
.idea/
miniredis.iml
34 changes: 27 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
.PHONY: all test testrace int
.PHONY: help
help: ### This screen. Keep it first target to be default
ifeq ($(UNAME), Linux)
@grep -P '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
else
@# this is not tested, but prepared in advance for you, Mac drivers
@awk -F ':.*###' '$$0 ~ FS {printf "%15s%s\n", $$1 ":", $$2}' \
$(MAKEFILE_LIST) | grep -v '@awk' | sort
endif

all: test

test:
.PHONY: test
test: ### Run unit tests
go test ./...

testrace:
.PHONY: testrace
testrace: ### Run unit tests with race detector
go test -race ./...

int:
INT=1 go test ./...
.PHONY: conformance
conformance: conformance/redis_src/redis-server ### Run conformance tests (compare miniredis implementation with original redis)
MINIREDIS_CONFORMANCE=1 go test ./conformance/...

conformance/redis_src/redis-server: conformance/get_redis.sh ### Download and build redis if not available or in wrong version
./conformance/get_redis.sh

.PHONY: clean
clean: ### Cleanup conformance test files (including redis binary)
rm -rf \
conformance/redis_src \
conformance/dump.rdb \
conformance/nodes.conf
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ Commands which will probably not be implemented:

## &c.

Integration tests are run against Redis 7.2.0. The [./integration](./integration/) subdir
Conformance tests are run against Redis 7.2.0. The [./conformance](./conformance/) subdir
compares miniredis against a real redis instance.

The Redis 6 RESP3 protocol is supported. If there are problems, please open
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions integration/get_redis.sh → conformance/get_redis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -eu

VERSION=7.2.0

cd "$(dirname "$0")"
rm -rf ./redis_src/
mkdir -p ./redis_src/
cd ./redis_src/
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions integration/test.go → conformance/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (

func skip(t testing.TB) {
t.Helper()
if os.Getenv("INT") == "" {
t.Skip("INT=1 not set")
if os.Getenv("MINIREDIS_CONFORMANCE") == "" {
t.Skip("MINIREDIS_CONFORMANCE=1 not set")
}
}

Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 0 additions & 7 deletions integration/Makefile

This file was deleted.