Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #620 from aio-libs/travis_ci_updates
Browse files Browse the repository at this point in the history
Travis ci updates
  • Loading branch information
popravich committed Jul 12, 2019
2 parents ba9f5b7 + 1bcc3ee commit bbc6689
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ addons:

env:
global:
REDIS_TAGS: >-
'2.6.17 2.8.22 3.0.7 3.2.8 4.0.11 5.0.1'
INSTALL_DIR: >-
$HOME/redis
PYTEST_ADDOPTS: >-
Expand All @@ -20,7 +18,8 @@ python:
- "3.6"
- "3.7"
- "nightly"
- "pypy3.5-6.0"
- "pypy3.5-7.0"
- "pypy3.6-7.1.1"

stages:
- lint
Expand Down Expand Up @@ -83,6 +82,7 @@ jobs:
python: "3.7"

install:
- make ci-prune-old-redis
- make -j ci-build-redis
- |
if [ "$UVLOOP" = "y" ]; then
Expand Down
3 changes: 3 additions & 0 deletions CHANGES/620.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Update PyPy3.5 version to v7.0.
Add PyPy3.6 v7.1.1.
Some cleanup in Makefile.
20 changes: 12 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ FLAKE ?= flake8
PYTEST ?= pytest
MYPY ?= mypy

REDIS_VERSION ?= "$(shell redis-cli INFO SERVER | sed -n 2p)"
REDIS_TAGS ?= 2.6.17 2.8.22 3.0.7 3.2.8 4.0.11 5.0.1
REDIS_TAGS ?= 2.6.17 2.8.22 3.0.7 3.2.13 4.0.14 5.0.5

ARCHIVE_URL = https://github.com/antirez/redis/archive
INSTALL_DIR ?= build

REDIS_TARGETS = $(foreach T,$(REDIS_TAGS),$(INSTALL_DIR)/$T/redis-server)
OBSOLETE_TARGETS = $(filter-out $(REDIS_TARGETS),$(wildcard $(INSTALL_DIR)/*/redis-server))

# Python implementation
PYTHON_IMPL = $(shell $(PYTHON) -c "import sys; print(sys.implementation.name)")

EXAMPLES = $(shell find examples -name "*.py")
EXAMPLES = $(sort $(wildcard examples/*.py examples/*/*.py))

.PHONY: all flake doc man-doc spelling test cov dist devel clean mypy
all: aioredis.egg-info flake doc cov
Expand Down Expand Up @@ -87,18 +87,22 @@ certificate:
$(MAKE) -C tests/ssl

ci-test: $(REDIS_TARGETS)
@$(call echo, "Tests run")
pytest --cov \
$(PYTEST) --cov \
$(foreach T,$(REDIS_TARGETS),--redis-server=$T)

ci-test-%: $(INSTALL_DIR)/%/redis-server
pytest --cov --redis-server=$<
$(PYTEST) --cov --redis-server=$<

ci-build-redis: $(REDIS_TARGETS)

ci-prune-old-redis: $(OBSOLETE_TARGETS)
$(OBSOLETE_TARGETS):
rm -r $@
.PHONY: $(OBSOLETE_TARGETS)

$(INSTALL_DIR)/%/redis-server: /tmp/redis-%/src/redis-server
mkdir -p $(abspath $(INSTALL_DIR))/$*
cp -p /tmp/redis-$*/src/redis-server $(abspath $(INSTALL_DIR))/$*/
mkdir -p $(abspath $(dir $@))
cp -p $< $(abspath $@)
@echo "Done building redis-$*"

/tmp/redis-%/src/redis-server:
Expand Down
13 changes: 7 additions & 6 deletions tests/stream_commands_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,10 @@ async def test_xread_group(redis):
await redis.xadd('test_stream', {'a': 1})
await redis.xgroup_create('test_stream', 'test_group', latest_id='0')

# read all pending messages
messages = await redis.xread_group(
'test_group', 'test_consumer', ['test_stream'],
timeout=1000, latest_ids=[0]
timeout=1000, latest_ids=['>']
)
assert len(messages) == 1
stream, message_id, fields = messages[0]
Expand All @@ -365,7 +366,7 @@ async def test_xack_and_xpending(redis):
# Read the message
await redis.xread_group(
'test_group', 'test_consumer', ['test_stream'],
timeout=1000, latest_ids=[0]
timeout=1000, latest_ids=['>']
)

# It is now pending
Expand Down Expand Up @@ -393,7 +394,7 @@ async def test_xpending_get_messages(redis):
await redis.xgroup_create('test_stream', 'test_group', latest_id='0')
await redis.xread_group(
'test_group', 'test_consumer', ['test_stream'],
timeout=1000, latest_ids=[0]
timeout=1000, latest_ids=['>']
)
await asyncio.sleep(0.05)

Expand Down Expand Up @@ -426,7 +427,7 @@ async def test_xclaim_simple(redis):
await redis.xgroup_create('test_stream', 'test_group', latest_id='0')
await redis.xread_group(
'test_group', 'test_consumer', ['test_stream'],
timeout=1000, latest_ids=[0]
timeout=1000, latest_ids=['>']
)

# Message is now pending
Expand Down Expand Up @@ -456,7 +457,7 @@ async def test_xclaim_min_idle_time_includes_messages(redis):
await redis.xgroup_create('test_stream', 'test_group', latest_id='0')
await redis.xread_group(
'test_group', 'test_consumer', ['test_stream'],
timeout=1000, latest_ids=[0]
timeout=1000, latest_ids=['>']
)

# Message is now pending. Wait 100ms
Expand All @@ -474,7 +475,7 @@ async def test_xclaim_min_idle_time_excludes_messages(redis):
await redis.xgroup_create('test_stream', 'test_group', latest_id='0')
await redis.xread_group(
'test_group', 'test_consumer', ['test_stream'],
timeout=1000, latest_ids=[0]
timeout=1000, latest_ids=['>']
)
# Message is now pending. Wait no time at all

Expand Down

0 comments on commit bbc6689

Please sign in to comment.