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: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ copy_course_file:
| base64 -d \
> internal/test_helpers/course_definition.yml

record_fixtures:
CODECRAFTERS_RECORD_FIXTURES=true make test

update_tester_utils:
go get -u github.com/codecrafters-io/tester-utils
Expand Down
2 changes: 1 addition & 1 deletion docker_ci/docker-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ case "$1" in
record_fixtures)
echo "📝 Recording fixtures using Docker container"
docker_build
docker run --rm -it -v "$(pwd)":/app -w /app redis-tester make record_fixtures
docker run --rm -it -e CODECRAFTERS_RECORD_FIXTURES=true -v "$(pwd)":/app -w /app redis-tester make test
;;
*)
echo "Usage:"
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.24.0
toolchain go1.24.2

require (
github.com/codecrafters-io/tester-utils v0.4.9
github.com/codecrafters-io/tester-utils v0.4.13
github.com/dustin/go-humanize v1.0.1
github.com/hdt3213/rdb v1.2.0
github.com/stretchr/testify v1.10.0
Expand All @@ -14,6 +14,7 @@ require (
)

require (
github.com/creack/pty v1.1.24 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=
github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=
github.com/codecrafters-io/tester-utils v0.4.9 h1:4J9ZdYB8A2vktofPK9ZlaaXOXP1dZD9zSv6cwDZ9srU=
github.com/codecrafters-io/tester-utils v0.4.9/go.mod h1:Fyrv4IebzjWtvKfpYf8ooYDoOtjYe2qx8bV7KAJpX+w=
github.com/codecrafters-io/tester-utils v0.4.13 h1:6mX5QxR/yM17eW+TfI17iwtmOwTKQnjyDpWllzNrI8I=
github.com/codecrafters-io/tester-utils v0.4.13/go.mod h1:uhbl+sCQIv2Hg4QUZuKQarVR5cuhDbpVKId8KUF2cX8=
github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s=
github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
6 changes: 3 additions & 3 deletions internal/test_helpers/fixtures/auth/auth_always_nopass_flag
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Debug = true

[tester::#UV9] Running tests for Stage #UV9 (uv9)
[tester::#UV9] $ ./spawn_redis_server.sh
[your_program] Logs from your program will appear here!
[your_program] This server always replies with 'nopass' flag present for ACL GETUSER. See commands.go:handleAclGetUser()
[your_program] Redis server listening on 0.0.0.0:6379
[your_program] Logs from your program will appear here!
[your_program] This server always replies with 'nopass' flag present for ACL GETUSER. See commands.go:handleAclGetUser()
[your_program] Redis server listening on 0.0.0.0:6379
[tester::#UV9] [client] $ redis-cli ACL GETUSER default
[tester::#UV9] [client] Sent bytes: "*3\r\n$3\r\nACL\r\n$7\r\nGETUSER\r\n$7\r\ndefault\r\n"
[tester::#UV9] [client] Received bytes: "*4\r\n$5\r\nflags\r\n*1\r\n$6\r\nnopass\r\n$9\r\npasswords\r\n*0\r\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Debug = true

[tester::#PL7] Running tests for Stage #PL7 (pl7)
[tester::#PL7] $ ./spawn_redis_server.sh
[your_program] Logs from your program will appear here!
[your_program] This server always replies "password" instead of "passwords" for ACL GETUSER. See command.go:handleAclGetUser()
[your_program] Redis server listening on 0.0.0.0:6379
[your_program] Logs from your program will appear here!
[your_program] This server always replies "password" instead of "passwords" for ACL GETUSER. See command.go:handleAclGetUser()
[your_program] Redis server listening on 0.0.0.0:6379
[tester::#PL7] [client] $ redis-cli ACL GETUSER default
[tester::#PL7] [client] Sent bytes: "*3\r\n$3\r\nACL\r\n$7\r\nGETUSER\r\n$7\r\ndefault\r\n"
[tester::#PL7] [client] Received bytes: "*4\r\n$5\r\nflags\r\n*1\r\n$6\r\nnopass\r\n$8\r\npassword\r\n*0\r\n"
Expand Down
6 changes: 3 additions & 3 deletions internal/test_helpers/fixtures/auth/auth_mistake_sha256
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Debug = true

[tester::#UV9] Running tests for Stage #UV9 (uv9)
[tester::#UV9] $ ./spawn_redis_server.sh
[your_program] Logs from your program will appear here!
[your_program] This server always replies with an incorrect password hash in ACL GETUSER. See users.go:hashPassword()
[your_program] Redis server listening on 0.0.0.0:6379
[your_program] Logs from your program will appear here!
[your_program] This server always replies with an incorrect password hash in ACL GETUSER. See users.go:hashPassword()
[your_program] Redis server listening on 0.0.0.0:6379
[tester::#UV9] [client] $ redis-cli ACL GETUSER default
[tester::#UV9] [client] Sent bytes: "*3\r\n$3\r\nACL\r\n$7\r\nGETUSER\r\n$7\r\ndefault\r\n"
[tester::#UV9] [client] Received bytes: "*4\r\n$5\r\nflags\r\n*1\r\n$6\r\nnopass\r\n$9\r\npasswords\r\n*0\r\n"
Expand Down
2 changes: 1 addition & 1 deletion internal/test_helpers/fixtures/bind/failure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tester::#JM1] Running tests for Stage #JM1 (jm1)
[tester::#JM1] $ ./spawn_redis_server.sh
[tester::#JM1] Connecting to port 6379...
[your_program] hey, not going to bind!
[your_program] hey, not going to bind!
[tester::#JM1] Failed to connect to port 6379.
[tester::#JM1] Test failed
2 changes: 1 addition & 1 deletion internal/test_helpers/fixtures/bind/success
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Debug = true
[tester::#JM1] Running tests for Stage #JM1 (jm1)
[tester::#JM1] $ ./spawn_redis_server.sh
[tester::#JM1] Connecting to port 6379...
[your_program] hey, binding to 6379
[your_program] hey, binding to 6379
[tester::#JM1] Connection successful
[tester::#JM1] Test passed.
[tester::#JM1] Terminating program
Expand Down
2 changes: 1 addition & 1 deletion internal/test_helpers/fixtures/bind/timeout
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tester::#JM1] Running tests for Stage #JM1 (jm1)
[tester::#JM1] $ ./spawn_redis_server.sh
[tester::#JM1] Connecting to port 6379...
[your_program] hey, not going to bind!
[your_program] hey, not going to bind!
[tester::#JM1] Failed to connect to port 6379, retrying in 1s
[tester::#JM1] Failed to connect to port 6379, retrying in 1s
[tester::#JM1] Failed to connect to port 6379, retrying in 1s
Expand Down
Loading
Loading