Skip to content

feat(synthetics): add synthetics tests search command - #73

Merged
platinummonkey merged 1 commit into
mainfrom
tim.brown/add-synthetics-tests-search
Feb 17, 2026
Merged

feat(synthetics): add synthetics tests search command#73
platinummonkey merged 1 commit into
mainfrom
tim.brown/add-synthetics-tests-search

Conversation

@brimtown

Copy link
Copy Markdown
Contributor

Summary

Wires up the SearchTests API endpoint (GET /api/v1/synthetics/tests/search) as a new pup synthetics tests search subcommand. The endpoint was already available in datadog-api-client-go but not exposed in pup — currently synthetics tests list dumps all tests with no server-side filtering.

Motivation

synthetics tests list returns all tests in an org with no filtering. The search endpoint supports facet-based queries (creator, team, env, type, etc.) making it practical to find specific tests without client-side filtering.

Changes

  • Add synthetics tests search subcommand (cmd/synthetics.go) — calls datadogV1.SyntheticsApi.SearchTests with all optional parameters:
    • --text for free text and facet queries (e.g., creator:"Jane Doe", team:my-team, type:browser env:prod)
    • --facets-only to discover available facets and values for the org
    • --include-full-config to return full test configuration in results
    • --start / --count for pagination
    • --sort for result ordering
  • Document all search facets with values verified against the live API: creator, team, env, type, state, status, tag, region, domain, http_method, http_path, muted, ci_execution_rule, creation_source, mobile_platform, notification, endpoint, step_count
  • Update parent command help to mention search capability
  • Add test (cmd/synthetics_test.go) for the new search handler

Testing

go test ./cmd -run TestRunSynthetics -v   # All pass

# Manual verification against live API
pup synthetics tests search --text='creator:"Tim Brown"' --count=5
pup synthetics tests search --text="team:applied-ai-experiences"
pup synthetics tests search --text="type:browser env:prod" --count=10
pup synthetics tests search --facets-only

Checklist

  • The code change follows the project conventions
  • Tests have been added/updated
  • Documentation has been updated
  • All CI checks pass
  • Code coverage is maintained or improved

Wire up the SearchTests API endpoint (GET /api/v1/synthetics/tests/search)
which was already available in the datadog-api-client-go but not exposed
as a pup subcommand.

* Supports free text search and facet queries (creator, team, env,
  type, state, status, tag, region, domain, http_method, etc.)
* --facets-only flag to discover available facets and values per org
* --include-full-config to return full test configuration
* Pagination via --start and --count
* --sort for result ordering
* Documented all facets with verified values from the API
@brimtown
brimtown requested a review from a team as a code owner February 17, 2026 17:44
@platinummonkey
platinummonkey merged commit 74fcbbb into main Feb 17, 2026
5 checks passed
@platinummonkey
platinummonkey deleted the tim.brown/add-synthetics-tests-search branch February 17, 2026 17:53
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.

2 participants