Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions pkg/ctl/namespace/split_bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,34 @@ import (
"testing"

"github.com/streamnative/pulsarctl/pkg/ctl/topic"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestSplitBundle(t *testing.T) {
ns := "public/test-split-bundle-ns"

args := []string{"create", ns}
_, execErr, _, _ := TestNamespaceCommands(createNs, args)
assert.Nil(t, execErr)
require.Nil(t, execErr)

args = []string{"split-bundle", ns, "--bundle", "0x80000000_0xc0000000"}
_, execErr, _, _ = TestNamespaceCommands(splitBundle, args)
assert.NotNil(t, execErr)
errMsg := "code: 412 reason: Failed to find ownership for ServiceUnit:" + ns + "/0x80000000_0xc0000000"
assert.Equal(t, execErr.Error(), errMsg)
require.Nil(t, execErr)

args = []string{"create", ns + "/test-topic", "0"}
_, _, argsErr, err := topic.TestTopicCommands(topic.CreateTopicCmd, args)
assert.Nil(t, argsErr)
assert.Nil(t, err)
require.Nil(t, argsErr)
require.Nil(t, err)

args = []string{"bundle-range", ns + "/test-topic"}
out, execErr, _, _ := topic.TestTopicCommands(topic.GetBundleRangeCmd, args)
assert.Nil(t, execErr)
require.Nil(t, execErr)

bundle := strings.Split(out.String(), ":")[2]
bundle = strings.TrimSpace(bundle)

args = []string{"split-bundle", ns, "--bundle", bundle}
splitOut, execErr, _, _ := TestNamespaceCommands(splitBundle, args)
assert.Nil(t, execErr)
assert.Equal(t, splitOut.String(), "Split a namespace bundle: "+bundle+" successfully\n")
require.Nil(t, execErr)
require.Equal(t, splitOut.String(), "Split a namespace bundle: "+bundle+" successfully\n")
}
2 changes: 1 addition & 1 deletion scripts/run-integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e

readonly PROJECT_ROOT=`cd $(dirname $0)/..; pwd`
readonly IMAGE_NAME=pulsarctl-test
readonly PULSAR_DEFAULT_VERSION="2.9.1.2"
readonly PULSAR_DEFAULT_VERSION="2.9.2.9"
readonly PULSAR_VERSION=${PULSAR_VERSION:-${PULSAR_DEFAULT_VERSION}}

docker build --build-arg PULSAR_VERSION=${PULSAR_VERSION} \
Expand Down