pulumi / pulumi-terraform-bridge

A library allowing providers built with the Terraform Plugin SDK to be bridged into Pulumi.
Apache License 2.0
183 stars 41 forks source link

pulumiTest Integration tests #2052

Closed VenelinMartinov closed 2 weeks ago

VenelinMartinov commented 3 weeks ago

This refactors the cross-tests to expose an integration test module pulCheck for use outside of cross-tests.

It allows us to easily write integration tests where we specify a TF schema, which gets bridged and use the pulumiTest framework for the test itself.

t0yv0 commented 3 weeks ago

https://github.com/pulumi/pulumi-terraform-bridge/blob/master/pkg/tests/cross-tests/input_check.go#L132 already using it. Whatever is most convenient.

VenelinMartinov commented 3 weeks ago

Yeah, absolutely, it's where I adapted this from.

I was wondering if we should abstract the part about bridging a TF provider and hooking it up to pulumiTest for wider use in the bridge.

t0yv0 commented 3 weeks ago

Yes, it would. We have a few ProgramTest tests but rebuilding the underlying provider is a bit of a hassle. But it would be really useful to have a quick stencil way to define a quick schema, program in one place and exercise it end to end, under Pulumi and/or TF, with debugging attached by default. Streamlining this would help contributors adding integration tests.

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 78.47222% with 31 lines in your changes missing coverage. Please review.

Project coverage is 61.27%. Comparing base (a167cca) to head (aa2be4b). Report is 2 commits behind head on master.

Files Patch % Lines
pkg/tests/internal/pulcheck/pulcheck.go 81.31% 13 Missing and 4 partials :warning:
pkg/tests/cross-tests/assert.go 27.77% 11 Missing and 2 partials :warning:
pkg/tests/cross-tests/input_check.go 90.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2052 +/- ## ========================================== + Coverage 61.20% 61.27% +0.06% ========================================== Files 337 339 +2 Lines 45177 45075 -102 ========================================== - Hits 27651 27619 -32 + Misses 16005 15936 -69 + Partials 1521 1520 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.