Skip to content

feat(tests): add tests for handling empty array plugin configurations - #2184

Merged
VarunAthreya merged 5 commits into
mainfrom
fix/plugin-empty-array-diff
Aug 12, 2026
Merged

feat(tests): add tests for handling empty array plugin configurations#2184
VarunAthreya merged 5 commits into
mainfrom
fix/plugin-empty-array-diff

Conversation

@VarunAthreya

@VarunAthreya VarunAthreya commented Aug 10, 2026

Copy link
Copy Markdown
Member

Add integration tests to verify decK correctly handles plugin configurations with explicitly empty arrays, preventing perpetual diffs that never converge. Tests cover various scenarios top-level and nested empty arrays, enterprise plugins, and string arrays. Also validates that genuine changes from empty to populated arrays are still detected, and that omitted fields match empty arrays.

An unintended side effect was discovered and has been documented here: #2188

@codecov-commenter

codecov-commenter commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.96%. Comparing base (ee5187a) to head (bb2fb2b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2184      +/-   ##
==========================================
+ Coverage   35.92%   35.96%   +0.03%     
==========================================
  Files          82       82              
  Lines        7832     7832              
==========================================
+ Hits         2814     2817       +3     
+ Misses       4753     4751       -2     
+ Partials      265      264       -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread tests/integration/diff_test.go
// Test_Diff_EmptyArrayPluginConfig_OmittedFieldMatchesEmptyArray pins down that omitting an array field entirely
// is indistinguishable from setting it to [], since decK fills both sides with nil before comparing.
//
// NOTE: Deliberately NOT wrapped in runDualTestWithSkipDefaults, unlike the two tests above. That helper runs the same

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Prashansa-K reason for not adding dual test here

should we go ahead with this solution and create a issue to work on this edge case in future or address this now?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created a issue regarding this:
#2188

@VarunAthreya
VarunAthreya merged commit d1de1f0 into main Aug 12, 2026
51 checks passed
@VarunAthreya
VarunAthreya deleted the fix/plugin-empty-array-diff branch August 12, 2026 08:20
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.

3 participants