mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-03-23 22:00:35 -04:00
Most of the OCI registry interactions are unit tested in the most relevant packages, but the overall system will only work correctly if all of the components are correctly wired together by "package main", and that's one part of the system that needs to be tested concretely rather than via test doubles. Therefore this adds an end-to-end test in our existing e2etest package that runs "tofu init" with a CLI configuration that forces using an OCI mirror with a TLS server provided locally by our test program. It exercises the main happy path of provider installation in the same way that an end-user would interact with it, to help avoid accidentally regressing the interactions between these packages in future versions. Unfortunately the technique this test uses to force the OpenTofu CLI binary to trust the test server doesn't work on macOS or Windows and so for now this test is Linux-specific. That's certainly non-ideal, but pragmatic since we'll be relying mainly on the platform-agnostic unit tests to cover this behavior, and we're unlikely to ever stop running the e2etests on Linux as part of our pull request checks so even those developing on macOS or Windows can still notice if this test becomes broken before merging a change. Signed-off-by: Martin Atkins <mart@degeneration.co.uk>