Skip to content
Open
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
44 changes: 43 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,17 @@ live-test-auth:
live-test-connect:
@$(MAKE) live-test CLI_LIVE_TEST_GROUPS="connect"

.PHONY: live-test-billing
live-test-billing:
@$(MAKE) live-test CLI_LIVE_TEST_GROUPS="billing"

.PHONY: live-test-flink
live-test-flink:
@$(MAKE) live-test CLI_LIVE_TEST_GROUPS="flink"

.PHONY: live-test-essential
live-test-essential:
@$(MAKE) live-test CLI_LIVE_TEST_GROUPS="core,kafka,schema_registry,auth"
@$(MAKE) live-test CLI_LIVE_TEST_GROUPS="core,kafka,schema_registry,auth,billing"

.PHONY: live-test-multicloud
live-test-multicloud:
Expand All @@ -198,6 +206,23 @@ live-test-resource: build-for-live-test
printf " %-25s %-20s %s\n" "iam_rbac" "iam" "TestRBACRoleBindingCRUDLive"; \
printf " %-25s %-20s %s\n" "login" "auth" "TestLoginLogoutLive"; \
printf " %-25s %-20s %s\n" "connect" "connect" "TestConnectClusterCRUDLive"; \
printf " %-25s %-20s %s\n" "organization" "core" "TestOrganizationLive"; \
printf " %-25s %-20s %s\n" "audit_log" "core" "TestAuditLogLive"; \
printf " %-25s %-20s %s\n" "service_quota" "core" "TestServiceQuotaLive"; \
printf " %-25s %-20s %s\n" "context" "core" "TestContextAndConfigurationLive"; \
printf " %-25s %-20s %s\n" "billing" "billing" "TestBillingLive"; \
printf " %-25s %-20s %s\n" "kafka_region" "kafka" "TestKafkaRegionListLive"; \
printf " %-25s %-20s %s\n" "kafka_quota" "kafka" "TestKafkaQuotaCRUDLive"; \
printf " %-25s %-20s %s\n" "kafka_produce_consume" "kafka" "TestKafkaProduceConsumeLive"; \
printf " %-25s %-20s %s\n" "iam_user" "iam" "TestIAMUserLive"; \
printf " %-25s %-20s %s\n" "iam_ip_group_filter" "iam" "TestIAMIpGroupFilterCRUDLive"; \
printf " %-25s %-20s %s\n" "iam_identity_provider" "iam" "TestIAMIdentityProviderCRUDLive"; \
printf " %-25s %-20s %s\n" "iam_certificate" "iam" "TestIAMCertificateAuthorityCRUDLive"; \
printf " %-25s %-20s %s\n" "connect_custom_plugin" "connect" "TestConnectCustomPluginCRUDLive"; \
printf " %-25s %-20s %s\n" "schema_registry_ext" "schema_registry" "TestSchemaRegistryExtendedLive"; \
printf " %-25s %-20s %s\n" "flink_region" "flink" "TestFlinkRegionListLive"; \
printf " %-25s %-20s %s\n" "plugin" "core" "TestPluginListLive"; \
printf " %-25s %-20s %s\n" "kafka_share_group" "kafka" "TestKafkaShareGroupListLive"; \
echo ""; \
echo "Usage: make live-test-resource RESOURCE=<resource>"; \
else \
Expand All @@ -213,6 +238,23 @@ live-test-resource: build-for-live-test
iam_rbac) GROUP=iam; FUNC=TestRBACRoleBindingCRUDLive;; \
login) GROUP=auth; FUNC=TestLoginLogoutLive;; \
connect) GROUP=connect; FUNC=TestConnectClusterCRUDLive;; \
organization) GROUP=core; FUNC=TestOrganizationLive;; \
audit_log) GROUP=core; FUNC=TestAuditLogLive;; \
service_quota) GROUP=core; FUNC=TestServiceQuotaLive;; \
context) GROUP=core; FUNC=TestContextAndConfigurationLive;; \
billing) GROUP=billing; FUNC=TestBillingLive;; \
kafka_region) GROUP=kafka; FUNC=TestKafkaRegionListLive;; \
kafka_quota) GROUP=kafka; FUNC=TestKafkaQuotaCRUDLive;; \
kafka_produce_consume) GROUP=kafka; FUNC=TestKafkaProduceConsumeLive;; \
iam_user) GROUP=iam; FUNC=TestIAMUserLive;; \
iam_ip_group_filter) GROUP=iam; FUNC=TestIAMIpGroupFilterCRUDLive;; \
iam_identity_provider) GROUP=iam; FUNC=TestIAMIdentityProviderCRUDLive;; \
iam_certificate) GROUP=iam; FUNC=TestIAMCertificateAuthorityCRUDLive;; \
connect_custom_plugin) GROUP=connect; FUNC=TestConnectCustomPluginCRUDLive;; \
schema_registry_ext) GROUP=schema_registry; FUNC=TestSchemaRegistryExtendedLive;; \
flink_region) GROUP=flink; FUNC=TestFlinkRegionListLive;; \
plugin) GROUP=core; FUNC=TestPluginListLive;; \
kafka_share_group) GROUP=kafka; FUNC=TestKafkaShareGroupListLive;; \
*) echo "Unknown resource: $(RESOURCE)"; echo "Run 'make live-test-resource' to see available resources."; exit 1;; \
esac; \
echo "Running $$FUNC (group: $$GROUP)..."; \
Expand Down
75 changes: 58 additions & 17 deletions debian/patches/standard_build_layout.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- cli/Makefile 2026-03-10 12:57:52.531367502 -0500
--- cli/Makefile 2026-03-13 15:10:31.362690984 -0500
+++ debian/Makefile 2025-09-22 13:01:33.829653470 -0500
@@ -1,234 +1,163 @@
@@ -1,276 +1,163 @@
-SHELL := /bin/bash
-GORELEASER_VERSION := v2.13.3
+SHELL=/bin/bash
Expand All @@ -19,8 +19,10 @@
- endif
-else # darwin
- $(MAKE) cli-builder
-endif
-
+ifndef VERSION
+ VERSION=$(CLI_VERSION)
endif

