From 6ed6dc8112b78ad35ba9f33f9dae286b137185f7 Mon Sep 17 00:00:00 2001 From: streamnativebot Date: Wed, 22 Apr 2026 14:19:06 +0000 Subject: [PATCH 1/3] "Created by snbot" --- scripts/run-integration-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-integration-tests.sh b/scripts/run-integration-tests.sh index 9d60043e..4bd85112 100755 --- a/scripts/run-integration-tests.sh +++ b/scripts/run-integration-tests.sh @@ -3,7 +3,7 @@ set -e readonly PROJECT_ROOT=`cd $(dirname $0)/..; pwd` readonly IMAGE_NAME=pulsarctl-test -readonly PULSAR_DEFAULT_VERSION="4.1.3" +readonly PULSAR_DEFAULT_VERSION="4.2.0.5" readonly PULSAR_VERSION=${PULSAR_VERSION:-${PULSAR_DEFAULT_VERSION}} readonly PULSAR_IMAGE=${PULSAR_IMAGE:-"apachepulsar/pulsar-all"} From 3062ed90ccd67d0eaaba154455d6d3731316a1f2 Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Thu, 23 Apr 2026 20:12:17 +0800 Subject: [PATCH 2/3] fix test --- pkg/ctl/namespace/clusters_test.go | 19 ++++++++++++------- pkg/ctl/namespace/create_test.go | 5 +++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/pkg/ctl/namespace/clusters_test.go b/pkg/ctl/namespace/clusters_test.go index f4a28619..8b8cc815 100644 --- a/pkg/ctl/namespace/clusters_test.go +++ b/pkg/ctl/namespace/clusters_test.go @@ -56,20 +56,25 @@ func TestClusters(t *testing.T) { assert.True(t, strings.Contains(getOut.String(), "test-replication-cluster")) // reset namespace clusters for other test case - updateTenantArgs = []string{"update", "--allowed-clusters", "standalone", "public"} - _, execErr, _, err = tenant.TestTenantCommands(tenant.UpdateTenantCmd, updateTenantArgs) - assert.Nil(t, err) - assert.Nil(t, execErr) - setArgs = []string{"set-clusters", "public/test-cluster-namespace", "--clusters", "standalone"} setOut, execErr, _, _ = TestNamespaceCommands(setReplicationClusters, setArgs) assert.Nil(t, execErr) assert.Equal(t, setOut.String(), "Set replication clusters successfully for public/test-cluster-namespace\n") + + updateTenantArgs = []string{"update", "--allowed-clusters", "standalone", "public"} + _, execErr, _, err = tenant.TestTenantCommands(tenant.UpdateTenantCmd, updateTenantArgs) + assert.Nil(t, err) + assert.Nil(t, execErr) } func TestFailureCluster(t *testing.T) { - setArgs := []string{"set-clusters", "public/test-cluster-namespace", "--clusters", "invalid-cluster"} - _, execErr, _, _ := TestNamespaceCommands(setReplicationClusters, setArgs) + args := []string{"create", "public/test-cluster-namespace-failure"} + _, execErr, _, err := TestNamespaceCommands(createNs, args) + assert.Nil(t, err) + assert.Nil(t, execErr) + + setArgs := []string{"set-clusters", "public/test-cluster-namespace-failure", "--clusters", "invalid-cluster"} + _, execErr, _, _ = TestNamespaceCommands(setReplicationClusters, setArgs) assert.NotNil(t, execErr) assert.Equal(t, execErr.Error(), "code: 403 reason: Invalid cluster id: invalid-cluster") } diff --git a/pkg/ctl/namespace/create_test.go b/pkg/ctl/namespace/create_test.go index db0e32aa..48db912f 100644 --- a/pkg/ctl/namespace/create_test.go +++ b/pkg/ctl/namespace/create_test.go @@ -130,6 +130,11 @@ func TestCreateNsForCluster(t *testing.T) { assert.Equal(t, "test-cluster", police.ReplicationClusters[0]) // reset namespace clusters for other test case + resetNsArgs := []string{"set-clusters", "public/test-namespace-cluster", "--clusters", "standalone"} + _, execErr, _, err = TestNamespaceCommands(setReplicationClusters, resetNsArgs) + assert.Nil(t, err) + assert.Nil(t, execErr) + updateTenantArgs = []string{"update", "--allowed-clusters", "standalone", "public"} _, execErr, _, err = tenant.TestTenantCommands(tenant.UpdateTenantCmd, updateTenantArgs) assert.Nil(t, err) From 765169d976b4e1acac5e9ce085196c308ac02740 Mon Sep 17 00:00:00 2001 From: Jiwei Guo Date: Thu, 23 Apr 2026 20:32:54 +0800 Subject: [PATCH 3/3] fix test --- .github/workflows/ci-auth-checks.yml | 5 ++--- .github/workflows/ci-checks.yml | 3 +-- .github/workflows/ci-functions-checks.yml | 9 +++------ .github/workflows/ci-install-script-checks.yml | 1 - .github/workflows/ci-packages-checks.yml | 3 +-- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-auth-checks.yml b/.github/workflows/ci-auth-checks.yml index 7c5b7a50..0541a462 100644 --- a/.github/workflows/ci-auth-checks.yml +++ b/.github/workflows/ci-auth-checks.yml @@ -13,13 +13,12 @@ jobs: steps: - uses: actions/checkout@v2 - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Run token tests run: scripts/run-integration-tests.sh token env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all - name: Run TLS tests run: scripts/run-integration-tests.sh tls env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml index fca8ca51..c10318f2 100644 --- a/.github/workflows/ci-checks.yml +++ b/.github/workflows/ci-checks.yml @@ -12,10 +12,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - uses: actions/checkout@v2 - name: Run tests run: scripts/run-integration-tests.sh env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all diff --git a/.github/workflows/ci-functions-checks.yml b/.github/workflows/ci-functions-checks.yml index c3333b00..d4199c01 100644 --- a/.github/workflows/ci-functions-checks.yml +++ b/.github/workflows/ci-functions-checks.yml @@ -12,7 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v6 @@ -24,7 +23,7 @@ jobs: - name: Function tests run: scripts/run-integration-tests.sh function env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all - name: Setup tmate session if: failure() uses: mxschmitt/action-tmate@v3 @@ -32,7 +31,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v6 @@ -44,12 +42,11 @@ jobs: - name: Sink tests run: scripts/run-integration-tests.sh sink env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all source-tests: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v6 @@ -61,4 +58,4 @@ jobs: - name: Source tests run: scripts/run-integration-tests.sh source env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all diff --git a/.github/workflows/ci-install-script-checks.yml b/.github/workflows/ci-install-script-checks.yml index 3bba5276..aba93c6a 100644 --- a/.github/workflows/ci-install-script-checks.yml +++ b/.github/workflows/ci-install-script-checks.yml @@ -11,7 +11,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Check out code into the Go module directory uses: actions/checkout@v2 diff --git a/.github/workflows/ci-packages-checks.yml b/.github/workflows/ci-packages-checks.yml index c2b69b9c..3b7277d5 100644 --- a/.github/workflows/ci-packages-checks.yml +++ b/.github/workflows/ci-packages-checks.yml @@ -12,7 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Login SN docker hub - if: github.actor == 'streamnativebot' run: docker login -u="${{ secrets.DOCKER_USER }}" -p="${{ secrets.DOCKER_PASSWORD}}" - name: Set up Go 1.25.9 uses: actions/setup-go@v5 @@ -24,7 +23,7 @@ jobs: - name: Packages tests run: scripts/run-integration-tests.sh packages env: - PULSAR_IMAGE: ${{ github.actor == 'streamnativebot' && 'snstage/pulsar-all' || 'apachepulsar/pulsar-all' }} + PULSAR_IMAGE: snstage/pulsar-all - name: Setup tmate session if: failure() uses: mxschmitt/action-tmate@v3