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

fix: make terraform imports keys order deterministic #1433

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

pmalek
Copy link
Member

@pmalek pmalek commented Nov 7, 2024

generateImportKeys generated terraform's import keys. The test assumes that the keys are always in the same order but they are not as they are generated using a map which does not yield the same order each time it's being looped over.

This PR fixes that by sorting the keys on each marshal operation.

@pmalek pmalek requested a review from mheap November 7, 2024 19:40
@pmalek pmalek self-assigned this Nov 7, 2024
@pmalek pmalek enabled auto-merge (squash) November 7, 2024 19:44
@pmalek pmalek merged commit 6e03802 into main Nov 7, 2024
19 checks passed
@pmalek pmalek deleted the fix-kong2tf-import-test branch November 7, 2024 19:48
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 54.28571% with 16 lines in your changes missing coverage. Please review.

Project coverage is 27.55%. Comparing base (3305886) to head (f6f1880).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
kong2tf/generate_resource.go 54.28% 10 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1433      +/-   ##
==========================================
+ Coverage   27.51%   27.55%   +0.03%     
==========================================
  Files          61       61              
  Lines        6272     6294      +22     
==========================================
+ Hits         1726     1734       +8     
- Misses       4423     4432       +9     
- Partials      123      128       +5     

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

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