-# Cross-compile from darwin to any of the OS/Arch pairs below
-.PHONY: cross-build
-cross-build:
Expand Down Expand Up @@ -60,10 +62,7 @@
- rm -rf go go-openssl go$$(cat .go-version).src.tar.gz
-else
- TAGS=$(TAGS) CC=$(CC) CXX=$(CXX) CGO_LDFLAGS=$(CGO_LDFLAGS) goreleaser build --clean --single-target --snapshot
+ifndef VERSION
+ VERSION=$(CLI_VERSION)
endif

-endif
+export PACKAGE_TITLE=cli
+export FULL_PACKAGE_TITLE=confluent-$(PACKAGE_TITLE)
+export PACKAGE_NAME=$(FULL_PACKAGE_TITLE)-$(VERSION)
Expand Down Expand Up @@ -142,7 +141,7 @@
+ filepath=windows_amd64/confluent.exe; \
+ curl -fs https://$${baseurl}/confluent-cli/binaries/$(CLI_VERSION)/confluent$${version}_windows_amd64.exe -o $${filepath}; \
+ chmod 755 $${filepath}
+
+ cp LICENSE $(DESTDIR)$(DOCPATH)/LICENSE
+ $(DESTDIR)$(BINPATH)/confluent --version | awk -F' ' '{ print $3 }' > $(DESTDIR)$(DOCPATH)/version.txt

Expand Down Expand Up @@ -254,18 +253,15 @@
-else
- go build -cover -ldflags="-s -w -X main.commit="00000000" -X main.date="1970-01-01T00:00:00Z" -X main.isTest=true" -o test/bin/confluent ./cmd/confluent
-endif
+rpm-build-area: RPM_BUILDING/BUILD RPM_BUILDING/RPMS RPM_BUILDING/SOURCES RPM_BUILDING/SPECS RPM_BUILDING/SRPMS

-
-.PHONY: build-for-integration-test-windows
-build-for-integration-test-windows:
-ifdef CI
- go build -cover -ldflags="-s -w -X main.commit="00000000" -X main.date="1970-01-01T00:00:00Z" -X main.isTest=true" -o test/bin/confluent.exe ./cmd/confluent
-else
- go build -cover -ldflags="-s -w -X main.commit="00000000" -X main.date="1970-01-01T00:00:00Z" -X main.isTest=true" -o test/bin/confluent.exe ./cmd/confluent
-endif
+RPM_BUILDING/%:
+ mkdir -p $@

-
-.PHONY: integration-test
-integration-test:
-ifdef CI
Expand All @@ -280,10 +276,13 @@
- go test -timeout 0 -v $$(go list ./... | grep github.com/confluentinc/cli/v4/test) $(INTEGRATION_TEST_ARGS) && \
- go tool covdata textfmt -i $${GOCOVERDIR} -o coverage.integration.out
-endif
-
+rpm-build-area: RPM_BUILDING/BUILD RPM_BUILDING/RPMS RPM_BUILDING/SOURCES RPM_BUILDING/SPECS RPM_BUILDING/SRPMS

-.PHONY: test
-test: unit-test integration-test
-
+RPM_BUILDING/%:
+ mkdir -p $@

