Skip to content
Closed
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
5 changes: 2 additions & 3 deletions .github/workflows/ci-auth-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions .github/workflows/ci-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 3 additions & 6 deletions .github/workflows/ci-functions-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,15 +23,14 @@ 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
sink-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
Expand All @@ -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
Expand All @@ -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
1 change: 0 additions & 1 deletion .github/workflows/ci-install-script-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci-packages-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
19 changes: 12 additions & 7 deletions pkg/ctl/namespace/clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
5 changes: 5 additions & 0 deletions pkg/ctl/namespace/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
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="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"}

Expand Down
Loading