-
Notifications
You must be signed in to change notification settings - Fork 80
Add debug log to reorder_topologies command #3785
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
base: master
Are you sure you want to change the base?
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()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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())
| points = cursor.fetchall() | ||
| id_order = 0 | ||
|
|
||
| if options['verbosity']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Make command easier to debug
Related Issue
Checklist