Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor tctl InitFunc to return an authclient.ClientI #51093

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rosstimothy
Copy link
Contributor

Returning the interface from the InitFunc allows tests to better mock the auth client, which permits tests to be run without an actual teleport process being launched.

The ClientI interface was also extended with additional methods that tctl was already relying on.

Motivation for this change is to permit writing tests for tctl commands that do not require a teleport process be running. For instance, tests that only exist to validate output of a tctl command given different configurations are now able to do so by mocking out response from auth instead of starting a process and updating the cluster auth preference for each test case.

Returning the interface from the InitFunc allows tests to better
mock the auth client, which permits tests to be run without an
actual teleport process being launched.

The ClientI interface was also extended with additional methods
that tctl was already relying on.
@rosstimothy rosstimothy changed the title cRefactor tctl InitFunc to return an authclient.ClientI Refactor tctl InitFunc to return an authclient.ClientI Jan 15, 2025
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.

1 participant