Add core Insights API endpoints (test cases, errors, trends) - #629
Merged
Merged
Conversation
Extends InsightsEndpoint (previously limited to getTestResults) with getTestMetricsSummary, getTestTrends, getTests, getTestCases, getTestCasesStats, getErrors, getTrendsTests, and getTrendsErrors, covering the most commonly used parts of the Insights API. Adds matching parameter builders and response models under model.insights. Filters, Activity, Concurrency, Coverage, and the cross-source (all sources) endpoint variants are intentionally left for follow-up work; InsightsEndpoint remains annotated @unfinished. Fixes #63 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 210 |
| Duplication | 80 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Builder's explicit public no-arg constructor was identical to the one the compiler generates by default. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Sep 16, 2026
diemol
added a commit
that referenced
this pull request
Sep 16, 2026
…#631) Default AnalyticsTrendsParameter interval to 1d GET /v1/analytics/trends/tests rejects requests with a 422 when `interval` is omitted, even though the docs list it as optional with a default of 1d. Default it client-side to match the documented behavior, the same way TestResultParameter.Builder already defaults `size`. Verified against the live API (both start/end and time_range paths); this was breaking the getTestTrendsTest integration test in CI on every PR since #629 merged. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Extends
InsightsEndpoint(previously limited togetTestResults) with 8 new methods covering the most commonly used part of the Insights API:getTestMetricsSummary—GET /v1/analytics/insights/test-metricsgetTestTrends—GET /v1/analytics/trends/testsgetTests—GET /v2/insights/{source}/testsgetTestCases—GET /v2/insights/{source}/test-casesgetTestCasesStats—GET /v2/insights/{source}/test-cases/statsgetErrors—GET /v2/insights/{source}/errorsgetTrendsTests—GET /v2/insights/{source}/trends/testsgetTrendsErrors—GET /v2/insights/{source}/trends/errorsEach method has a dedicated parameter builder (under
com.saucelabs.saucerest.model.insights, following the existingTestResultParameter/LookupBuildsParametersbuilder conventions) and response model classes matching the documented API responses.Filters,Activity,Concurrency,Coverage, and the cross-source ("all sources") endpoint variants are intentionally left out of this PR to keep it reviewable;InsightsEndpointremains annotated@Unfinishedwith an updated message describing what's left.Note: the test-execution response model is named
TestExecutionrather thanTest, to avoid colliding withorg.junit.jupiter.api.Testin files that need both imports.Motivation and Context
Closes #63 — the library only exposed a single, incomplete Insights endpoint (
getTestResults, annotated@Unfinished), despite the Insights API being one of the most requested integrations.How Has This Been Tested?
mvn test-compile— full compile of main and test sources.mvn test -Dtest=com.saucelabs.saucerest.unit.**— full unit suite, including 8 new parameter-builder test classes coveringtoMap()serialization and required-field validation (org_id,query,start/endvstime_range).InsightsEndpointTest) with one test per new endpoint; these follow the existing pattern of running against real Sauce Labs credentials and were not run in this environment (no credentials available), consistent with how the pre-existinggetTestResultTestintegration test is exercised.Types of changes
Screenshots (if appropriate):
N/A
Checklist
Further comments
This covers the "core" slice of the Insights API (test executions, test cases, errors, trends) rather than the full surface described in the linked docs, since the full API is ~25 endpoints across 8 categories (Analytics, Filters, Activity, Errors, Test Cases, Concurrency, Coverage, Trends). Happy to follow up with the remaining groups in separate PRs if maintainers want them.
🤖 Generated with Claude Code