Skip to content

Conversation

rubenhoenle
Copy link
Member

Description

relates to STACKITCLI-244

Testing

  1. Without any mongodb instance present in your project:
    • stackit mongodbflex instance list -> should print human-readable message that no instances were found
    • stackit mongodbflex instance list -o json -> should print valid JSON output
    • stackit mongodbflex instance list -o yaml -> should print valid YAML output
  2. Create a mongodb instance: stackit mongodbflex instance create --name my-instance --cpu 1 --ram 4 --acl 0.0.0.0/0
  3. Run the list command again
    • stackit mongodbflex instance list -> should print a table with all mongodb instances which were found
    • stackit mongodbflex instance list -o json -> should print valid JSON output
    • stackit mongodbflex instance list -o yaml -> should print valid YAML output
  4. Set env var for instance id: export INSTANCE_ID="6c709d4e-3d1c-4931-9667-dac42ff9043f"
  5. List users for the instance:
    • stackit mongodbflex user list --instance-id $INSTANCE_ID -> should print human-readable message that no users were found
    • stackit mongodbflex user list --instance-id $INSTANCE_ID -o json -> should print valid JSON output
    • stackit mongodbflex user list --instance-id $INSTANCE_ID -o yaml -> should print valid YAML output
  6. Create a user: stackit mongodbflex user create --instance-id $INSTANCE_ID --role read --database default
  7. Run the list users command again:
    • stackit mongodbflex user list --instance-id $INSTANCE_ID -> should print a table of users which were found
    • stackit mongodbflex user list --instance-id $INSTANCE_ID -o json -> should print valid JSON output
    • stackit mongodbflex user list --instance-id $INSTANCE_ID -o yaml -> should print valid YAML output
  8. List backups for the instance:
    • stackit mongodbflex backup list --instance-id $INSTANCE_ID -> should print human-readable message that no backups were found
    • stackit mongodbflex backup list --instance-id $INSTANCE_ID -o json -> should print valid JSON output
    • stackit mongodbflex backup list --instance-id $INSTANCE_ID -o yaml -> should print valid YAML output
      9. Create a backup: (Not possible, there's no reliable way to create a backup on demand)
      10. Run the list backups command again
      - stackit mongodbflex backup list --instance-id $INSTANCE_ID -> should print a table of backups which were found
      - stackit mongodbflex backup list --instance-id $INSTANCE_ID -o json -> should print valid JSON output
      - stackit mongodbflex backup list --instance-id $INSTANCE_ID -o yaml -> should print valid YAML output
  9. Cleanup test resources:
    • Delete the user: stackit mongodbflex user delete 20fee51d-763c-45ea-8196-ac1147db3b90 --instance-id $INSTANCE_ID
    • Delete the instance: stackit mongodbflex instance delete $INSTANCE_ID

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see e.g. here)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@rubenhoenle rubenhoenle requested a review from a team as a code owner October 17, 2025 10:32
@rubenhoenle rubenhoenle self-assigned this Oct 17, 2025
Copy link

Merging this branch changes the coverage (1 decrease, 2 increase)

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/backup/list 35.82% (-4.48%) 👎
github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/instance/list 47.37% (+5.26%) 👍
github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/user/list 50.00% (+5.00%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/backup/list/list.go 35.82% (-4.48%) 67 24 (-3) 43 (+3) 👎
github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/instance/list/list.go 47.37% (+5.26%) 57 27 (+3) 30 (-3) 👍
github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/user/list/list.go 50.00% (+5.00%) 60 30 (+3) 30 (-3) 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/backup/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/instance/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/user/list/list_test.go

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