Add debug log to reorder_topologies command#3785
Open
Conversation
ef0dea6 to
aea3cf3
Compare
Passing run #7421 ↗︎Details:
Review all test suite changes for PR #3785 ↗︎ |
|||||||||||||||
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3785 +/- ##
=======================================
Coverage 98.32% 98.32%
=======================================
Files 292 292
Lines 21818 21820 +2
=======================================
+ Hits 21453 21455 +2
Misses 365 365
☔ View full report in Codecov by Sentry. |
aea3cf3 to
ee9b6fe
Compare
ee9b6fe to
5aa1bff
Compare
| output = StringIO() | ||
| call_command('reorder_topologies', stdout=output) | ||
| self.assertEqual('1 topologies has beeen updated\n', output.getvalue()) | ||
| self.assertEqual(f'Processing topology : {topo.pk}\n1 topologies has beeen updated\n', output.getvalue()) |
Contributor
There was a problem hiding this comment.
Plutôt que de dépendre d'un debug log dans les tests je te propose d'utiliser une regexp :
self.assertIsNotNone(re.search(r"1 topologies has beeen updated", output.getvalue())
marcantoinedupre
requested changes
Oct 11, 2023
| points = cursor.fetchall() | ||
| id_order = 0 | ||
|
|
||
| if options['verbosity']: |
Contributor
There was a problem hiding this comment.
Je te conseille de regarder comment appeler la commande avec la verbosité dans les tests pour faire sauter le warning du code coverage -> https://docs.djangoproject.com/en/3.2/ref/django-admin/#running-management-commands-from-your-code
Je crois qu'il faudrait déclarer cette nouvelle option verbosity dans le parsing de la commande.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make command easier to debug
Related Issue
Checklist