[AV-128954] Add acceptance tests for events datasources#624
Open
panigrahisubhrajit wants to merge 5 commits into
Open
[AV-128954] Add acceptance tests for events datasources#624panigrahisubhrajit wants to merge 5 commits into
panigrahisubhrajit wants to merge 5 commits into
Conversation
Covers org-level events (list, filter by project/cluster/severity, time range, pagination, sort asc/desc, invalid org, missing required fields, invalid sort direction), single event (happy path with runtime-fetched ID, not-found, invalid org, missing id), project events (list with/without project_id, pagination, sort, filter by cluster, invalid org, invalid sort), and single project event (happy path, not-found, invalid project, missing required fields). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When project_id is omitted the URL was built as /projects//events, causing a 400 from the API. Fall back to the org-level events endpoint when project_id is not provided. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
Droid finished @panigrahisubhrajit's task —— View job |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds acceptance coverage for Capella Events-related datasources and fixes a URL construction bug in project_events when project_id is omitted, aligning runtime behavior with the datasource schema (optional project_id).
Changes:
- Add a comprehensive acceptance test suite for
events,event,project_events, andproject_eventdatasources (filters, pagination/sort, time range, and error cases). - Fix
project_eventsdatasource URL generation to fall back to the org-level events endpoint whenproject_idis not provided. - Add coverage specifically validating
project_eventsbehavior whenproject_idis omitted.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/datasources/project_events.go | Fixes malformed project events URL when project_id is omitted by falling back to org-level events endpoint. |
| acceptance_tests/events_acceptance_test.go | Introduces acceptance tests for events/event/project_events/project_event datasources, including filtering, pagination, sorting, time range, and error scenarios. |
Comment on lines
+463
to
+464
| } | ||
|
|
| }, | ||
| }) | ||
| } | ||
|
|
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.
Jira
Description
Adds acceptance tests for the
events,event,project_events, andproject_eventdatasources covering filtering, pagination, sort, time range, and error cases.Also fixes a bug in the
project_eventsdatasource where omittingproject_idproduced a malformed URL (/projects//events), causing a 400 from the API. Whenproject_idis not provided the datasource now falls back to the org-level events endpoint, which matches the optional schema declaration.Type of Change
Manual Testing Approach
How was this change tested and do you have evidence? (REQUIRED: Select at least 1)
Testing
Testing
All 27 events acceptance tests passed manually against Azure and GCP clusters:
TestAccDatasourceEvent*TestAccDatasourceEvents*TestAccDatasourceProjectEvent*TestAccDatasourceProjectEvents*Further comments