498b235461
Build and test / Build and test AMD64 Ubuntu 22.04 (push) Failing after 0s
Publish Builder / amazonlinux2023 (push) Failing after 1s
Build and test / UT for Go (push) Has been skipped
Publish KRTE Images / KRTE (push) Failing after 1s
Build and test / Integration Test (push) Has been skipped
Build and test / Upload Code Coverage (push) Has been skipped
Publish Builder / rockylinux9 (push) Failing after 1s
Publish Builder / ubuntu22.04 (push) Failing after 0s
Publish Builder / ubuntu24.04 (push) Failing after 0s
Publish Gpu Builder / publish-gpu-builder (push) Failing after 1s
Publish Test Images / PyTest (push) Failing after 0s
Build and test / UT for Cpp (push) Has been cancelled
31 lines
1.2 KiB
Go
31 lines
1.2 KiB
Go
package adaptor
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/apache/pulsar-client-go/pulsar"
|
|
"github.com/stretchr/testify/assert"
|
|
wp "github.com/zilliztech/woodpecker/woodpecker/log"
|
|
|
|
msgkafka "github.com/milvus-io/milvus/pkg/v3/streaming/walimpls/impls/kafka"
|
|
msgpulsar "github.com/milvus-io/milvus/pkg/v3/streaming/walimpls/impls/pulsar"
|
|
"github.com/milvus-io/milvus/pkg/v3/streaming/walimpls/impls/rmq"
|
|
msgwoodpecker "github.com/milvus-io/milvus/pkg/v3/streaming/walimpls/impls/wp"
|
|
)
|
|
|
|
func TestIDConvension(t *testing.T) {
|
|
id := MustGetMessageIDFromMQWrapperID(MustGetMQWrapperIDFromMessage(rmq.NewRmqID(1)))
|
|
assert.True(t, id.EQ(rmq.NewRmqID(1)))
|
|
|
|
msgID := pulsar.EarliestMessageID()
|
|
id = MustGetMessageIDFromMQWrapperID(MustGetMQWrapperIDFromMessage(msgpulsar.NewPulsarID(msgID)))
|
|
assert.True(t, id.EQ(msgpulsar.NewPulsarID(msgID)))
|
|
|
|
kafkaID := MustGetMessageIDFromMQWrapperID(MustGetMQWrapperIDFromMessage(msgkafka.NewKafkaID(1)))
|
|
assert.True(t, kafkaID.EQ(msgkafka.NewKafkaID(1)))
|
|
|
|
logMsgId := wp.EarliestLogMessageID()
|
|
wpID := MustGetMessageIDFromMQWrapperID(MustGetMQWrapperIDFromMessage(msgwoodpecker.NewWpID(&logMsgId)))
|
|
assert.True(t, wpID.EQ(msgwoodpecker.NewWpID(&logMsgId)))
|
|
}
|