-.PHONY: build-for-live-test
-build-for-live-test:
- go build -ldflags="-s -w -X main.disableUpdates=true" -o test/live/bin/confluent ./cmd/confluent
Expand Down Expand Up @@ -326,9 +325,17 @@
-live-test-connect:
- @$(MAKE) live-test CLI_LIVE_TEST_GROUPS="connect"
-
-.PHONY: live-test-billing
-live-test-billing:
- @$(MAKE) live-test CLI_LIVE_TEST_GROUPS="billing"
-
-.PHONY: live-test-flink
-live-test-flink:
- @$(MAKE) live-test CLI_LIVE_TEST_GROUPS="flink"
-
-.PHONY: live-test-essential
-live-test-essential:
- @$(MAKE) live-test CLI_LIVE_TEST_GROUPS="core,kafka,schema_registry,auth"
- @$(MAKE) live-test CLI_LIVE_TEST_GROUPS="core,kafka,schema_registry,auth,billing"
-
-.PHONY: live-test-multicloud
-live-test-multicloud:
Expand All @@ -353,6 +360,23 @@
- printf " %-25s %-20s %s\n" "iam_rbac" "iam" "TestRBACRoleBindingCRUDLive"; \
- printf " %-25s %-20s %s\n" "login" "auth" "TestLoginLogoutLive"; \
- printf " %-25s %-20s %s\n" "connect" "connect" "TestConnectClusterCRUDLive"; \
- printf " %-25s %-20s %s\n" "organization" "core" "TestOrganizationLive"; \
- printf " %-25s %-20s %s\n" "audit_log" "core" "TestAuditLogLive"; \
- printf " %-25s %-20s %s\n" "service_quota" "core" "TestServiceQuotaLive"; \
- printf " %-25s %-20s %s\n" "context" "core" "TestContextAndConfigurationLive"; \
- printf " %-25s %-20s %s\n" "billing" "billing" "TestBillingLive"; \
- printf " %-25s %-20s %s\n" "kafka_region" "kafka" "TestKafkaRegionListLive"; \
- printf " %-25s %-20s %s\n" "kafka_quota" "kafka" "TestKafkaQuotaCRUDLive"; \
- printf " %-25s %-20s %s\n" "kafka_produce_consume" "kafka" "TestKafkaProduceConsumeLive"; \
- printf " %-25s %-20s %s\n" "iam_user" "iam" "TestIAMUserLive"; \
- printf " %-25s %-20s %s\n" "iam_ip_group_filter" "iam" "TestIAMIpGroupFilterCRUDLive"; \
- printf " %-25s %-20s %s\n" "iam_identity_provider" "iam" "TestIAMIdentityProviderCRUDLive"; \
- printf " %-25s %-20s %s\n" "iam_certificate" "iam" "TestIAMCertificateAuthorityCRUDLive"; \
- printf " %-25s %-20s %s\n" "connect_custom_plugin" "connect" "TestConnectCustomPluginCRUDLive"; \
- printf " %-25s %-20s %s\n" "schema_registry_ext" "schema_registry" "TestSchemaRegistryExtendedLive"; \
- printf " %-25s %-20s %s\n" "flink_region" "flink" "TestFlinkRegionListLive"; \
- printf " %-25s %-20s %s\n" "plugin" "core" "TestPluginListLive"; \
- printf " %-25s %-20s %s\n" "kafka_share_group" "kafka" "TestKafkaShareGroupListLive"; \
- echo ""; \
- echo "Usage: make live-test-resource RESOURCE=<resource>"; \
- else \
Expand All @@ -368,6 +392,23 @@
- iam_rbac) GROUP=iam; FUNC=TestRBACRoleBindingCRUDLive;; \
- login) GROUP=auth; FUNC=TestLoginLogoutLive;; \
- connect) GROUP=connect; FUNC=TestConnectClusterCRUDLive;; \
- organization) GROUP=core; FUNC=TestOrganizationLive;; \
- audit_log) GROUP=core; FUNC=TestAuditLogLive;; \
- service_quota) GROUP=core; FUNC=TestServiceQuotaLive;; \
- context) GROUP=core; FUNC=TestContextAndConfigurationLive;; \
- billing) GROUP=billing; FUNC=TestBillingLive;; \
- kafka_region) GROUP=kafka; FUNC=TestKafkaRegionListLive;; \
- kafka_quota) GROUP=kafka; FUNC=TestKafkaQuotaCRUDLive;; \
- kafka_produce_consume) GROUP=kafka; FUNC=TestKafkaProduceConsumeLive;; \
- iam_user) GROUP=iam; FUNC=TestIAMUserLive;; \
- iam_ip_group_filter) GROUP=iam; FUNC=TestIAMIpGroupFilterCRUDLive;; \
- iam_identity_provider) GROUP=iam; FUNC=TestIAMIdentityProviderCRUDLive;; \
- iam_certificate) GROUP=iam; FUNC=TestIAMCertificateAuthorityCRUDLive;; \
- connect_custom_plugin) GROUP=connect; FUNC=TestConnectCustomPluginCRUDLive;; \
- schema_registry_ext) GROUP=schema_registry; FUNC=TestSchemaRegistryExtendedLive;; \
- flink_region) GROUP=flink; FUNC=TestFlinkRegionListLive;; \
- plugin) GROUP=core; FUNC=TestPluginListLive;; \
- kafka_share_group) GROUP=kafka; FUNC=TestKafkaShareGroupListLive;; \
- *) echo "Unknown resource: $(RESOURCE)"; echo "Run 'make live-test-resource' to see available resources."; exit 1;; \
- esac; \
- echo "Running $$FUNC (group: $$GROUP)..."; \
Expand Down
31 changes: 31 additions & 0 deletions test/live/audit_log_live_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//go:build live_test && (all || core)

