Skip to content

test: add tests for hybrid cloud environment extra flags#85

Merged
Davidonium merged 1 commit intofeat/dhernando/hybrid-cloud-environment-extra-flagsfrom
feat/dhernando/hybrid-cloud-environment-extra-flags-tests
Mar 31, 2026
Merged

test: add tests for hybrid cloud environment extra flags#85
Davidonium merged 1 commit intofeat/dhernando/hybrid-cloud-environment-extra-flagsfrom
feat/dhernando/hybrid-cloud-environment-extra-flags-tests

Conversation

@qdrant-cloud-bot
Copy link
Copy Markdown
Contributor

Summary

  • Adds grouped tests for all new flags on hybrid cluster create, hybrid cluster update, and hybrid cluster describe
  • Adds unit tests for new helper parsers/formatters (parseRestartPolicy, parseRebalanceStrategy, parseGpuType, parseDBLogLevel, parseAuditLogRotation, parseTopologySpreadConstraint, parseSecretKeyRef)
  • Adds unit tests for clusterutil.CalculateAdditionalDisk
  • Adds unit tests for util.IsUUID and util.AnyFlagChanged
  • Fixes existing create tests that broke due to mandatory package resolution

Create tests (7 new)

Test Covers
PackageByName --package with a name string
PackageByCPUAndRAM --cpu + --ram resource resolution
PackageMutualExclusion --package + --cpu rejects
PackageWithDisk --disk additional disk calculation
ClusterConfigFlags restart-policy, rebalance-strategy, topology-spread-constraint, cost-allocation-label
StorageConfigFlags all 4 storage class flags
DatabaseConfigFlags db-log-level, vectors-on-disk, enable-tls, api-key-secret, read-only-api-key-secret, tls-cert-secret, tls-key-secret, audit-logging, audit-log-rotation, audit-log-max-files, audit-log-trust-forwarded-headers

Update tests (3 new)

Test Covers
ClusterConfigFlags restart-policy, rebalance-strategy, topology-spread-constraint
StorageAndResourceFlags 4 storage classes + additional-disk + cost-allocation-label
ExtendedDBConfig_WithForce vectors-on-disk, db-log-level, TLS/secrets, audit logging (all need --force)

Describe tests (1 new)

Test Covers
NewFields Verifies all new fields render in describe output

Test plan

  • make lint passes
  • make build passes
  • All new tests pass (go test ./internal/cmd/hybrid/... ./internal/cmd/clusterutil/... ./internal/cmd/util/...)

Made with Cursor

Cover the new flags added to hybrid cluster create, update, and describe
commands: package resolution (by name, CPU/RAM, mutual exclusivity, disk
calculation), cluster config (restart-policy, rebalance-strategy,
topology-spread-constraint, cost-allocation-label), storage config (all
4 storage class flags), and database config (db-log-level, vectors-on-disk,
TLS, secrets, audit logging).

Also adds unit tests for the new helper parsers/formatters, CalculateAdditionalDisk,
util.IsUUID, and util.AnyFlagChanged. Fixes existing create tests that broke
due to mandatory package resolution.

Made-with: Cursor
@Davidonium Davidonium merged commit 31d5eff into feat/dhernando/hybrid-cloud-environment-extra-flags Mar 31, 2026
4 checks passed
@Davidonium Davidonium deleted the feat/dhernando/hybrid-cloud-environment-extra-flags-tests branch March 31, 2026 07:04
Davidonium added a commit that referenced this pull request Mar 31, 2026
* feat: add missing flags to the hybrid environment clusters

* refactor: add resources flags to hybrid cluster command and calculate
package / additional disk changes

* refactor: remove gpu related flags on the hybrid cloud cluster commands,
refactor package resolving so that it uses a struct instead of a
thousand parameters

* refactor: move wait flags to the end, remove gpu-type flag for now

* refactor: make use of util.AnyFlagChanged in cluster create

* test: add tests for hybrid cloud environment extra flags (#85)

Cover the new flags added to hybrid cluster create, update, and describe
commands: package resolution (by name, CPU/RAM, mutual exclusivity, disk
calculation), cluster config (restart-policy, rebalance-strategy,
topology-spread-constraint, cost-allocation-label), storage config (all
4 storage class flags), and database config (db-log-level, vectors-on-disk,
TLS, secrets, audit logging).

Also adds unit tests for the new helper parsers/formatters, CalculateAdditionalDisk,
util.IsUUID, and util.AnyFlagChanged. Fixes existing create tests that broke
due to mandatory package resolution.

Made-with: Cursor

Co-authored-by: Qdrant Claw <qdrant-claw@qdrant.com>

---------

Co-authored-by: qdrant-cloud-bot <111755117+qdrant-cloud-bot@users.noreply.github.com>
Co-authored-by: Qdrant Claw <qdrant-claw@qdrant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants