Skip to content

Commit 27c6cef

Browse files
authored
Merge pull request #179 from codecrafters-io/deps-upgrade
Update dependencies + Go version
2 parents f6ce782 + a2fbc3f commit 27c6cef

File tree

20 files changed

+4991
-4989
lines changed

20 files changed

+4991
-4989
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Checkout
10-
uses: actions/checkout@v2
10+
uses: actions/checkout@v4
1111
- name: Set up Go
12-
uses: actions/setup-go@v1
12+
uses: actions/setup-go@v4
1313
with:
14-
go-version: 1.21.x
14+
go-version: 1.24.x
1515

1616
# Required for tests
1717
- name: Install Redis
@@ -35,14 +35,14 @@ jobs:
3535
runs-on: ubuntu-latest
3636
steps:
3737
- name: Checkout
38-
uses: actions/checkout@v2
38+
uses: actions/checkout@v4
3939

4040
- name: Set up Go
41-
uses: actions/setup-go@v1
41+
uses: actions/setup-go@v5
4242
with:
43-
go-version: 1.21.x
43+
go-version: 1.24.x
4444

45-
- uses: dominikh/[email protected].0
45+
- uses: dominikh/[email protected].1
4646
with:
47-
version: "2023.1"
47+
version: "2025.1.1"
4848
install-go: false

go.mod

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
module github.com/codecrafters-io/redis-tester
22

3-
go 1.21
3+
go 1.24
4+
5+
toolchain go1.24.2
46

57
require (
6-
github.com/codecrafters-io/tester-utils v0.2.38
8+
github.com/codecrafters-io/tester-utils v0.4.2
79
github.com/go-redis/redis v6.15.9+incompatible
8-
github.com/hdt3213/rdb v1.0.18
9-
github.com/stretchr/testify v1.9.0
10+
github.com/hdt3213/rdb v1.1.0
11+
github.com/stretchr/testify v1.10.0
1012
gopkg.in/yaml.v3 v3.0.1
1113
)
1214

1315
require (
1416
github.com/davecgh/go-spew v1.1.1 // indirect
15-
github.com/fatih/color v1.17.0 // indirect
16-
github.com/mattn/go-colorable v0.1.13 // indirect
17+
github.com/fatih/color v1.18.0 // indirect
18+
github.com/mattn/go-colorable v0.1.14 // indirect
1719
github.com/mattn/go-isatty v0.0.20 // indirect
1820
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
1921
github.com/onsi/ginkgo v1.11.0 // indirect
2022
github.com/onsi/gomega v1.8.1 // indirect
2123
github.com/pmezard/go-difflib v1.0.0 // indirect
22-
golang.org/x/sys v0.25.0 // indirect
24+
golang.org/x/sys v0.33.0 // indirect
2325
gopkg.in/yaml.v2 v2.4.0 // indirect
2426
)
2527

go.sum

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,26 @@ github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F
66
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
77
github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=
88
github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=
9-
github.com/codecrafters-io/tester-utils v0.2.38 h1:rKxm02A4Ll6gGrwcsGKDHxZExjH4hMbtu2ra7r/E7Lk=
10-
github.com/codecrafters-io/tester-utils v0.2.38/go.mod h1:VgP0WmmRsA8L1urWGMXPW4Zv5jcwHwR0LdKZ8ZAEFT4=
9+
github.com/codecrafters-io/tester-utils v0.4.2 h1:WwSq/2uEQDPRQuTZtjeswwbzqNoI9cNYPTAY6qYRA4Q=
10+
github.com/codecrafters-io/tester-utils v0.4.2/go.mod h1:Fyrv4IebzjWtvKfpYf8ooYDoOtjYe2qx8bV7KAJpX+w=
1111
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1212
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
1313
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
14-
github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
15-
github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
14+
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
15+
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
1616
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
1717
github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg=
1818
github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
1919
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
20-
github.com/hdt3213/rdb v1.0.18 h1:mfYKZBkowTWR8uNWUnvL48GsE7RdDH1i7mnDa/eFwzc=
21-
github.com/hdt3213/rdb v1.0.18/go.mod h1:p2O7ep2/CDdaZt4gywZevL6Vdjash4+imZ0wpinogm8=
20+
github.com/hdt3213/rdb v1.1.0 h1:PntkgzBCK5Ss4lncvKAQnWHqb7bCR50/d7LZmNHHk3k=
21+
github.com/hdt3213/rdb v1.1.0/go.mod h1:p2O7ep2/CDdaZt4gywZevL6Vdjash4+imZ0wpinogm8=
2222
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
2323
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
2424
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
2525
github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
2626
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
27-
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
28-
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
29-
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
27+
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
28+
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
3029
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
3130
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
3231
github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU=
@@ -45,21 +44,20 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
4544
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
4645
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
4746
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
48-
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
49-
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
47+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
48+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
5049
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
5150
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
5251
golang.org/x/arch v0.9.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
5352
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA=
5453
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
5554
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
5655
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
57-
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5856
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5957
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
6058
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
61-
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
62-
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
59+
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
60+
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
6361
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
6462
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
6563
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc=

