Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/test_expiry.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func testExpiry(stageHarness *test_case_harness.TestCaseHarness) error {

setCommandTestCase := test_cases.SendCommandTestCase{
Command: "set",
Args: []string{key, value, "px", "100"},
Args: []string{key, value, "PX", "100"},
Assertion: resp_assertions.NewStringAssertion("OK"),
}

Expand Down
18 changes: 9 additions & 9 deletions internal/test_helpers/course_definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ extensions:
name: "Transactions"
description_markdown: |-
In this challenge extension you'll add support for [Transactions][redis-transactions] to your Redis implementation.

Along the way, you'll learn about the [MULTI][multi-command], [EXEC][exec-command], and [DISCARD][discard-command] commands, as well as how Redis handles transactions atomically.

[redis-transactions]: https://redis.io/docs/latest/develop/interact/transactions/
Expand All @@ -103,7 +103,7 @@ extensions:

- slug: "lists"
name: "Lists"
description_markdown : |-
description_markdown: |-
In this challenge extension you'll add support for [Lists][redis-lists] to your Redis implementation.

Along the way, you'll learn commands like RPUSH, LRANGE, and more.
Expand All @@ -114,7 +114,7 @@ extensions:

- slug: "pub-sub"
name: "Pub/Sub"
description_markdown : |-
description_markdown: |-
In this challenge extension you'll add support for [Publish/Subscribe (Pub/Sub)][redis-pub-sub] to your Redis implementation.

Along the way, you'll learn commands like [SUBSCRIBE][subscribe-command], [PUBLISH][publish-command], and more.
Expand All @@ -125,7 +125,7 @@ extensions:

- slug: "sorted-sets"
name: "Sorted Sets"
description_markdown : |-
description_markdown: |-
In this challenge extension you'll add support for [Sorted Sets (zsets)][redis-zset] to your Redis implementation.

Along the way, you'll learn commands like [ZADD][zadd-command], [ZRANGE][zrange-command], and more.
Expand Down Expand Up @@ -463,7 +463,7 @@ stages:
The expiry for a key can be provided using the "PX" argument to the [SET](https://redis.io/commands/set) command. The expiry is provided in milliseconds.

```bash
$ redis-cli SET foo bar px 100 # Sets the key "foo" to "bar" with an expiry of 100 milliseconds
$ redis-cli SET foo bar PX 100 # Sets the key "foo" to "bar" with an expiry of 100 milliseconds
OK
```

Expand All @@ -485,7 +485,7 @@ stages:
It'll then send a `SET` command to your server to set a key with an expiry:

```bash
$ redis-cli SET foo bar px 100
$ redis-cli SET foo bar PX 100
```

It'll then immediately send a `GET` command to retrieve the value:
Expand Down Expand Up @@ -3576,7 +3576,7 @@ stages:
name: "Blocking retrieval with timeout"
difficulty: medium
marketing_md: In this stage, you will add support for a non-zero timeout duration for the `BLPOP` command.

# Pub-Sub
- slug: "mx3"
primary_extension_slug: "pub-sub"
Expand All @@ -3595,7 +3595,7 @@ stages:
name: "Enter subscribed mode"
difficulty: medium
marketing_md: In this stage, you'll add support for marking a client as having entered subscribed mode.

- slug: "lf1"
primary_extension_slug: "pub-sub"
name: "PING in subscribed mode"
Expand Down Expand Up @@ -3724,4 +3724,4 @@ stages:
primary_extension_slug: "geospatial"
name: "Search within radius"
difficulty: easy
marketing_md: In this stage, you'll add support for searching locations near a coordinate within a given radius using the `GEOSEARCH` command.
marketing_md: In this stage, you'll add support for searching locations near a coordinate within a given radius using the `GEOSEARCH` command.
10 changes: 5 additions & 5 deletions internal/test_helpers/fixtures/expiry/pass
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ Debug = true

[tester::#YZ1] Running tests for Stage #YZ1 (yz1)
[tester::#YZ1] $ ./spawn_redis_server.sh
[tester::#YZ1] [client] $ redis-cli SET apple blueberry px 100
[tester::#YZ1] [client] Sent bytes: "*5\r\n$3\r\nSET\r\n$5\r\napple\r\n$9\r\nblueberry\r\n$2\r\npx\r\n$3\r\n100\r\n"
[tester::#YZ1] [client] $ redis-cli SET apple blueberry PX 100
[tester::#YZ1] [client] Sent bytes: "*5\r\n$3\r\nSET\r\n$5\r\napple\r\n$9\r\nblueberry\r\n$2\r\nPX\r\n$3\r\n100\r\n"
[tester::#YZ1] [client] Received bytes: "+OK\r\n"
[tester::#YZ1] [client] Received RESP simple string: "OK"
[tester::#YZ1] [client] ✔︎ Received "OK"
[tester::#YZ1] Received OK at 07:22:35.924
[tester::#YZ1] Fetching key "apple" at 07:22:35.924 (should not be expired)
[tester::#YZ1] Received OK at 21:22:04.157
[tester::#YZ1] Fetching key "apple" at 21:22:04.157 (should not be expired)
[tester::#YZ1] [client] > GET apple
[tester::#YZ1] [client] Sent bytes: "*2\r\n$3\r\nGET\r\n$5\r\napple\r\n"
[tester::#YZ1] [client] Received bytes: "$9\r\nblueberry\r\n"
[tester::#YZ1] [client] Received RESP bulk string: "blueberry"
[tester::#YZ1] [client] ✔︎ Received "blueberry"
[tester::#YZ1] Sleeping for 101ms
[tester::#YZ1] Fetching key "apple" at 07:22:36.031 (should be expired)
[tester::#YZ1] Fetching key "apple" at 21:22:04.261 (should be expired)
[tester::#YZ1] [client] > GET apple
[tester::#YZ1] [client] Sent bytes: "*2\r\n$3\r\nGET\r\n$5\r\napple\r\n"
[tester::#YZ1] [client] Received bytes: "$-1\r\n"
Expand Down
Loading