Skip to content

test(monitor-alert): add = and != operator test coverage for alert v2 resources#709

Merged
tembleking merged 1 commit intomasterfrom
test/alert-v2-operator-coverage
Feb 20, 2026
Merged

test(monitor-alert): add = and != operator test coverage for alert v2 resources#709
tembleking merged 1 commit intomasterfrom
test/alert-v2-operator-coverage

Conversation

@tembleking
Copy link
Copy Markdown
Member

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

… 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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@tembleking tembleking added this pull request to the merge queue Feb 20, 2026
Merged via the queue into master with commit 97535da Feb 20, 2026
181 checks passed
@tembleking tembleking deleted the test/alert-v2-operator-coverage branch February 20, 2026 16:44
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
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.

operator field accepts "=" but Sysdig API requires "==" causing irresolvable conflict

4 participants