Skip to content

TestAccIntegrationModelAccessResource_updatePricing asserts "0.10" but Terraform normalises to "0.1" #77

Description

@roh26it

TestAccIntegrationModelAccessResource_updatePricing fails on main.

=== RUN   TestAccIntegrationModelAccessResource_updatePricing
    integration_model_access_resource_test.go:87: Step 2/2 error: Check failed: Check 2/2 error:
    portkey_integration_model_access.test: Attribute 'pricing_config.pay_as_you_go.response_token_price'
    expected "0.10", got "0.1"
--- FAIL: TestAccIntegrationModelAccessResource_updatePricing (13.13s)

Cause: the config at internal/provider/integration_model_access_resource_test.go:291 sets response_token_price = 0.10, and the check at line 123 asserts the string "0.10". Terraform normalises the float to 0.1, so the string comparison fails.

Fix: assert "0.1", or pick a value with no trailing zero.

The same line pair exists for request_token_price = 0.05 / "0.05", which passes because 0.05 has no trailing zero.

Reproduce:

set -a && source .env && set +a
TF_ACC=1 TF_ACC_TERRAFORM_PATH=$(which terraform) \
  go test ./internal/provider -v -run TestAccIntegrationModelAccessResource_updatePricing -timeout 15m

Found while reviewing #76. Not caused by that PR — it reproduces on main at e8d604e.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions