You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2013/01/21 18:14:33 UTC

[Bug 6893] New: rule_tests.t fails if test_types is defined

https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6893

            Bug ID: 6893
           Summary: rule_tests.t fails if test_types is defined
           Product: Spamassassin
           Version: 3.4 SVN branch
          Hardware: PC
                OS: Windows 7
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: Regression Tests
          Assignee: dev@spamassassin.apache.org
          Reporter: kmcgrail@pccc.com
    Classification: Unclassified

As seen on Jenkins, if Conf/Parser.pm leaves the test_types in the code (see
bug 5503), rule_tests.t will fail.

This is because rule_tests.t was completely skipping every test previously
because of this logic:

next unless defined($test_type);        # score, but no test

Now that the tests are running, they are bombing out on a few of them:

Jenkin's output:
Test for 'HIDE_WIN_STATUS' (type: 14) against 'attributes like href=foo
onMouseOver="flashiness"'
ok 26
Use of uninitialized value in pattern match (m//) at t/rule_tests.t line 69.
Use of uninitialized value in substitution (s///) at t/rule_tests.t line 70.
Use of uninitialized value in concatenation (.) or string at t/rule_tests.t
line 72.
Test for 'FROM_STARTS_WITH_NUMS' (type: 8) against '12345678matt@sergeant.org'
not ok 27
# Test 27 got: "0" (t/rule_tests.t at line 108 fail #26)
#    Expected: "1" (Test for 'FROM_STARTS_WITH_NUMS' (type: 8) against
'12345678matt@sergeant.org')
Use of uninitialized value in pattern match (m//) at t/rule_tests.t line 69.
Use of uninitialized value in substitution (s///) at t/rule_tests.t line 70.
Use of uninitialized value in concatenation (.) or string at t/rule_tests.t
line 72.
Test for 'FROM_STARTS_WITH_NUMS' (type: 8) against 'matt@sergeant.org'
ok 28
Test for 'FORGED_YAHOO_RCVD' (type: 9) against 'by mf1.lng.yahoo.com
(8.11.1/8.11.1) id g3SDfPH19426'
ok 29
Use of uninitialized value in pattern match (m//) at t/rule_tests.t line 69.
Use of uninitialized value in substitution (s///) at t/rule_tests.t line 70.
Use of uninitialized value in concatenation (.) or string at t/rule_tests.t
line 72.
Test for 'INVALID_DATE' (type: 8) against 'Sat, 31 Dec 2005 23:59:60 -0500'
ok 30
Use of uninitialized value in pattern match (m//) at t/rule_tests.t line 69.
Use of uninitialized value in substitution (s///) at t/rule_tests.t line 70.
Use of uninitialized value in concatenation (.) or string at t/rule_tests.t
line 72.
Test for 'INVALID_DATE' (type: 8) against 'Wed, 31 Jul 2002 16:41:57 +0200'
ok 31
Use of uninitialized value in pattern match (m//) at t/rule_tests.t line 69.
Use of uninitialized value in substitution (s///) at t/rule_tests.t line 70.
Use of uninitialized value in concatenation (.) or string at t/rule_tests.t
line 72.
Test for 'INVALID_DATE' (type: 8) against 'Sat, 31 Dec 2005 24:00:00 -0500'
not ok 32
# Test 32 got: "0" (t/rule_tests.t at line 108 fail #31)
#    Expected: "1" (Test for 'INVALID_DATE' (type: 8) against 'Sat, 31 Dec 2005
24:00:00 -0500')
Use of uninitialized value in pattern match (m//) at t/rule_tests.t line 69.
Use of uninitialized value in substitution (s///) at t/rule_tests.t line 70.
Use of uninitialized value in concatenation (.) or string at t/rule_tests.t
line 72.
Test for 'INVALID_DATE' (type: 8) against 'Sat, 31 Dec 2005 23:00:00'
not ok 33
# Test 33 got: "0" (t/rule_tests.t at line 108 fail #32)
#    Expected: "1" (Test for 'INVALID_DATE' (type: 8) against 'Sat, 31 Dec 2005
23:00:00')
Use of uninitialized value in pattern match (m//) at t/rule_tests.t line 69.
Use of uninitialized value in substitution (s///) at t/rule_tests.t line 70.
Use of uninitialized value in concatenation (.) or string at t/rule_tests.t
line 72.
Test for 'INVALID_DATE' (type: 8) against 'Thurs, 31 Jul 2002 16:41:57 +0200'
not ok 34
# Test 34 got: "0" (t/rule_tests.t at line 108 fail #33)
#    Expected: "1" (Test for 'INVALID_DATE' (type: 8) against 'Thurs, 31 Jul
2002 16:41:57 +0200')
 Failed 4/34 subtests

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 6893] rule_tests.t fails if test_types is defined

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6893

Kevin A. McGrail <km...@pccc.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kmcgrail@pccc.com

--- Comment #1 from Kevin A. McGrail <km...@pccc.com> ---
I've been reviewing this code for some time now.

There is no working logic for header tests.  And even the header tests that
pass shouldn't pass because the logic isn't actually working but it returns the
expected answer.

Further, this test doesn't function correctly in SA 3.2.5 or 3.3 branch.

In short, no telling how long it's been broken but it's nothing recent.

I rewrote it from scratch because these regression tests could be quite helpful
to add examples of what you want to pass and fail when you are writing a rule. 
There's only 38 tests right now but I can see this being very useful.

Will commit after a make test completes and hopefully this will also get
Jenkins back to stable.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 6893] rule_tests.t fails if test_types is defined

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6893

Kevin A. McGrail <km...@pccc.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Kevin A. McGrail <km...@pccc.com> ---
svn commit -m 'Added some functions to debug hashes and arrays for test
debugging, rewrote rule_tests.t to work now that test_types is not cleared (bug
6893), fixed a few regression tests that were not up to date, commented one
regression test that is not working (bug 6894).'
Sending        rules/20_head_tests.cf
Sending        rules/regression_tests.cf
Sending        t/SATest.pm
Sending        t/rule_tests.t
Transmitting file data ....
Committed revision 1436729.

-- 
You are receiving this mail because:
You are the assignee for the bug.