Country or region and language

    Choose your country or region and your language.

    Suggested for you

      All countries and regions

        Choose your character

        It shows in the top bar and on your profile. Change it any time.

        Terraform course

        Terraform test assertions

        Opening Terraform
        Your turn

        Terraform test: assertions and provider boundaries

        A configuration can be valid and still produce the wrong value. Test an observable requirement and include an input that would expose a plausible shortcut.

        A module that must produce one service per region needs more than an assertion that its output is nonempty. Compare the expected keys, exact count and required values. Then test an empty input or an unexpected key if the module contract allows it.

        The browser’s terraform test model evaluates a documented subset of assertions against planned values. It does not create test infrastructure or reproduce every feature of Terraform’s test runner. Passing a local assertion cannot establish real provider permissions, API behavior or service availability.

        Provider mocking also has a boundary: a mock can isolate configuration logic, while a separate integration test checks the provider. Write down which dependency was replaced and which production behavior remains untested.

        The official test reference describes the complete runner. Continue with custom conditions and provider-mocking concepts. Blocking input validation, check warnings and test failures have different effects; inspect the operation’s result instead of treating them as interchangeable.

        Your Work Gym account

        Save your progress and pick up on another device. Your browser's progress comes with you.

        or

        You can keep practicing without an account.

        Change your plan

        Checking the price

        Help and feedback

        Ask a question, tell us what is not working, or share an idea. We reply by email.

        What is it about?

        We use it only to reply to you.