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 #151 #155

Merged
merged 5 commits into from
Aug 3, 2020
Merged

Fix #151 #155

merged 5 commits into from
Aug 3, 2020

Conversation

joselsegura
Copy link
Collaborator

Description

The problem is caused because the list returned by the rule_ids endpoint is generated from a map, so its order is not granted.
This fix orders the output using sort, making the result predictable

Fixes #151

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Testing steps

Regular CI

@codecov-commenter
Copy link

codecov-commenter commented Jul 31, 2020

Codecov Report

Merging #155 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #155   +/-   ##
=======================================
  Coverage   49.21%   49.21%           
=======================================
  Files          12       12           
  Lines        1024     1024           
=======================================
  Hits          504      504           
  Misses        461      461           
  Partials       59       59           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0fc39ca...8e52fcd. Read the comment docs.

Copy link
Collaborator

@tisnik tisnik left a comment

Choose a reason for hiding this comment

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

Looks ok, thank you @joselsegura

@@ -121,6 +122,7 @@ func (s *RulesWithContentStorage) GetRuleIDs() []string {
ruleIDs = append(ruleIDs, ruleContent.Plugin.PythonModule)
}

sort.Strings(ruleIDs)

Choose a reason for hiding this comment

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

I think it's better to sort when comparing in tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think about it and you are right. I just modified it

server/server_test.go Outdated Show resolved Hide resolved
@joselsegura joselsegura merged commit 79473c6 into RedHatInsights:master Aug 3, 2020
@joselsegura joselsegura deleted the fix_names_order branch September 27, 2021 15:02
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.

Wrong unit test causes CI to fail
5 participants