# Compatibility Testing Pulumi HCL

DevFeed: [Compatibility Testing Pulumi HCL](<https://devfeed.tech/articles/compatibility-testing-pulumi-hcl-18993.md>)

Original publisher: [Read original article](<https://www.pulumi.com/blog/compatibility-testing-pulumi-hcl/>)

Author: Ian Wahbe

Published: 2026-08-14T00:00:00Z

Content type: article

Language: en

Sources: [Pulumi](<https://devfeed.tech/sources/pulumi.md>)

Topics: [pulumi](<https://devfeed.tech/topics/pulumi.md>), [Software Testing](<https://devfeed.tech/topics/software-testing.md>), [Test automation](<https://devfeed.tech/topics/test-automation.md>), [Terraform](<https://devfeed.tech/topics/terraform.md>), [Integration testing](<https://devfeed.tech/topics/integration-testing.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>)

Tags: [compatibility](<https://devfeed.tech/tags/compatibility.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [framework](<https://devfeed.tech/tags/framework.md>), [go](<https://devfeed.tech/tags/go.md>), [hcl](<https://devfeed.tech/tags/hcl.md>), [opentofu](<https://devfeed.tech/tags/opentofu.md>), [property-based-testing](<https://devfeed.tech/tags/property-based-testing.md>), [pulumi](<https://devfeed.tech/tags/pulumi.md>), [terraform](<https://devfeed.tech/tags/terraform.md>), [terraform-provider](<https://devfeed.tech/tags/terraform-provider.md>), [testing](<https://devfeed.tech/tags/testing.md>)

## AI overview

Pulumi HCL compatibility is defined by whether it produces the same Terraform provider steps as OpenTofu for HCL programs valid in both systems. The excerpt says Pulumi HCL dynamically bridges Terraform providers, and provider-visible steps are treated as user-visible behavior. Its compatibility test framework takes an HCL program's files and the providers it uses, then compares provider RPCs between Pulumi HCL and OpenTofu. In the example, the test checks matching provider configuration, planning and resource-creation calls, and the absence of other RPCs. The test does not prescribe expected behavior; it compares the two systems' observed provider interactions.

## Source excerpt

Pulumi HCL has at its core a simple promise: A program that works for tofu apply will also work for pulumi up. This must be true to allow Terraform modules to be shared between tofu config and Pulumi programs. This property makes testing Pulumi HCL simple. Let me explain. At the end of the day, Pulumi is a system to translate actual state & desired state into a series of imperative actions, so actual state can be reconciled to desired state. Terraform is a system to translate actual state & desired state into a series of imperative actions, so actual state can be reconciled to desired state. How desired state is expressed can be radically different, and the underlying reconciliation engine can be radically different, but at the end of the day, both tools do the same thing: Executing a Terraform program looks like this: flowchart LR tf["*.tf files"] current["current state"] subgraph engine["reconciliation engine"] direction LR desired["desired state"] --> internal["provider steps"] end output["provider steps"] tf --> desired current --> engine engine --> output Executing a Pulumi program is more dynamic, because the reconciliation engine is in more active dialog with the user's program. That said, the diagram is the same shape. To match semantics, Pulumi HCL dynamically bridges any Terraform provider in the registry. This means that, for the subset of Pulumi programs that are valid OpenTofu programs, both programs take the same input (*.tf files) and produce the same step output (Terraform provider steps). Providers are the part of our model that generates user-observable behavior, which means if we match what providers see, we match what users see. This gives us a really nice definition of correctness for Pulumi HCL1: Pulumi HCL correctly interprets an HCL program when it generates the same set of provider steps as tofu does. If you are familiar with property-based testing, you might be thinking this looks like a testable property. You're right. How we compatibility