honeycombio / terraform-provider-honeycombio

A Terraform provider for Honeycomb.io
https://registry.terraform.io/providers/honeycombio/honeycombio/latest
MIT License
48 stars 24 forks source link

fix(slos): Reflect OpenAPI validation of SLOs #506

Closed MadhuVK closed 3 months ago

MadhuVK commented 3 months ago

Which problem is this PR solving?

Internal Asana: https://app.asana.com/0/1205961717360815/1207660330373702/f

Note: Happy to make an issue if this is deemed appropriate for this change.

Short description of the changes

Reflect OpenAPI validation of SLO's TargetPPM, here: https://docs.honeycomb.io/api/tag/SLOs#operation/createSlo!path=target_per_million&t=request

How to verify that this has the expected result

SLO resources should no longer fail when creating an SLO with TargetPPM less than 1%.

I didn't see any existing automation regarding validation - happy to add some if it's critical for this change.

λ gotestsum --format-hide-empty-pkg ./... -- -p1 -count=1
✓  internal/helper (491ms)
✓  internal/helper/validation (664ms)
✓  client (2.846s)
✓  client/v2 (33.387s)
✖  honeycombio (3m41.598s)
✖  internal/provider (5m2.446s)

=== Failed
=== FAIL: honeycombio TestAccDataSourceHoneycombioRecipient_basic (0.33s)
    data_source_recipient_test.go:78:
                Error Trace:    /Users/madhu/Code/honeycombio/terraform-provider-honeycombio/honeycombio/data_source_recipient_test.go:78
                Error:          Received unexpected error:
                                Recipient of type "email" already exists with the details provided.
                Test:           TestAccDataSourceHoneycombioRecipient_basic

=== FAIL: honeycombio TestAccDataSourceHoneycombioRecipients_basic (0.35s)
    data_source_recipients_test.go:48:
                Error Trace:    /Users/madhu/Code/honeycombio/terraform-provider-honeycombio/honeycombio/data_source_recipients_test.go:48
                Error:          Received unexpected error:
                                Recipient of type "email" already exists with the details provided.
                Test:           TestAccDataSourceHoneycombioRecipients_basic

=== FAIL: internal/provider TestAcc_EnvironmentsDatasource (26.43s)
    environments_data_source_test.go:28: Step 1/1 error: Check failed: Check 2/3 error: data.honeycombio_environments.regex: Attribute 'ids.#' expected "16", got "17"

DONE 319 tests, 3 failures in 306.407s
codecov-commenter commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 80.13%. Comparing base (c41eaeb) to head (6bdc704).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #506 +/- ## ========================================== + Coverage 79.95% 80.13% +0.17% ========================================== Files 72 72 Lines 5557 5557 ========================================== + Hits 4443 4453 +10 + Misses 816 810 -6 + Partials 298 294 -4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.