Skip to content

Commit

Permalink
refactor: update all stages to use full response payload while loggin…
Browse files Browse the repository at this point in the history
…g out hexdump
  • Loading branch information
ryan-gang committed Oct 28, 2024
1 parent baa4c1c commit 93a2424
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions internal/stage5.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ func testAPIVersion(stageHarness *test_case_harness.TestCaseHarness) error {
if err != nil {
return err
}
logger.Debugf("Hexdump of received \"ApiVersions\" response: \n%v\n", GetFormattedHexdump(response))
logger.Debugf("Hexdump of received \"ApiVersions\" response: \n%v\n", GetFormattedHexdump(response.RawBytes))

responseHeader, responseBody, err := kafkaapi.DecodeApiVersionsHeaderAndResponse(response, 3, logger)
responseHeader, responseBody, err := kafkaapi.DecodeApiVersionsHeaderAndResponse(response.Payload, 3, logger)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/stagec1.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ func testSequentialRequests(stageHarness *test_case_harness.TestCaseHarness) err
if err != nil {
return err
}
logger.Debugf("Hexdump of received \"ApiVersions\" response: \n%v\n", GetFormattedHexdump(response))
logger.Debugf("Hexdump of received \"ApiVersions\" response: \n%v\n", GetFormattedHexdump(response.RawBytes))

responseHeader, responseBody, err := kafkaapi.DecodeApiVersionsHeaderAndResponse(response, 3, logger)
responseHeader, responseBody, err := kafkaapi.DecodeApiVersionsHeaderAndResponse(response.Payload, 3, logger)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/stagec2.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ func testConcurrentRequests(stageHarness *test_case_harness.TestCaseHarness) err
if err != nil {
return err
}
logger.Debugf("Hexdump of received \"ApiVersions\" response: \n%v\n", GetFormattedHexdump(response))
logger.Debugf("Hexdump of received \"ApiVersions\" response: \n%v\n", GetFormattedHexdump(response.RawBytes))

responseHeader, responseBody, err := kafkaapi.DecodeApiVersionsHeaderAndResponse(response, 3, logger)
responseHeader, responseBody, err := kafkaapi.DecodeApiVersionsHeaderAndResponse(response.Payload, 3, logger)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/stagef1.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ func testAPIVersionwFetchKey(stageHarness *test_case_harness.TestCaseHarness) er
if err != nil {
return err
}
logger.Debugf("Hexdump of received \"ApiVersions\" response: \n%v\n", GetFormattedHexdump(response))
logger.Debugf("Hexdump of received \"ApiVersions\" response: \n%v\n", GetFormattedHexdump(response.RawBytes))

responseHeader, responseBody, err := kafkaapi.DecodeApiVersionsHeaderAndResponse(response, 3, logger)
responseHeader, responseBody, err := kafkaapi.DecodeApiVersionsHeaderAndResponse(response.Payload, 3, logger)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/stagef2.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ func testFetchWithNoTopics(stageHarness *test_case_harness.TestCaseHarness) erro
if err != nil {
return err
}
logger.Debugf("Hexdump of received \"Fetch\" response: \n%v\n", GetFormattedHexdump(response))
logger.Debugf("Hexdump of received \"Fetch\" response: \n%v\n", GetFormattedHexdump(response.RawBytes))

responseHeader, responseBody, err := kafkaapi.DecodeFetchHeaderAndResponse(response, 16, logger)
responseHeader, responseBody, err := kafkaapi.DecodeFetchHeaderAndResponse(response.Payload, 16, logger)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/stagef3.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ func testFetchWithUnkownTopicID(stageHarness *test_case_harness.TestCaseHarness)
if err != nil {
return err
}
logger.Debugf("Hexdump of received \"Fetch\" response: \n%v\n", GetFormattedHexdump(response))
logger.Debugf("Hexdump of received \"Fetch\" response: \n%v\n", GetFormattedHexdump(response.RawBytes))

responseHeader, responseBody, err := kafkaapi.DecodeFetchHeaderAndResponse(response, 16, logger)
responseHeader, responseBody, err := kafkaapi.DecodeFetchHeaderAndResponse(response.Payload, 16, logger)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/stagef4.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ func testFetchNoMessages(stageHarness *test_case_harness.TestCaseHarness) error
if err != nil {
return err
}
logger.Debugf("Hexdump of received \"Fetch\" response: \n%v\n", GetFormattedHexdump(response))
logger.Debugf("Hexdump of received \"Fetch\" response: \n%v\n", GetFormattedHexdump(response.RawBytes))

responseHeader, responseBody, err := kafkaapi.DecodeFetchHeaderAndResponse(response, 16, logger)
responseHeader, responseBody, err := kafkaapi.DecodeFetchHeaderAndResponse(response.Payload, 16, logger)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/stagef5.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ func testFetchWithSingleMessage(stageHarness *test_case_harness.TestCaseHarness)
if err != nil {
return err
}
logger.Debugf("Hexdump of received \"Fetch\" response: \n%v\n", GetFormattedHexdump(response))
logger.Debugf("Hexdump of received \"Fetch\" response: \n%v\n", GetFormattedHexdump(response.RawBytes))

responseHeader, responseBody, err := kafkaapi.DecodeFetchHeaderAndResponse(response, 16, logger)
responseHeader, responseBody, err := kafkaapi.DecodeFetchHeaderAndResponse(response.Payload, 16, logger)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/stagef6.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ func testFetchMultipleMessages(stageHarness *test_case_harness.TestCaseHarness)
if err != nil {
return err
}
logger.Debugf("Hexdump of received \"Fetch\" response: \n%v\n", GetFormattedHexdump(response))
logger.Debugf("Hexdump of received \"Fetch\" response: \n%v\n", GetFormattedHexdump(response.RawBytes))

responseHeader, responseBody, err := kafkaapi.DecodeFetchHeaderAndResponse(response, 16, logger)
responseHeader, responseBody, err := kafkaapi.DecodeFetchHeaderAndResponse(response.Payload, 16, logger)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/stagep1.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ func testAPIVersionwDescribeTopicPartitions(stageHarness *test_case_harness.Test
if err != nil {
return err
}
logger.Debugf("Hexdump of received \"ApiVersions\" response: \n%v\n", GetFormattedHexdump(response))
logger.Debugf("Hexdump of received \"ApiVersions\" response: \n%v\n", GetFormattedHexdump(response.RawBytes))

responseHeader, responseBody, err := kafkaapi.DecodeApiVersionsHeaderAndResponse(response, 3, logger)
responseHeader, responseBody, err := kafkaapi.DecodeApiVersionsHeaderAndResponse(response.Payload, 3, logger)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/stagep2.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ func testDTPartitionWithUnknownTopic(stageHarness *test_case_harness.TestCaseHar
if err != nil {
return err
}
logger.Debugf("Hexdump of received \"DescribeTopicPartitions\" response: \n%v\n", GetFormattedHexdump(response))
logger.Debugf("Hexdump of received \"DescribeTopicPartitions\" response: \n%v\n", GetFormattedHexdump(response.RawBytes))

responseHeader, responseBody, err := kafkaapi.DecodeDescribeTopicPartitionsHeaderAndResponse(response, logger)
responseHeader, responseBody, err := kafkaapi.DecodeDescribeTopicPartitionsHeaderAndResponse(response.Payload, logger)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/stagep3.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ func testDTPartitionWithTopicAndSinglePartition(stageHarness *test_case_harness.
if err != nil {
return err
}
logger.Debugf("Hexdump of received \"DescribeTopicPartitions\" response: \n%v\n", GetFormattedHexdump(response))
logger.Debugf("Hexdump of received \"DescribeTopicPartitions\" response: \n%v\n", GetFormattedHexdump(response.RawBytes))

responseHeader, responseBody, err := kafkaapi.DecodeDescribeTopicPartitionsHeaderAndResponse(response, logger)
responseHeader, responseBody, err := kafkaapi.DecodeDescribeTopicPartitionsHeaderAndResponse(response.Payload, logger)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/stagep4.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ func testDTPartitionWithTopicAndMultiplePartitions2(stageHarness *test_case_harn
if err != nil {
return err
}
logger.Debugf("Hexdump of received \"DescribeTopicPartitions\" response: \n%v\n", GetFormattedHexdump(response))
logger.Debugf("Hexdump of received \"DescribeTopicPartitions\" response: \n%v\n", GetFormattedHexdump(response.RawBytes))

responseHeader, responseBody, err := kafkaapi.DecodeDescribeTopicPartitionsHeaderAndResponse(response, logger)
responseHeader, responseBody, err := kafkaapi.DecodeDescribeTopicPartitionsHeaderAndResponse(response.Payload, logger)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/stagep5.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ func testDTPartitionWithTopics(stageHarness *test_case_harness.TestCaseHarness)
if err != nil {
return err
}
logger.Debugf("Hexdump of received \"DescribeTopicPartitions\" response: \n%v\n", GetFormattedHexdump(response))
logger.Debugf("Hexdump of received \"DescribeTopicPartitions\" response: \n%v\n", GetFormattedHexdump(response.RawBytes))

responseHeader, responseBody, err := kafkaapi.DecodeDescribeTopicPartitionsHeaderAndResponse(response, logger)
responseHeader, responseBody, err := kafkaapi.DecodeDescribeTopicPartitionsHeaderAndResponse(response.Payload, logger)
if err != nil {
return err
}
Expand Down

0 comments on commit 93a2424

Please sign in to comment.