Menu

Fixing a Test That Could Never Pass: Portkey's Terraform Provider
📰

Fixing a Test That Could Never Pass: Portkey's Terraform Provider

DEV Community: terraform·Robert Markovski·about 3 hours ago
#iIg0Ldk9
#devtoterraform#devto#dev#test#uuid
Reading 0:00
15s threshold

Not every bug is in production code. This one was in an acceptance test.

Short answer

An acceptance test in Portkey's Terraform provider asserted that a SCIM mapping's workspace_id , which the API returns as a UUID, equals the workspace resource's id , which is a slug. That check could never pass. The fix replaces it with a UUID-shape assertion. It was merged as PR #84 and closed issue #63 .

The problem

Issue #63, filed by a maintainer, laid it out. TestAccScimWorkspaceMappingsDataSource_withCreatedMapping failed against the live API:

Attribute 'mappings.0.workspace_id' expected "ws-tf-acc-329a4f", got "d4f92461-0e9b-4c91-9b70-eb2d19c099ed"

Enter fullscreen mode

Exit fullscreen mode

The issue called it "a test bug, not a provider bug." The data source correctly reports the API's UUID, while the resource keeps the user's slug.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.