Skip to content

Commit dabfa2f

Browse files
authored
Merge pull request #2174 from redpanda-data/refactor/remove-mobx-from-quotas-page
Remove mobx from quotas page
2 parents b558bcd + 3e1c8ee commit dabfa2f

File tree

18 files changed

+832
-149
lines changed

18 files changed

+832
-149
lines changed

backend/pkg/api/api_integration_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func (s *APIIntegrationTestSuite) SetupSuite() {
6363

6464
ctx := context.Background()
6565
container, err := redpanda.Run(ctx, testutil.RedpandaImage())
66+
testutil.LogContainerLogsIfFailed(ctx, t, container, err)
6667
require.NoError(err)
6768
s.redpandaContainer = container
6869

backend/pkg/api/connect/integration/api_suite_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ func (s *APISuite) SetupSuite() {
7878
network.WithNetwork([]string{"redpanda"}, s.network),
7979
redpanda.WithListener("redpanda:29092"),
8080
)
81+
testutil.LogContainerLogsIfFailed(ctx, t, container, err)
8182
require.NoError(err)
8283
s.redpandaContainer = container
8384

@@ -99,6 +100,7 @@ func (s *APISuite) SetupSuite() {
99100
[]string{"redpanda:29092"},
100101
network.WithNetwork([]string{"kconnect"}, s.network),
101102
)
103+
testutil.LogContainerLogsIfFailed(ctx, t, kConnectContainer, err)
102104
require.NoError(err)
103105

104106
s.kConnectContainer = kConnectContainer

backend/pkg/api/connect/integration/kafkaconnect_v1_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ func (s *APISuite) TestGetConnectorAndStatus_v1() {
132132

133133
// Run HTTPBin container
134134
httpC, err := testutil.RunHTTPBinContainer(ctx, network.WithNetwork([]string{"httpbin", "local-httpbin"}, s.network))
135+
testutil.LogContainerLogsIfFailed(ctx, t, httpC, err)
135136
requireT.NoError(err)
136137

137138
client := v1connect.NewKafkaConnectServiceClient(http.DefaultClient, s.httpAddress())

backend/pkg/api/connect/integration/kafkaconnect_v1alpha2_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ func (s *APISuite) TestGetConnectorAndStatus_v1alpha2() {
132132

133133
// Run HTTPBin container
134134
httpC, err := testutil.RunHTTPBinContainer(ctx, network.WithNetwork([]string{"httpbin", "local-httpbin"}, s.network))
135+
testutil.LogContainerLogsIfFailed(ctx, t, httpC, err)
135136
requireT.NoError(err)
136137

137138
client := v1alpha2connect.NewKafkaConnectServiceClient(http.DefaultClient, s.httpAddress())

backend/pkg/api/handle_kafka_connect_integration_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ func (s *APIIntegrationTestSuite) TestHandleCreateConnector() {
5151
network.WithNetwork([]string{"redpanda"}, testNetwork),
5252
redpanda.WithListener("redpanda:29092"),
5353
)
54+
testutil.LogContainerLogsIfFailed(ctx, t, redpandaContainer, err)
5455
require.NoError(err)
5556

5657
seedBroker, err := redpandaContainer.KafkaSeedBroker(ctx)
@@ -68,6 +69,7 @@ func (s *APIIntegrationTestSuite) TestHandleCreateConnector() {
6869
network.WithNetwork([]string{"kafka-connect"}, testNetwork),
6970
testcontainers.WithLogConsumers(logConsumer),
7071
)
72+
testutil.LogContainerLogsIfFailed(ctx, t, connectContainer, err)
7173
require.NoError(err)
7274

7375
// Register cleanup in correct order: containers first, then network

backend/pkg/console/console_integration_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ func (s *ConsoleIntegrationTestSuite) SetupSuite() {
4848

4949
ctx := context.Background()
5050
container, err := redpanda.Run(ctx, testutil.RedpandaImage())
51+
testutil.LogContainerLogsIfFailed(ctx, t, container, err)
5152
require.NoError(err)
5253
s.redpandaContainer = container
5354

backend/pkg/serde/service_integration_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ func (s *SerdeIntegrationTestSuite) SetupSuite() {
117117
ctx := t.Context()
118118

119119
redpandaContainer, err := redpanda.Run(ctx, testutil.RedpandaImage())
120+
testutil.LogContainerLogsIfFailed(ctx, t, redpandaContainer, err)
120121
require.NoError(err)
121122

122123
s.redpandaContainer = redpandaContainer

backend/pkg/testutil/container.go

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright 2024 Redpanda Data, Inc.
2+
//
3+
// Use of this software is governed by the Business Source License
4+
// included in the file https://github.com/redpanda-data/redpanda/blob/dev/licenses/bsl.md
5+
//
6+
// As of the Change Date specified in that file, in accordance with
7+
// the Business Source License, use of this software will be governed
8+
// by the Apache License, Version 2.0
9+
10+
package testutil
11+
12+
import (
13+
"context"
14+
"io"
15+
"testing"
16+
17+
"github.com/testcontainers/testcontainers-go"
18+
)
19+
20+
// LogContainerLogsIfFailed prints the container's logs to the test output when
21+
// err is non-nil. This is useful for debugging container startup failures in CI,
22+
// where the only clue is "container exited with code X" but no actual logs.
23+
func LogContainerLogsIfFailed(ctx context.Context, t testing.TB, container testcontainers.Container, err error) {
24+
t.Helper()
25+
26+
if err == nil || container == nil {
27+
return
28+
}
29+
30+
rc, logErr := container.Logs(ctx)
31+
if logErr != nil {
32+
t.Logf("failed to retrieve container logs after error: %v", logErr)
33+
return
34+
}
35+
defer rc.Close()
36+
37+
logs, readErr := io.ReadAll(rc)
38+
if readErr != nil {
39+
t.Logf("failed to read container logs after error: %v", readErr)
40+
return
41+
}
42+
43+
t.Logf("container logs (startup error: %v):\n%s", err, string(logs))
44+
}

frontend/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,5 @@ dist
158158

159159
# Gemini CLI
160160
.gemini/settings.json
161+
162+
tests/**/playwright-report/

0 commit comments

Comments
 (0)