Skip to content

Commit 5ce3f0f

Browse files
authored
test(queue/sql): add comprehensive e2e integration tests (#35)
## Summary ## Why? The SQL queue implementation needs comprehensive integration testing against real MySQL to verify production-like behavior including message workflows, partition management, retries, DLQ handling, and consumer group coordination. ## What? - Add 15 e2e integration tests using testcontainers-go covering: basic ops, partitions, visibility timeout, retries, DLQ, concurrency, crash recovery, and consumer groups - Refactor test infrastructure: extract MySQL utilities to `testutil/mysql.go` for reusability across test suites - Add `integration_tests/queue/README.md` documenting test coverage and running instructions ## Test Plan `bazel test //integration_tests/queue:queue_test` ## Issues
1 parent 462f8e4 commit 5ce3f0f

9 files changed

Lines changed: 1442 additions & 165 deletions

File tree

integration_tests/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ load("@rules_go//go:def.bzl", "go_test")
55
go_test(
66
name = "integration_test",
77
srcs = [
8-
"mysql.go",
98
"servers.go",
109
"suite_test.go",
1110
],
@@ -18,6 +17,7 @@ go_test(
1817
],
1918
tags = ["integration"],
2019
deps = [
20+
"//integration_tests/testutil",
2121
"//gateway/protopb",
2222
"//orchestrator/protopb",
2323
"//speculator/protopb",

integration_tests/mysql.go

Lines changed: 0 additions & 123 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
load("@rules_go//go:def.bzl", "go_test")
2+
3+
go_test(
4+
name = "queue_test",
5+
srcs = ["queue_test.go"],
6+
data = [
7+
"//extensions/queue/sql/schema",
8+
],
9+
tags = ["integration"],
10+
deps = [
11+
"//entities/queue",
12+
"//extensions/queue",
13+
"//extensions/queue/sql",
14+
"//integration_tests/testutil",
15+
"@com_github_go_sql_driver_mysql//:mysql",
16+
"@com_github_stretchr_testify//assert",
17+
"@com_github_stretchr_testify//require",
18+
"@com_github_stretchr_testify//suite",
19+
"@com_github_testcontainers_testcontainers_go//:testcontainers-go",
20+
"@com_github_testcontainers_testcontainers_go//network",
21+
"@com_github_testcontainers_testcontainers_go_modules_mysql//:mysql",
22+
"@com_github_uber_go_tally_v4//:tally",
23+
"@org_uber_go_zap//zaptest",
24+
],
25+
)

0 commit comments

Comments
 (0)