Plan: Close Missing Test Coverage
Implements the gaps identified in
docs/superpowers/specs/2026-07-21-missing-test-coverage-design.md,
prioritizing the databricks_auth_login/force parameter this branch
introduces.
Sequencing
- Write the P0 Databricks auth-internals tests.
- Write the P1 tests (
get_dbutils,op_signin/iter_op_account_list, both CLI entry points,which_winget). - Write the P2 callback unit test (no dependencies, can slot in anytime).
- Write the P2 SDK-token 1Password test.
The bundle-target test and the 1Password Connect test are deferred — see below.
P0 tests (tests/test_databricks.py)
Add:
test_databricks_auth_login_force_reauthenticates—force=Truetriggers a real second CLI call rather than returning the cached result.test_databricks_auth_login_force_clears_cache_for_other_profiles— forcing a re-login for one profile evicts and transparently re-populates another cached profile's state, without corrupting it.test_databricks_auth_login_skips_when_already_authenticatedtest_databricks_auth_login_env_fallbacktest_databricks_auth_describetest_get_host_profiletest_databricks_auth_profilestest_which_databrickstest_databricks_cli_get_commandtest_databricks_cli_install_command
test_databricks_auth_login_target is deferred — see below. Remove the
# pragma: no cover markers from each function once it's actually
exercised.
P1 tests
tests/test_onepassword.py:test_iter_op_account_list,test_op_signin_no_account_iterates_all_accounts,test_op_signin_with_explicit_account,test_onepassword_cli_get_command,test_onepassword_cli_install_command.tests/test_databricks.py:test_get_dbutils_returns_real_client_dbutils.- Wherever
test_install_brewcurrently lives:test_which_winget, skipped on non-Windows platforms.
P2 tests
tests/test_callback.py:test_callback_argument_dropped_when_target_explicit. Pure unit test, no external resource, no blockers.tests/test_onepassword.py:test_async_read_onepassword_secret_via_sdk_token, covering_async_resolve_resourcevia a real service-account token (no Connect server required).
Deferred
test_databricks_auth_login_target— would need a real Databricks Asset Bundle fixture to exercise a narrow, already fail-safe fallback branch. Not worth the ongoing fixture upkeep.test_read_onepassword_secret_via_connect— needs a running 1Password Connect server, which is infrastructure most callers of this library don't run. Revisit only if that infrastructure exists for other reasons.
Verification
- Run
make testafter each step, not just at the end. - Confirm the coverage report no longer flags the functions whose
# pragma: no covermarkers were removed. - Re-run the suite with
CIset in the environment to confirm the interactive-only branches (see the existingtest_get_secretpattern) still skip correctly.