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 test that fails intermittently under python 3.5 #173

Closed
wants to merge 3 commits into from

Conversation

mdelagrange
Copy link
Contributor

Description of the Change

Unit tests will fail intermittently under Python 3.5, because there is a test that expects dict keys to be in a particular order. That feature was not introduced until Python 3.6. This fix will adjust the key order within the test under Python 3.5.

This PR also makes bin/prom2teams executable.

Benefits

Python 3.5 builds in Travis should start passing consistently. See https://travis-ci.org/github/idealista/prom2teams/builds/669700776 and https://travis-ci.org/github/idealista/prom2teams/builds/650821639 for examples of failing Python 3.5 builds.

Possible Drawbacks

This should have no effect on the application or on other tests.

Applicable Issues

None

The diffs can be slightly longer than the default limit.  Disabling
the limit makes it easier to debug test failures.
Dicts are not sorted in Python 3.5, so I adjusted a test that expects
the keys will iterate in a certain order.
@mdelagrange mdelagrange mentioned this pull request Apr 2, 2020
@mdelagrange
Copy link
Contributor Author

Fixes #177

@dortegau
Copy link
Member

Hello @mdelagrange,

We have checked your PR, and we prefer not to merge because your solution is very platform specific (we prefer not to check Python versions in source code) and is not very versatile, as is checking two fields directly (facts and prometheus) and swapping the positions if are unordered.

We have found a general solution using DeepDiff library, that you can check in: #178

Anyway, thanks a lot for your effort and contribution :)

@dortegau dortegau closed this Apr 12, 2020
@mdelagrange
Copy link
Contributor Author

That’s fine! Thanks for putting together a more versatile solution!

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