internal/rdb_file_creator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"path/filepath"
77

88
"github.com/codecrafters-io/tester-utils/logger"
9-
testerutils_random "github.com/codecrafters-io/tester-utils/random"
9+
"github.com/codecrafters-io/tester-utils/random"
1010
"github.com/codecrafters-io/tester-utils/test_case_harness"
1111

1212
"github.com/hdt3213/rdb/encoder"
@@ -39,7 +39,7 @@ func NewRDBFileCreator() (*RDBFileCreator, error) {
3939

4040
return &RDBFileCreator{
4141
Dir: realDir,
42-
Filename: fmt.Sprintf("%s.rdb", testerutils_random.RandomWord()),
42+
Filename: fmt.Sprintf("%s.rdb", random.RandomWord()),
4343
}, nil
4444
}
4545

internal/rdb_file_creator_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ import (
66
"path/filepath"
77
"testing"
88

9-
testerutils_random "github.com/codecrafters-io/tester-utils/random"
9+
"github.com/codecrafters-io/tester-utils/random"
1010
"github.com/stretchr/testify/assert"
1111
)
1212

1313
func TestRDBFileCreator(t *testing.T) {
14+
random.Init()
15+
1416
RDBFileCreator, err := NewRDBFileCreator()
1517
if err != nil {
1618
t.Fatalf("CodeCrafters Tester Error: %s", err)
1719
}
1820

19-
randomKeyAndValue := testerutils_random.RandomWords(2)
21+
randomKeyAndValue := random.RandomWords(2)
2022
randomKey, randomValue := randomKeyAndValue[0], randomKeyAndValue[1]
2123

2224
if err := RDBFileCreator.Write([]KeyValuePair{{key: randomKey, value: randomValue}}); err != nil {

internal/redis_executable/redis_executable.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func NewRedisExecutable(stageHarness *test_case_harness.TestCaseHarness) *RedisE
2929

3030
func (b *RedisExecutable) Run(args ...string) error {
3131
b.args = args
32-
if b.args == nil || len(b.args) == 0 {
32+
if len(b.args) == 0 {
3333
b.logger.Infof("$ ./%s", path.Base(b.executable.Path))
3434
} else {
3535
var log string
@@ -41,7 +41,7 @@ func (b *RedisExecutable) Run(args ...string) error {
4141
log += " " + arg
4242
}
4343
}
44-
b.logger.Infof(log)
44+
b.logger.Infof("%s", log)
4545
}
4646

4747
if err := b.executable.Start(b.args...); err != nil {

internal/stages_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func normalizeTesterOutput(testerOutput []byte) []byte {
114114
"xadd_id": {regexp.MustCompile(`\d{13}-\d+`)},
115115
"rdb_bytes": {regexp.MustCompile(`"\$[0-9]+\\r\\nREDIS.*"`)},
116116
"info_replication_bytes": {regexp.MustCompile(`"\$[0-9]+\\r\\n# Replication\\r\\n[^"]+"`)},
117-
"rdb_keys": {regexp.MustCompile(`\[stage-11\] .*Received .*`)},
117+
"rdb_keys": {regexp.MustCompile(`\[tester::#JW4\] .*Received .*`)},
118118
"hexdump": {regexp.MustCompile(`[0-9a-fA-F]{4} \| [0-9a-fA-F ]{47} \| .{0,16}`)},
119119
}
120120

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[stage-1] Running tests for Stage #1: jm1
2-
[stage-1] $ ./spawn_redis_server.sh
3-
[stage-1] Connecting to port 6379...
1+
[tester::#JM1] Running tests for Stage #JM1 (jm1)
2+
[tester::#JM1] $ ./spawn_redis_server.sh
3+
[tester::#JM1] Connecting to port 6379...
44
[your_program] hey, not going to bind!
5-
[stage-1] Failed to connect to port 6379.
6-
[stage-1] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)
5+
[tester::#JM1] Failed to connect to port 6379.
6+
[tester::#JM1] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Debug = true
22

3-
[stage-1] Running tests for Stage #1: jm1
4-
[stage-1] $ ./spawn_redis_server.sh
5-
[stage-1] Connecting to port 6379...
3+
[tester::#JM1] Running tests for Stage #JM1 (jm1)
4+
[tester::#JM1] $ ./spawn_redis_server.sh
5+
[tester::#JM1] Connecting to port 6379...
66
[your_program] hey, binding to 6379
7-
[stage-1] Connection successful
8-
[stage-1] Test passed.
9-
[stage-1] Terminating program
10-
[stage-1] Program terminated successfully
7+
[tester::#JM1] Connection successful
8+
[tester::#JM1] Test passed.
9+
[tester::#JM1] Terminating program
10+
[tester::#JM1] Program terminated successfully
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
[stage-1] Running tests for Stage #1: jm1
2-
[stage-1] $ ./spawn_redis_server.sh
3-
[stage-1] Connecting to port 6379...
1+
[tester::#JM1] Running tests for Stage #JM1 (jm1)
2+
[tester::#JM1] $ ./spawn_redis_server.sh
3+
[tester::#JM1] Connecting to port 6379...
44
[your_program] hey, not going to bind!
5-
[stage-1] Failed to connect to port 6379, retrying in 1s
6-
[stage-1] Failed to connect to port 6379, retrying in 1s
7-
[stage-1] Failed to connect to port 6379, retrying in 1s
8-
[stage-1] Failed to connect to port 6379, retrying in 1s
9-
[stage-1] Failed to connect to port 6379, retrying in 1s
10-
[stage-1] Failed to connect to port 6379, retrying in 1s
11-
[stage-1] Failed to connect to port 6379, retrying in 1s
12-
[stage-1] Failed to connect to port 6379, retrying in 1s
13-
[stage-1] Failed to connect to port 6379, retrying in 1s
14-
[stage-1] Failed to connect to port 6379, retrying in 1s
15-
[stage-1] Failed to connect to port 6379, retrying in 1s
16-
[stage-1] Failed to connect to port 6379, retrying in 1s
17-
[stage-1] timed out, test exceeded 15 seconds
18-
[stage-1] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)
5+
[tester::#JM1] Failed to connect to port 6379, retrying in 1s
6+
[tester::#JM1] Failed to connect to port 6379, retrying in 1s
7+
[tester::#JM1] Failed to connect to port 6379, retrying in 1s
8+
[tester::#JM1] Failed to connect to port 6379, retrying in 1s
9+
[tester::#JM1] Failed to connect to port 6379, retrying in 1s
10+
[tester::#JM1] Failed to connect to port 6379, retrying in 1s
11+
[tester::#JM1] Failed to connect to port 6379, retrying in 1s
12+
[tester::#JM1] Failed to connect to port 6379, retrying in 1s
13+
[tester::#JM1] Failed to connect to port 6379, retrying in 1s
14+
[tester::#JM1] Failed to connect to port 6379, retrying in 1s
15+
[tester::#JM1] Failed to connect to port 6379, retrying in 1s
16+
[tester::#JM1] Failed to connect to port 6379, retrying in 1s
17+
[tester::#JM1] timed out, test exceeded 15 seconds
18+
[tester::#JM1] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)

0 commit comments

Comments
 (0)