Skip to content

Commit

Permalink
Update bootstrap server's broker
Browse files Browse the repository at this point in the history
  • Loading branch information
deadlycoconuts committed Aug 7, 2024
1 parent b7c0e05 commit 958d6d0
Showing 1 changed file with 1 addition and 85 deletions.
86 changes: 1 addition & 85 deletions treatment-service/integration-test/fetch_treatment_it_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,90 +401,6 @@ func (suite *TreatmentServiceTestSuite) SetupSuite() {
}
fmt.Println(kafkaAddress)

//pinger, err := probing.NewPinger(pubsubEmulatorAddress)
//if err != nil {
// fmt.Println(err)
//} else {
// pinger.Count = 3
// err = pinger.Run() // Blocks until finished.
// if err != nil {
// fmt.Println(err)
// } else {
// stats := pinger.Statistics()
// fmt.Println(stats) // get send/receive/duplicate/rtt stats
// }
//}
//
//pinger, err = probing.NewPinger(kafkaAddress)
//if err != nil {
// fmt.Println(err)
//} else {
// pinger.Count = 3
// err = pinger.Run() // Blocks until finished.
// if err != nil {
// fmt.Println(err)
// } else {
// stats := pinger.Statistics()
// fmt.Println(stats) // get send/receive/duplicate/rtt stats
// }
//}

// Docker compose file copied from official confluentinc repository.
// See: https://github.com/confluentinc/cp-all-in-one/blob/7.0.1-post/cp-all-in-one-kraft/docker-compose.yml
//composeFilePaths := []string{"docker-compose/kafka/docker-compose.yaml"}
//kafka, err := compose.NewDockerComposeWith(compose.WithStackFiles(composeFilePaths...), compose.StackIdentifier("kafka"))
//if err != nil {
// panic(err)
//}
//err = kafka.Up(ctx, compose.Wait(true))
//if err != nil {
// panic(err)
//}
//fmt.Println(kafka)
//if kafka != nil {
// kafkaContainer, err := kafka.ServiceContainer(ctx, "kafka")
// if err != nil {
// panic(err)
// }
// kafkaNetworks, err := kafkaContainer.Networks(ctx)
// if err != nil {
// panic(err)
// }
// fmt.Println(kafkaNetworks)
// kafkaInfo, err := kafkaContainer.Inspect(ctx)
// if err != nil {
// panic(err)
// }
// fmt.Println(kafkaInfo.NetworkSettings.Networks)
// fmt.Println(kafkaInfo.NetworkSettings.Networks["kafka_default"])
// fmt.Println(kafkaInfo.NetworkSettings.Networks["kafka_default"].IPAddress)
// fmt.Println(kafkaInfo.NetworkSettings.Ports)
// fmt.Println(kafkaInfo.State)
// kafkaHost, err := kafkaContainer.Host(ctx)
// if err != nil {
// panic(err)
// }
// fmt.Println(kafkaHost)
// kafkaPort, err := kafkaContainer.MappedPort(ctx, "9092")
// if err != nil {
// panic(err)
// }
// fmt.Println(kafkaPort)
// pinger, err := probing.NewPinger(fmt.Sprintf("localhost:%s", kafkaPort.Port()))
// if err != nil {
// panic(err)
// }
// pinger.Count = 3
// err = pinger.Run() // Blocks until finished.
// if err != nil {
// panic(err)
// }
// stats := pinger.Statistics()
// fmt.Println(stats) // get send/receive/duplicate/rtt stats
//
// os.Setenv("ASSIGNEDTREATMENTLOGGER_KAFKACONFIG_BROKERS", fmt.Sprintf("localhost:%s", kafkaPort.Port()))
//}

os.Setenv("ASSIGNEDTREATMENTLOGGER_KAFKACONFIG_BROKERS", kafkaAddress)
suite.kafka = kafkaContainer

Expand Down Expand Up @@ -560,7 +476,7 @@ func (suite *TreatmentServiceTestSuite) TestAdditionalFilters() {

consumer, err := kafka.NewConsumer(
&kafka.ConfigMap{
"bootstrap.servers": "localhost:9092",
"bootstrap.servers": "localhost:9093",
"group.id": "test-group",
"default.topic.config": kafka.ConfigMap{"auto.offset.reset": "earliest"},
})
Expand Down

0 comments on commit 958d6d0

Please sign in to comment.