Bug 207 - "make test" fails if settings in /etc/spamassassin/local.cf
Summary: "make test" fails if settings in /etc/spamassassin/local.cf
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamassassin (show other bugs)
Version: 2.30CVS
Hardware: All All
: P2 major
Target Milestone: ---
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-11 19:30 UTC by Bart Schaefer
Modified: 2002-06-15 03:58 UTC (History)
2 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status
This is a patch! -- New sub in SATest: skip_all_patterns($skip_message) patch None Duncan Findlay [HasCLA]
Implement spamassassin -C config / spamd -C config patch None Bart Schaefer [NoCLA]
Update previous patch for spamd long options change patch None Bart Schaefer [NoCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Bart Schaefer 2002-04-11 19:30:45 UTC
 
Comment 1 Bart Schaefer 2002-04-11 19:34:28 UTC
Oops, hit ENTER before finishing the description.  Here it is:

Two of the tests fail because of 
my local configuration.  Firstly, I don't have Razor installed.  This test should be skipped in 
that instance:

t/razor.............    Not found: spam =  Listed in Razor 

t/razor.............FAILED test 1                                            
        Failed 1/2 tests, 50.00% okay

Secondly, in my 
/etc/mail/spamassassin/local.cf, I have turned off spam_level_stars.  Testing should not 
fail as a result of my local changes!

t/spamd.............ok 11/13    Not found: stars =  X-Spam-
Level: ********** 
t/spamd.............FAILED test 12                                           
        Failed 1/13 tests, 92.31% okay
Comment 2 Duncan Findlay 2002-04-11 21:21:32 UTC

*** This bug has been marked as a duplicate of 68 ***
Comment 3 Craig Hughes 2002-04-11 23:34:23 UTC
Subject: Re: [SAdev]  "make test" fails because of local rules

Actually, the part about razor not being tested if razor not installed is a new 
bug, but I'll fix it right now, so won't bother reopening.

Comment 4 Bart Schaefer 2002-04-14 09:12:40 UTC
I won't reopen the bug (yet) either, but I don't yet see any evidence that the razor test has been 
fixed.
Comment 5 Duncan Findlay 2002-04-14 11:45:10 UTC
Err... This bug is fixed.

But what remains unresolved is that make test fails with razor not installed.

I'm preparing a patch right now.
Comment 6 Duncan Findlay 2002-04-14 11:50:28 UTC
Created attachment 68 [details]
This is a patch! -- New sub in SATest: skip_all_patterns($skip_message)
Comment 7 Duncan Findlay 2002-04-14 11:51:11 UTC
Reassigning to Craig
Comment 8 Craig Hughes 2002-04-14 12:13:46 UTC
Great, thanks for the patch.  In CVS now (and will make it into 2.20!)
Comment 9 Bart Schaefer 2002-04-14 12:27:44 UTC
Duncan says this bug has been fixed (and the razor test part of it has, now, thanks very much) but 
with the latest CVS I am still getting:

t/spamd.............ok 11/13    Not found: stars =  X-
Spam-Level: ********** 
t/spamd.............FAILED test 12                                           
        Failed 1/13 tests, 92.31% 
okay

Note that I'm NOT talking about a user_prefs file here, I'm talking about having 
globally disabled spam_level_stars in /etc/mail/spamassassin/local.cf.
Comment 10 Craig Hughes 2002-04-14 13:10:56 UTC
Subject: Re:  "make test" fails if Razor is not installed

Well, if you want to fix that you have 3 options:

1. Ignore the failed test.  You know why it's failing, you know it's not a 
problem.
2. Temporarily move/rename/disable your local.cf while doing the make test.
3. Submit a patch which makes the testing stuff bypass local config file 
changes.

Comment 11 Duncan Findlay 2002-04-14 13:52:57 UTC
I thought this was all fixed in bug 68.

Oh well.
Comment 12 Duncan Findlay 2002-04-14 13:54:05 UTC
Assigning to list...
Comment 13 Bart Schaefer 2002-05-28 22:20:09 UTC
Craig suggested:
> 3. Submit a patch which makes the testing stuff bypass
> local config file changes.

A few remarks:

After some investigation it's apparent that the spamassassin tests skip the
local.cf by getting the "-c ../rules" argument from t/SATest.pm sa_t_init().
Similarly, t/rule_tests.t passes rules_filename to Mail::Spamassassin->new;
t/spamd.t fails because spamd doesn't have an equivalent way to override the
rules file location.

Unfortunately "spamd -c" is already taken.  It'd be really nice if both spamd
and spamassassin used the same option for this.  As "spamassassin -C" is not yet
taken, I'd suggest adding -C to both spamassassin and spamd as equivalent to the
exisiting "spamassassin -c", and deprecate "spamassassin -c".

However, that still leaves the question of the right way to write the test. 
Should t/spamd.t pass "-C ../rules -L" to sdrun()?  Or should t/SATest.pm be
modified to put a "-C ../rules" into a variable via sa_t_init(), and then use
that variable in start_spamd()?
Comment 14 Bart Schaefer 2002-06-08 10:56:15 UTC
Created attachment 152 [details]
Implement spamassassin -C config / spamd -C config
Comment 15 Bart Schaefer 2002-06-08 10:58:13 UTC
I've attached patch #152 which adds the -C option to both spamassassin and spamd.

I went with changing sa_t_init() for the tests.
Comment 16 Bart Schaefer 2002-06-09 21:43:13 UTC
Created attachment 154 [details]
Update previous patch for spamd long options change
Comment 17 Craig Hughes 2002-06-09 21:50:21 UTC
Made some minor changes to adjust for the new spamd longopts code, plus I changed the 
Pod::Usage call to verbose=0 and added a direction to the manpage for more details.  I think 
changing SATest was the right way to go, given that each spamd_xxx.t file is going to want to do 
it, and any test which wants something else will have its own -C flag appended, which will override 
the default -C anyway.
Comment 18 Craig Hughes 2002-06-09 23:01:27 UTC
*** Bug 264 has been marked as a duplicate of this bug. ***