#12361 closed enhancement (fixed)
Reduce session karma
| Reported by: | Ryan J Ollos | Owned by: | Dirk Stöcker |
|---|---|---|---|
| Priority: | normal | Milestone: | plugin - spam-filter |
| Component: | plugin/spamfilter | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: |
|
||
| API Changes: | |||
| Internal Changes: | |||
Description
Mentioned in comment:1:ticket:12360 was that it's helpful to have tickets to discuss changes. One reason is, the changes in r14543 broke the tests. I recently fixed all failing tests before bumping the version to 1.0.7. I'll look into fixing the failing tests now.
test_new_session (tracspamfilter.filters.tests.session.SessionFilterStrategyTestCase) ... FAIL
test_session_email_set (tracspamfilter.filters.tests.session.SessionFilterStrategyTestCase) ... FAIL
test_session_email_set_but_invalid (tracspamfilter.filters.tests.session.SessionFilterStrategyTestCase) ... FAIL
test_session_name_and_email_set (tracspamfilter.filters.tests.session.SessionFilterStrategyTestCase) ... FAIL
test_session_name_set (tracspamfilter.filters.tests.session.SessionFilterStrategyTestCase) ... FAIL
======================================================================
FAIL: test_new_session (tracspamfilter.filters.tests.session.SessionFilterStrategyTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/rjollos/Documents/Workspace/trac-dev/spam-filter/tracspamfilter/filters/tests/session.py", line 31, in test_new_session
self.assertEqual((3, 'Existing session found'), retval)
AssertionError: Tuples differ: (3, 'Existing session found') != (2, 'Existing session found')
First differing element 0:
3
2
- (3, 'Existing session found')
? ^
+ (2, 'Existing session found')
? ^
======================================================================
FAIL: test_session_email_set (tracspamfilter.filters.tests.session.SessionFilterStrategyTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/rjollos/Documents/Workspace/trac-dev/spam-filter/tracspamfilter/filters/tests/session.py", line 43, in test_session_email_set
self.assertEqual((6, 'Existing session found'), retval)
AssertionError: Tuples differ: (6, 'Existing session found') != (4, 'Existing session found')
First differing element 0:
6
4
- (6, 'Existing session found')
? ^
+ (4, 'Existing session found')
? ^
======================================================================
FAIL: test_session_email_set_but_invalid (tracspamfilter.filters.tests.session.SessionFilterStrategyTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/rjollos/Documents/Workspace/trac-dev/spam-filter/tracspamfilter/filters/tests/session.py", line 49, in test_session_email_set_but_invalid
self.assertEqual((3, 'Existing session found'), retval)
AssertionError: Tuples differ: (3, 'Existing session found') != (2, 'Existing session found')
First differing element 0:
3
2
- (3, 'Existing session found')
? ^
+ (2, 'Existing session found')
? ^
======================================================================
FAIL: test_session_name_and_email_set (tracspamfilter.filters.tests.session.SessionFilterStrategyTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/rjollos/Documents/Workspace/trac-dev/spam-filter/tracspamfilter/filters/tests/session.py", line 55, in test_session_name_and_email_set
self.assertEqual((9, 'Existing session found'), retval)
AssertionError: Tuples differ: (9, 'Existing session found') != (6, 'Existing session found')
First differing element 0:
9
6
- (9, 'Existing session found')
? ^
+ (6, 'Existing session found')
? ^
======================================================================
FAIL: test_session_name_set (tracspamfilter.filters.tests.session.SessionFilterStrategyTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/rjollos/Documents/Workspace/trac-dev/spam-filter/tracspamfilter/filters/tests/session.py", line 37, in test_session_name_set
self.assertEqual((6, 'Existing session found'), retval)
AssertionError: Tuples differ: (6, 'Existing session found') != (4, 'Existing session found')
First differing element 0:
6
4
- (6, 'Existing session found')
? ^
+ (4, 'Existing session found')
? ^
----------------------------------------------------------------------
Ran 32 tests in 0.277s
FAILED (failures=5)
Attachments (0)
Change History (3)
comment:1 by , 10 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:2 by , 10 years ago
| Release Notes: | modified (diff) |
|---|
One-line change in [14556]. I'll just make a note of here and add to Release Notes so I don't have to create a ticket.
comment:3 by , 10 years ago
Rationale of this change: In the past spam bots usually did not create a Session before submissions. Now they do. So the test has a high number (more than 70%) of false positives. Thus I reduced the impact. I did not remove it, as it still has some positive effects for HAM.



Test cases fixed in [14561]. I assume those values are correct for the change made in r14543, but you may want to confirm. You may also be able to provide a better Release Notes entry than what I copied from the commit message, since I know little about this change.