Skip to content

Conversation

@charithaT07
Copy link
Collaborator

This PR adds unit test coverage for the ODS functionality in both the B2C CLI and SDK packages. The implementation validates CLI command logic, configuration settings, output formatting, and SDK client operations using isolated unit tests with mocked dependencies.

Additionally, this PR fixes the ods list command issue where the command would fail when no sandboxes were returned by the API.

Changes Include:

  • Unit tests for all 8 ODS CLI commands: list, create, get, info, delete, start, stop, restart.
  • SDK client tests covering all ODS API operations.
  • CLI tests validating command-specific logic using a mocked odsClient to avoid actual HTTP calls.
  • SDK tests using MockAuthStrategy to isolate SDK functionality.
  • Updated ods list command to handle empty sandbox responses.

@charithaT07 charithaT07 marked this pull request as ready for review January 9, 2026 13:46
@charithaT07 charithaT07 requested a review from clavery as a code owner January 9, 2026 13:46
Copy link
Collaborator

@clavery clavery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @charithaT07

Just want to clarify that unit tests of CLI commands should focus on the CLI specifics like flags, expected output (but not strings or tables, test structured output only) and utility functions of the commands. and we should cautious about testing anything that may change in the implementation like the details on how configuration is resolved. I say this because I'm doing exactly that in PR #30, so I'll try to have this merged soon so we can test if it breaks anything here.

The SDK unit tests should provide the coverage for the actual business logic of the services (like ODS) that we want to test, like the rest clients and higher level functions.

The oclif testing libraries might help too: https://oclif.io/docs/testing

These look good just want to confirm we're aligned on the scope of tests. We don't want to be spending too much time refactoring CLI unit tests while the project is in infancy and we're making changes to the SDK. So I want to make sure we focus on the SDK unit tests as a priority until that's stable, then focus on CLI coverage.

(also if we're going to mock by replacing the "client" for CLI tests we should make that a common strategy across all commands and ensure they are developed with that mocking in mind)

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.

3 participants