[pacman-dev] [PATCH] A very tiny tweak to the unit test framework.
Debugging unit test specifications is made more difficult when the framework cuts the rules short in its test run output. Of course, once debugged there is no interest in seeing the complete rules. Fortunately there is a "-v" option for situations just like this. This is also partially a test of my git-send-email configuration. So thanks, once again, to everyone who helped me with that. I've still got one slightly weird thing: the From line has two <> clauses, one the obscured " at gmail.com", one unobscured. I'm hoping that the listserv will not be too confused... Jeremy Heiner (1): Don't truncate display of rules when unit tests are run with "-v". test/pacman/pmrule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.8.4
Signed-off-by: Jeremy Heiner <ScalaProtractor at gmail.com> --- test/pacman/pmrule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/pacman/pmrule.py b/test/pacman/pmrule.py index c97a158..b289146 100644 --- a/test/pacman/pmrule.py +++ b/test/pacman/pmrule.py @@ -32,7 +32,7 @@ def __init__(self, rule): self.result = 0 def __str__(self): - if len(self.rule) <= 40: + if util.verbose or len(self.rule) <= 40: return self.rule return self.rule[:37] + '...' -- 1.8.4
On 10/02/13 at 09:08am, Jeremy Heiner <ScalaProtractor at gmail.com> wrote:
Signed-off-by: Jeremy Heiner <ScalaProtractor at gmail.com> --- test/pacman/pmrule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/pacman/pmrule.py b/test/pacman/pmrule.py index c97a158..b289146 100644 --- a/test/pacman/pmrule.py +++ b/test/pacman/pmrule.py @@ -32,7 +32,7 @@ def __init__(self, rule): self.result = 0
def __str__(self): - if len(self.rule) <= 40: + if util.verbose or len(self.rule) <= 40: return self.rule return self.rule[:37] + '...'
-- 1.8.4
Can we just remove the truncation altogether? Now that `make check` saves test output to a file, somebody would have to go out of their way to see the rule by either reading test-suite.log or manually running pactest. Either way, I imagine they're more likely to want the full rule. apg
My experience (limited as it is) suggests that the truncation is still helpful de-cluttering when you aren't debugging rules. Running manually let me narrow the selection of tests (e.g. tests/querycheck00[125].py). When I was working on rules then I usually narrowed to the one file I was editing and wanted to see the full rules, so "-v". But at other times I wanted to run tests/query*.py, and then the full rules were somewhat of a distraction from my task.
On 03/10/13 02:04, Jeremy Heiner wrote:
My experience (limited as it is) suggests that the truncation is still helpful de-cluttering when you aren't debugging rules. Running manually let me narrow the selection of tests (e.g. tests/querycheck00[125].py). When I was working on rules then I usually narrowed to the one file I was editing and wanted to see the full rules, so "-v". But at other times I wanted to run tests/query*.py, and then the full rules were somewhat of a distraction from my task.
Can someone provide examples of the two different outputs and clarify to me where ther are (i.e. terminal, file)? Allan
On 10/09/13 at 02:20pm, Allan McRae wrote:
On 03/10/13 02:04, Jeremy Heiner wrote:
My experience (limited as it is) suggests that the truncation is still helpful de-cluttering when you aren't debugging rules. Running manually let me narrow the selection of tests (e.g. tests/querycheck00[125].py). When I was working on rules then I usually narrowed to the one file I was editing and wanted to see the full rules, so "-v". But at other times I wanted to run tests/query*.py, and then the full rules were somewhat of a distraction from my task.
Can someone provide examples of the two different outputs and clarify to me where ther are (i.e. terminal, file)?
Allan
They're printed by pactest. Since the automake integration, they get redirected to files during `make check`, but still get printed to the terminal when running pactest directly. diff -r tests/query006.log tests-trunc/query006.log 9,10c9,10 < ok 3 - PACMAN_OUTPUT=^Description.*Overflow size and date values if possible < ok 4 - PACMAN_OUTPUT=^Installed Size.*9765625.00 KiB ---
ok 3 - PACMAN_OUTPUT=^Description.*Overflow ... ok 4 - PACMAN_OUTPUT=^Installed Size.*976562...
apg
On 09/10/13 21:56, Andrew Gregory wrote:
On 10/09/13 at 02:20pm, Allan McRae wrote:
On 03/10/13 02:04, Jeremy Heiner wrote:
My experience (limited as it is) suggests that the truncation is still helpful de-cluttering when you aren't debugging rules. Running manually let me narrow the selection of tests (e.g. tests/querycheck00[125].py). When I was working on rules then I usually narrowed to the one file I was editing and wanted to see the full rules, so "-v". But at other times I wanted to run tests/query*.py, and then the full rules were somewhat of a distraction from my task.
Can someone provide examples of the two different outputs and clarify to me where ther are (i.e. terminal, file)?
Allan
They're printed by pactest. Since the automake integration, they get redirected to files during `make check`, but still get printed to the terminal when running pactest directly.
diff -r tests/query006.log tests-trunc/query006.log 9,10c9,10 < ok 3 - PACMAN_OUTPUT=^Description.*Overflow size and date values if possible < ok 4 - PACMAN_OUTPUT=^Installed Size.*9765625.00 KiB ---
ok 3 - PACMAN_OUTPUT=^Description.*Overflow ... ok 4 - PACMAN_OUTPUT=^Installed Size.*976562...
I agree with getting rid of the truncation altogether. Not many lines will go over the standard terminal width anyway. A
The truncation helped back when the test output appeared when run via make. But now "make check" logs that output, and it makes little sense to log the truncated rules. Signed-off-by: Jeremy Heiner <ScalaProtractor at gmail.com> --- test/pacman/pmrule.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/pacman/pmrule.py b/test/pacman/pmrule.py index c97a158..cfcbb6b 100644 --- a/test/pacman/pmrule.py +++ b/test/pacman/pmrule.py @@ -32,9 +32,7 @@ def __init__(self, rule): self.result = 0 def __str__(self): - if len(self.rule) <= 40: - return self.rule - return self.rule[:37] + '...' + return self.rule def check(self, test): """ -- 1.8.4
On Wed, Oct 9, 2013 at 2:48 PM, Jeremy Heiner <scalaprotractor@gmail.com>wrote:
The truncation helped back when the test output appeared when run via make. But now "make check" logs that output, and it makes little sense to log the truncated rules.
Signed-off-by: Jeremy Heiner <ScalaProtractor at gmail.com> ---
Signed-off-by: Dan McGee <dan@archlinux.org>
test/pacman/pmrule.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/test/pacman/pmrule.py b/test/pacman/pmrule.py index c97a158..cfcbb6b 100644 --- a/test/pacman/pmrule.py +++ b/test/pacman/pmrule.py @@ -32,9 +32,7 @@ def __init__(self, rule): self.result = 0
def __str__(self): - if len(self.rule) <= 40: - return self.rule - return self.rule[:37] + '...' + return self.rule
def check(self, test): """ -- 1.8.4
Hrm, still something not quite right in my config. Gotta say: I didn't realize how spoiled I was by using github. Their pull request mechanism and associated commenting+codereview tools are looking really good to me right now.
On 02.10.2013 15:26, Jeremy Heiner wrote:
Hrm, still something not quite right in my config.
Just use git send-email --annotate and add your text after the "---" marker. If you use --compose you create an extra mail which only really makes sense for larger patch sets. Also some of the text you put in that cover letter really belongs in the commit message. Basically the first paragraph.
participants (6)
-
Allan McRae
-
Andrew Gregory
-
Dan McGee
-
Florian Pritz
-
Jeremy Heiner
-
Jeremy Heiner <ScalaProtractor at gmail.com>