ERP5Type/tests/Sequence: be quiet by default
Sequence produce lots of useless output, which makes it slow to display test result pages for tests using sequences, like testBusinesTemplate. It must also be taking a lot of disk space on the server and is generally not useful, when a test fail we have the log of the failing test.
-
Owner
@jerome I agree with the idea 'quiet by default'. But still I prefer having the progress when I run a test manually with
-D
option.How about the following change ?
--- product/ERP5Type/tests/Sequence.py +++ product/ERP5Type/tests/Sequence.py @@ -28,6 +28,7 @@ from Testing import ZopeTestCase from zLOG import LOG +import os import random @@ -313,7 +314,7 @@ class SequenceList: self.addSequence(sequence) return sequence - def play(self, context, quiet=True): + def play(self, context, quiet=not os.environ.get('erp5_debug_mode')): i = 1 for sequence in self._sequence_list: sequence._played_index = 0
Maybe non-quiet is preferrable while running live test as well ?
-
Owner
Isn't this following the
--verbose
argument ofrunUnitTest
? If you run with-v -D
don't you see the detailed output ? In ComponentTool_viewLiveTestDialog there is a "verbose" checkbox that should also do the same thing. -
Owner
No, I see no detailed output even with
-v -D
. Do we have such code ? -
Developer
I noticed this change in live tests. I have
Verbose
checked and I get no steps in the gadget unless some fails. Even if I checkDebug
it is the same -
Owner
ah thanks for trying, apparently we don't. We do things like https://lab.nexedi.com/nexedi/erp5/blob/a3f01a7a9a2f17312310e6bcfb70bb96b9f78ff7/bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testPackingList.py#L1102 , but quiet is defined as a class attribute https://lab.nexedi.com/nexedi/erp5/blob/a3f01a7a9a2f17312310e6bcfb70bb96b9f78ff7/bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testPackingList.py#L1038
Anyway, how about doing something similar as you suggest, but depending on
-v
and not-D
? I don't use sequence test so much and I don't care about output so I don't have objections regarding one way or another -
Owner
as we see in testPackingList, we have tests hardcoding the quiet, this (and the run=run_all_tests as well) can all be removed I think
-
Developer
but depending on
-v
and not-D
my gut feeling is the same.
verbose
is what I'd expect to make the steps shown -
Owner
Yes, it should be
-v
, not-D
.