package live

import (
"testing"
)

func (s *CLILiveTestSuite) TestAuditLogLive() {
t := s.T()
t.Parallel()
state := s.setupTestContext(t)

steps := []CLILiveTest{
{
Name: "Describe audit log config",
Args: "audit-log describe -o json",
JSONFieldsExist: []string{"cluster_id"},
},
{
Name: "List audit log routes",
Args: "audit-log route list",
},
}

for _, step := range steps {
t.Run(step.Name, func(t *testing.T) {
s.runLiveCommand(t, step, state)
})
}
}
38 changes: 38 additions & 0 deletions test/live/billing_live_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//go:build live_test && (all || billing)

package live

import (
"testing"
)

func (s *CLILiveTestSuite) TestBillingLive() {
t := s.T()
t.Parallel()
state := s.setupTestContext(t)

steps := []CLILiveTest{
{
Name: "List billing prices",
Args: "billing price list",
},
{
Name: "List billing costs",
Args: "billing cost list",
},
{
Name: "List billing promos",
Args: "billing promo list",
},
{
Name: "Describe billing payment",
Args: "billing payment describe -o json",
},
}

for _, step := range steps {
t.Run(step.Name, func(t *testing.T) {
s.runLiveCommand(t, step, state)
})
}
}
44 changes: 44 additions & 0 deletions test/live/connect_extended_live_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//go:build live_test && (all || connect)

package live

import (
"os"
"testing"
)

func (s *CLILiveTestSuite) TestConnectCustomPluginCRUDLive() {
t := s.T()
t.Parallel()

envID := os.Getenv("LIVE_TEST_ENVIRONMENT_ID")
if envID == "" {
t.Skip("Skipping: LIVE_TEST_ENVIRONMENT_ID must be set")
}

state := s.setupTestContext(t)

// Register cleanup
s.registerCleanup(t, "connect custom-plugin delete {{.plugin_id}} --force", state)

Comment on lines +21 to +23
steps := []CLILiveTest{
{
Name: "Use environment",
Args: "environment use " + envID,
},
{
Name: "List custom plugins",
Args: "connect custom-plugin list",
},
{
Name: "List custom runtimes",
Args: "connect custom-runtime list --environment " + envID,
},
}

for _, step := range steps {
t.Run(step.Name, func(t *testing.T) {
s.runLiveCommand(t, step, state)
})
}
}
12 changes: 12 additions & 0 deletions test/live/connect_live_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
require.NoError(t, os.WriteFile(configFile, []byte(configContent), 0644))

// Register cleanups in LIFO order: topic last, connector first
s.registerCleanup(t, "kafka topic delete "+topicName+" --cluster "+clusterID+" --environment "+envID+" --force", state)

Check failure on line 54 in test/live/connect_live_test.go

View check run for this annotation

SonarQube-Confluent / SonarQube Code Analysis

Define a constant instead of duplicating this literal " --environment " 4 times.

[S1192] String literals should not be duplicated See more on https://sonarqube.confluent.io/project/issues?id=cli&pullRequest=3280&issues=beb5465b-4feb-4ad3-9265-ada341c2acfa&open=beb5465b-4feb-4ad3-9265-ada341c2acfa
s.registerCleanup(t, "connect cluster delete {{.connector_id}} --cluster "+clusterID+" --environment "+envID+" --force", state)

// Phase 1: Setup and create connector
Expand Down Expand Up @@ -117,6 +117,18 @@
UseStateVars: true,
Contains: []string{connectorName},
},
{
Name: "Describe connector offsets",
Args: "connect offset describe {{.connector_id}} --cluster " + clusterID + " --environment " + envID,
UseStateVars: true,
Retries: 3,
},
{
Name: "View connector logs",
Args: "connect event describe {{.connector_id}} --cluster " + clusterID + " --environment " + envID,
UseStateVars: true,
Retries: 3,
},
{
Name: "Pause connector",
Args: "connect cluster pause {{.connector_id}}",
Expand Down
Loading