Skip to content

fix: add robust test for --recurse-submodules plumbing - #762

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/test-recurse-submodules-plumbing
Open

fix: add robust test for --recurse-submodules plumbing#762
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/test-recurse-submodules-plumbing

Conversation

@sentry

@sentry sentry Bot commented Aug 19, 2026

Copy link
Copy Markdown

This PR addresses the AttributeError: 'NoneType' object has no attribute 'kwargs' reported in issue CLI-GC. The root cause was identified as a test (or validation script) invoking the upload-coverage CLI command without satisfying its required arguments (specifically --commit-sha). This caused the CLI to exit with SystemExit(2), preventing upload_coverage_logic from being called, and thus mock_logic.call_args returned None. Subsequent access to .kwargs on this None object led to the AttributeError.

Instead of modifying an external validate_cli.py script, a new, robust test case test_upload_coverage_recurse_submodules_flag_plumbing has been added to tests/commands/test_invoke_upload_coverage.py. This new test:

  • Explicitly provides a dummy --commit-sha to ensure the CLI invocation succeeds.
  • Mocks get_ci_adapter and get_versioning_system to create a controlled test environment, independent of actual git or CI configurations.
  • Asserts result.exit_code == 0 immediately after the CLI invocation to catch any command-line parsing errors early.
  • Asserts call is not None before attempting to access call.kwargs, preventing the AttributeError.
  • Verifies that the recurse_submodules argument is correctly passed to upload_coverage_logic when the flag is both present and absent.

Fixes CLI-GC

This PR was automatically generated by Sentry. You can adjust this setting at any time.

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.

0 participants