test(monitor-alert): add = and != operator test coverage for alert v2 resources#709
Merged
tembleking merged 1 commit intomasterfrom Feb 20, 2026
Merged
Conversation
… resources The = operator is accepted by the Sysdig API for MANUAL, PERCENTAGE_OF_CHANGE, and EVENT alert types and was missing test coverage. This also adds != operator tests for completeness. Ref: #707
Contributor
There was a problem hiding this comment.
Pull request overview
Adds acceptance-test coverage to ensure Sysdig Monitor Alert V2 resources persist and read back operator values of = and != (rather than normalizing to ==), aligning provider expectations with observed Sysdig API behavior and preventing regressions related to #707.
Changes:
- Added an acceptance-test step for
operator = "!="for Alert V2 metric, event, and change resources. - Added an acceptance-test step for
operator = "="for Alert V2 metric, event, and change resources. - Introduced helper config generators per resource type to exercise the new operator values.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
sysdig/resource_sysdig_monitor_alert_v2_metric_test.go |
Adds = / != operator acceptance coverage for metric alert v2. |
sysdig/resource_sysdig_monitor_alert_v2_event_test.go |
Adds = / != operator acceptance coverage for event alert v2. |
sysdig/resource_sysdig_monitor_alert_v2_change_test.go |
Adds = / != operator acceptance coverage for change alert v2. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
davidag
approved these changes
Feb 20, 2026
mateobur
approved these changes
Feb 20, 2026
fcracker79
pushed a commit
that referenced
this pull request
Mar 5, 2026
… resources (#709) ## Summary Investigated #707 and found the reported behavior is **not reproducible**. The Sysdig API (`us2.app.sysdig.com`) accepts `conditionOperator: "="` and returns it unchanged — there is no normalization to `"=="`. Curl testing confirmed: - `conditionOperator: "="` → **200 OK**, stored and returned as `=` - `conditionOperator: "=="` → **422 "Wrong grammar for condition"** (only valid for PromQL/form_based_prometheus alerts) This PR adds acceptance test coverage for the `=` and `!=` operators across all three affected alert types (metric, change, event) to prevent regressions and document the expected behavior. Closes #707
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.
Summary
Investigated #707 and found the reported behavior is not reproducible. The Sysdig API (
us2.app.sysdig.com) acceptsconditionOperator: "="and returns it unchanged — there is no normalization to"==".Curl testing confirmed:
conditionOperator: "="→ 200 OK, stored and returned as=conditionOperator: "=="→ 422 "Wrong grammar for condition" (only valid for PromQL/form_based_prometheus alerts)This PR adds acceptance test coverage for the
=and!=operators across all three affected alert types (metric, change, event) to prevent regressions and document the expected behavior.Closes #707