Skip to content

test: add coverage for helper dispatch and service alias resolution#111

Open
Bortlesboat wants to merge 1 commit intogoogleworkspace:mainfrom
Bortlesboat:test/helper-coverage
Open

test: add coverage for helper dispatch and service alias resolution#111
Bortlesboat wants to merge 1 commit intogoogleworkspace:mainfrom
Bortlesboat:test/helper-coverage

Conversation

@Bortlesboat
Copy link
Contributor

@Bortlesboat Bortlesboat commented Mar 5, 2026

Summary

  • Add unit tests for helpers::get_helper() — previously untested
  • Expand services::resolve_service() test coverage with edge cases

New Tests

helpers/mod.rs

  • test_get_helper_known_services — all 11 service names return a helper
  • test_get_helper_unknown_returns_none — unknown/empty/wrong-case returns None
  • test_get_helper_script_alias — both "script" and "apps-script" work
  • test_helper_default_not_helper_only — default trait impl returns false

services.rs

  • test_resolve_service_all_aliases — exhaustively tests every alias in SERVICES
  • test_resolve_service_case_sensitive — "Drive" and "GMAIL" should fail
  • test_resolve_service_empty_string — empty string should fail
  • test_resolve_service_error_lists_known_services — error message includes available services
  • test_no_duplicate_aliases — ensures no alias appears twice in SERVICES

Test plan

  • cargo test passes (CI will verify)
  • cargo clippy -- -D warnings clean (CI will verify)

@gemini-code-assist
Copy link
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@changeset-bot
Copy link

changeset-bot bot commented Mar 5, 2026

🦋 Changeset detected

Latest commit: 9340f25

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@googleworkspace/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@google-cla
Copy link

google-cla bot commented Mar 5, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@Bortlesboat
Copy link
Contributor Author

I have signed the Google CLA — please re-check.

@jpoehnelt
Copy link
Member

I have signed the Google CLA — please re-check.

Change your Claude settings to make this easier for Google CLA.

{
  "attribution": {
    "commit": "",
    "pr": ""
  }
}

@Bortlesboat Bortlesboat force-pushed the test/helper-coverage branch 4 times, most recently from 7b8eb83 to 04250cc Compare March 5, 2026 12:43
- Add tests for get_helper() in helpers/mod.rs: all known services,
  unknown services, case sensitivity, script alias, helper_only default
- Add tests for resolve_service() edge cases: all aliases exhaustively,
  case sensitivity, empty string, error message content, duplicate alias
  detection
@Bortlesboat Bortlesboat force-pushed the test/helper-coverage branch from 04250cc to 9340f25 Compare March 5, 2026 17:35
@jpoehnelt jpoehnelt added area: skills cla: yes This human has signed the Contributor License Agreement. complexity: medium Moderate change, some review needed labels Mar 5, 2026
Copy link
Member

@jpoehnelt jpoehnelt left a comment

Choose a reason for hiding this comment

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

test failure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: skills cla: yes This human has signed the Contributor License Agreement. complexity: medium Moderate change, some review needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants