opentofu/opentofu

add special mock files for tofu test (.tfmock.hcl and .tofumock.hcl)

Open

#1 778 ouverte le 8 juil. 2024

Voir sur GitHub
 (3 commentaires) (8 réactions) (0 assignés)Go (1 237 forks)batch import
acceptedenhancementhelp wantedtest-command

Métriques du dépôt

Stars
 (28 648 stars)
Métriques de merge PR
 (Merge moyen 3j 5h) (79 PRs mergées en 30 j)

Description

OpenTofu Version

n/a

Use Cases

Currently, there is no way to share the same mock_provider configuration between multiple test files.

Attempted Solutions

You can duplicate the same mock_provider configuration across multiple test files. Otherwise, you can move your test runs inside a single test file.

Proposal

Create a separate mock file, which will be loaded with multiple test files. See this as an example.

Originally, mock files were a part of https://github.com/opentofu/opentofu/issues/1155, but we want to gather more community input on related use cases.

References

  • #1155

Guide contributeur