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: sort terraform autodiscovery manifest during test #1629

Merged
merged 4 commits into from
Sep 28, 2023

Conversation

olblak
Copy link
Member

@olblak olblak commented Sep 28, 2023

fix: https://github.com/updatecli/updatecli/actions/runs/6335541299/job/17208054420

When the tests for the Terraform autodiscovery plugins are executed, they don't necessarily generate manifests in the same order which leads to failing tests when we compare the result with expected results.

So this PR introduce a sort function that can be used during the test to ensure the expected manifest and generate manifests are sorted the same way.

Test

To test this pull request, you can run the following commands:

pkg/plugins/autodiscovery/terraform/test/
while true; do GOFLAGS="-count=1" go test ./... && sleep 1; done;

Additional Information

Tradeoff

Potential improvement

This problem can also affects the other autodiscovery plugins so we may decided to update the expected result over there as well.

Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added the autodiscovery All things related to the autodiscovery feature label Sep 28, 2023
@olblak olblak merged commit 8eff8be into updatecli:main Sep 28, 2023
6 checks passed
@olblak olblak added the bug Something isn't working label Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autodiscovery All things related to the autodiscovery feature bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant