-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table-driven diff tests #1282
Comments
Since this is a bit out of date let me replace it with tickets that are scoped tightly and doable/needed |
Quick update on 2024-03-11. Making some progress to have a harness setup. WIP PR: #1728 It can take an SDKv2 schema and resource inputs R1 and R2 for that schema and run it through TF and Pulumi to Running tests against an in-memory copy of the bridged provider required some changes that landed in Pulumi per Another design problem is how should cross-tests specify resource inputs to feed into both Pulumi and TF. Current choice For some practical impact, started looking at set handling working backward from Remaining work:
|
Is this done now that #1728 has shipped? I assume we probably have more tests to add, but does that belong on this ticket or in a follow up? |
Skimming over this, the critical bit that is not done is that we don't have full confidence that we match TF behavior over diffs for all combinations - this is the kind of confidence we're really looking for from this effort. The two most important missing pieces are: #1790 Rapid generator of SDKv2 schema/value pairs That is right now we can do point tests but we don't saturate testing the combinations which means there's still an open window for divergent behavior. This is also still relevant and needs this test effort to reduce risk I think: Reading the rest of the ticket, it's not relevant. Building a separate provider binary is not needed as we can now build on-the-fly; shimv2.CtyInstanceState is removed in favor of PlanResourceChange, tabulation is irrelevant if we can explore the same space with rapid. |
I'll defer to you and @iwahbe how to best track. |
Motivated by a growing number of issues labelled bug/diff in both this repository and related bridged provider repositories, this is a sketch of a table-driven approach to saturate test coverage of how bridged providers perform resource planning and diffs.
Sample issues:
parameters
on every run pulumi-aws#2492repository
on every run pulumi-aws#2491aws.apigatewayv2.Stage.defaultRouteSettings.loggingLevel
pulumi-aws#2364Start by observing that in absence of special flags such as ignoreChanges, the correct diff behavior for a bridged provider should match the behavior of the upstream TF provider under TF CLI. Specifically, they need to agree on:
To explore and tabulate the behavior of TF CLI, create a purpose-built TF test plugin P and exercise it on sample values. This will result in a dataset characterizing the expected behavior. Then, turn this dataset into a test suite that asserts that P behaves in the same way when bridged under Pulumi CLI, modulo translation.
An important consideration is what input combinations should the TF behavior be sampled on. Since TF CLI modifies diffs in ProposedNew as well as does some null/unknown post-processing in the providers itself, it is important to cover these dimensions:
[null, unknown, "", "a", "b" ]
A dataset of this sort may generate millions of test cases, but can be exercised quickly in-memory without gRPC networking overhead.
The current expectation is that the first iteration of this work will find/confirm discrepancies between expected and actual behavior and inform further work on rule-based test case exclusions and/or product fixes; but when this test suite is complete and passing, it will give the team a lot of confidence to make changes to the diff behavior or bridged providers and refactor toward a maintainable simple implementation.
Tasks
The text was updated successfully, but these errors were encountered: