redis
The atago project wrote these specs on its own initiative and runs them in its own CI, to exercise atago against a real program. They are not redis’s official test suite, and the redis project is not affiliated with atago.
Summary #
1 suite · 6 scenarios
Contents #
- redis (server + client, signal-step testbed) — 6 scenarios
redis (server + client, signal-step testbed) #
Redis ships a server and a client together, so one suite can cover a whole round trip: start the server, wait for it to actually be ready, talk to it, and shut it down.
Readiness is checked two ways — by the log line the server prints and by the port accepting connections — because those can disagree, and a test that starts sending commands too early is flaky rather than wrong.
redis-cli has a crisp contract worth pinning: when its output is a pipe
rather than a terminal it prints raw values (PONG, OK, bare integers),
which is exactly what a script parses. Shutdown is the other end of the
lifecycle: the server is asked to stop and is then polled until it really
stops answering.
Source: test/e2e/thirdparty/redis/redis.atago.yaml
Scenario: server boots (log readiness) and answers PING #
only when redis-server --version && redis-cli --version succeeds · skipped on Windows
Given #
- Background service
redisis started:redis-server --port 16379 --save '' --appendonly no.
When #
redis-cli -p 16379 PING
Then #
- exit code is
0 - stdout equals an exact value
Scenario: server boots (port readiness) and round-trips SET/GET/INCR #
only when redis-server --version && redis-cli --version succeeds · skipped on Windows
Given #
- Background service
redisis started:redis-server --port 16380 --save '' --appendonly no.
When #
redis-cli -p 16380 SET greeting hello
redis-cli -p 16380 GET greeting
redis-cli -p 16380 INCR counter
redis-cli -p 16380 INCR counter
Then #
- after
redis-cli -p 16380 SET greeting hello:- exit code is
0 - stdout equals an exact value
- exit code is
- after
redis-cli -p 16380 GET greeting:- exit code is
0 - stdout equals an exact value
- exit code is
- after
redis-cli -p 16380 INCR counter:- exit code is
0 - stdout equals an exact value
- exit code is
- after
redis-cli -p 16380 INCR counter:- exit code is
0 - stdout equals an exact value
- exit code is
Scenario: EXPIRE and TTL report lifetime state #
only when redis-server --version && redis-cli --version succeeds · skipped on Windows
Given #
- Background service
redisis started:redis-server --port 16381 --save '' --appendonly no.
When #
redis-cli -p 16381 SET k v
redis-cli -p 16381 TTL k
redis-cli -p 16381 EXPIRE k 100
redis-cli -p 16381 TTL k
redis-cli -p 16381 TTL no-such-key
Then #
- after
redis-cli -p 16381 SET k v:- exit code is
0
- exit code is
- after
redis-cli -p 16381 TTL k:- exit code is
0 - stdout equals an exact value
- exit code is
- after
redis-cli -p 16381 EXPIRE k 100:- exit code is
0 - stdout equals an exact value
- exit code is
- after
redis-cli -p 16381 TTL k:- exit code is
0 - stdout matches
/^(100|9[0-9])\b/
- exit code is
- after
redis-cli -p 16381 TTL no-such-key:- exit code is
0 - stdout equals an exact value
- exit code is
Scenario: connecting to a closed port fails loudly #
only when redis-cli --version succeeds · skipped on Windows
When #
redis-cli -p 16999 PING
Then #
- exit code is
1 - stderr contains
Connection refused
Scenario: an unknown command reports ERR without killing the server #
only when redis-server --version && redis-cli --version succeeds · skipped on Windows
Given #
- Background service
redisis started:redis-server --port 16382 --save '' --appendonly no.
When #
redis-cli -p 16382 NOSUCHCOMMAND arg; echo "rc=$?"
redis-cli -p 16382 PING
Then #
- after
redis-cli -p 16382 NOSUCHCOMMAND arg; echo "rc=$?":- stdout contains
ERR unknown command
- stdout contains
- after
redis-cli -p 16382 PING:- exit code is
0 - stdout equals an exact value
- exit code is
Scenario: SHUTDOWN NOSAVE stops the server and PING starts failing #
only when redis-server --version && redis-cli --version succeeds · skipped on Windows
Given #
- Background service
redisis started:redis-server --port 16383 --save '' --appendonly no.
When #
redis-cli -p 16383 PING
redis-cli -p 16383 SHUTDOWN NOSAVE
redis-cli -p 16383 PING
Then #
- after
redis-cli -p 16383 PING:- exit code is
0 - stdout equals an exact value
- exit code is
- after
redis-cli -p 16383 PING:- exit code is
1 - stderr contains
Connection refused
- exit code is