Skip to content
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

Refactor Set and List Diff tests to use generic utilities #2837

Merged
merged 3 commits into from
Jan 17, 2025

Conversation

VenelinMartinov
Copy link
Contributor

@VenelinMartinov VenelinMartinov commented Jan 16, 2025

This PR refactors the Set and List Diff tests to use the generic diff utility functions and types introduced in #2829. This should make the tests more maintainable and more in-line with what other tests do.

861ec1f contains the changes:

  • Refactors the tests to use the generic diffSchemaValueMakerPair and diffScenario types for their tests.
  • Refactors the tests to use prop for top-level properties and nested_prop for nested ones, like the rest of the tests.
  • Refactors the tests to use the generic runSDKv2TestMatrix test function.
  • Refactors the valueMaker functions from value_makers.go to return a map[string]cty.Value instead of a cty.Value which needs to be transformed further after.
  • Corrects three tests in list element removed, where the order of the elements was wrong in the changed values.

f800d2d contains the test recordings.

Related to #2788
Related to #2789

Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.48%. Comparing base (ec61116) to head (b961383).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2837      +/-   ##
==========================================
+ Coverage   67.22%   67.48%   +0.26%     
==========================================
  Files         325      325              
  Lines       41633    41633              
==========================================
+ Hits        27986    28097     +111     
+ Misses      12072    11957     -115     
- Partials     1575     1579       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@VenelinMartinov VenelinMartinov force-pushed the vvm/sdkv2_diff_test_secret_set branch from 4a9f9dd to 11d0a7f Compare January 17, 2025 16:38
@VenelinMartinov VenelinMartinov force-pushed the refactor-set-and-list-diff-tests branch from 97056b8 to f73e706 Compare January 17, 2025 16:38
Base automatically changed from vvm/sdkv2_diff_test_secret_set to master January 17, 2025 17:05
@VenelinMartinov VenelinMartinov force-pushed the refactor-set-and-list-diff-tests branch from f73e706 to b961383 Compare January 17, 2025 17:08
@VenelinMartinov VenelinMartinov enabled auto-merge (squash) January 17, 2025 17:08
@VenelinMartinov VenelinMartinov merged commit 413419b into master Jan 17, 2025
71 checks passed
@VenelinMartinov VenelinMartinov deleted the refactor-set-and-list-diff-tests branch January 17, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants