cli/acceptance/testdata
William Martin 998b6212b3
Add skills specific telemetry
* Add skills specific telemetry

* Remove VisibilityFuture, inline goroutine at call sites

The VisibilityFuture/FetchRepoVisibilityAsync/Wait wrapper was an
unidiomatic async abstraction built for a single pattern used in
exactly two call sites. In Go the channel is already the future;
wrapping it in a struct with a Wait(timeout) method adds no value.

Delete the abstraction and inline a local visResult struct,
buffered channel, goroutine, and select at each call site. Behavior
is preserved exactly: err -> "unknown", timeout -> "unknown",
success+public -> include skill_names.

FetchRepoVisibility (synchronous) is kept as-is.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix nonsense copilot tests

* Update telemetry tests for public-only dims and search event removal

Production telemetry emission changed:
- preview: skill_owner/skill_repo/skill_name (renamed from skill_names)
  are now emitted only when repo_visibility=public.
- install: skill_owner/skill_repo/skill_names are now emitted only
  when repo_visibility=public.
- search: the initial skill_search event was removed entirely; the
  skill_search_install event no longer carries query/owner dims.

Update tests to match: rename skill_names -> skill_name in preview,
make owner/repo assertions conditional on public visibility in both
preview and install, and reduce the search test to a single event
with explicit Empty assertions for the removed query/owner dims so a
privacy regression cannot pass silently.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Test CategorizeHost and switch telemetry to skill_host_type

Add TestCategorizeHost covering all four classification branches
(github.com, ghes, tenancy, uncategorized) with cases verified
against the real ghauth implementation rather than guessed.

Update install and preview unit tests to assert the new
skill_host_type dimension name, and fix a typo in the preview
acceptance txtar (skill_hos_type -> skill_host_type).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Shrink visibility wait and test unknown visibility

The 2s visibilityWaitTimeout was wildly overprovisioned: by the time
telemetry emission reaches the select, the command has already done
several serial GitHub REST calls (and for install, a git sparse-checkout
plus possibly interactive prompts), so the one-call visibility fetch
has almost always completed. Drop the timeout to 200ms — a short safety
net for a stalled REST call, not a wait budget for a healthy one.

Also adds a table-driven case to TestFetchRepoVisibility covering an
unknown/future visibility value from the API, addressing @babakks'
review nitpick.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-17 19:58:59 +02:00
..
api Implement basic API acceptance test 2024-10-17 15:39:29 +02:00
auth Address PR feedback 2024-10-23 13:57:57 -07:00
extension Rename similar to other coarse commandset tests 2024-10-28 12:54:50 +01:00
gpg-key Refactor gpg-key delete to align with ssh-key delete 2024-10-24 09:59:02 -06:00
issue Acceptance test issue/pr create/edit with project 2025-03-31 17:06:51 +02:00
label Add Acceptance test for label command 2024-10-24 17:00:54 +02:00
org Add acceptance tests for org command 2024-10-24 09:58:06 -06:00
pr Add nameWithOwner to necessary tests 2026-03-26 13:23:43 +01:00
project Modify script to use the project number returned by the api upon creation 2024-10-25 09:03:50 -07:00
release Remove stdout assertion from release 2024-10-17 16:06:14 +02:00
repo Reformat non-documentation hostnames 2025-07-14 08:43:15 -04:00
ruleset Rename testscript for consistency 2024-10-28 12:40:15 +01:00
search Fix single quote not expanding vars 2024-10-21 10:20:37 -06:00
secret Support --no-repos-selected on secret set 2025-07-03 17:02:28 +02:00
skills Add skills specific telemetry 2026-04-17 19:58:59 +02:00
ssh-key Add SSH Key Acceptance test 2024-10-24 17:46:17 +02:00
telemetry Do not send telemetry for aliases 2026-04-17 14:28:49 +02:00
variable Update variable testscripts based on secret 2024-10-21 16:02:26 -04:00
workflow test(acceptance): remove run-download-traversal test 2026-03-25 12:47:45 -06:00