Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
neoppod
Commits
a5f2f604
Commit
a5f2f604
authored
Jan 16, 2014
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: review report and mark known failures as expected
parent
d250deca
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
105 additions
and
134 deletions
+105
-134
neo/scripts/runner.py
neo/scripts/runner.py
+63
-118
neo/tests/__init__.py
neo/tests/__init__.py
+20
-6
neo/tests/functional/testClient.py
neo/tests/functional/testClient.py
+2
-0
neo/tests/threaded/test.py
neo/tests/threaded/test.py
+8
-2
neo/tests/zodb/testPack.py
neo/tests/zodb/testPack.py
+7
-6
neo/tests/zodb/testUndo.py
neo/tests/zodb/testUndo.py
+4
-1
tools/test_bot
tools/test_bot
+1
-1
No files found.
neo/scripts/runner.py
View file @
a5f2f604
This diff is collapsed.
Click to expand it.
neo/tests/__init__.py
View file @
a5f2f604
...
...
@@ -16,6 +16,7 @@
import
__builtin__
import
errno
import
functools
import
os
import
random
import
socket
...
...
@@ -31,11 +32,28 @@ from neo.lib.protocol import NodeTypes, Packets, UUID_NAMESPACES
from
neo.lib.util
import
getAddressType
from
time
import
time
from
struct
import
pack
,
unpack
from
unittest.case
import
_ExpectedFailure
,
_UnexpectedSuccess
try
:
from
ZODB.utils
import
newTid
except
ImportError
:
pass
def
expectedFailure
(
exception
=
AssertionError
):
def
decorator
(
func
):
def
wrapper
(
*
args
,
**
kw
):
try
:
func
(
*
args
,
**
kw
)
except
exception
,
e
:
# XXX: passing sys.exc_info() causes deadlocks
raise
_ExpectedFailure
((
type
(
e
),
None
,
None
))
raise
_UnexpectedSuccess
return
functools
.
wraps
(
func
)(
wrapper
)
if
callable
(
exception
)
and
not
isinstance
(
exception
,
type
):
func
=
exception
exception
=
Exception
return
decorator
(
func
)
return
decorator
DB_PREFIX
=
os
.
getenv
(
'NEO_DB_PREFIX'
,
'test_neo'
)
DB_ADMIN
=
os
.
getenv
(
'NEO_DB_ADMIN'
,
'root'
)
DB_PASSWD
=
os
.
getenv
(
'NEO_DB_PASSWD'
,
''
)
...
...
@@ -117,8 +135,6 @@ def setupMySQLdb(db_list, user=DB_USER, password='', clear_databases=True):
class
NeoTestBase
(
unittest
.
TestCase
):
def
setUp
(
self
):
sys
.
stdout
.
write
(
' * %s '
%
(
self
.
id
(),
))
sys
.
stdout
.
flush
()
logging
.
name
=
self
.
setupLog
()
unittest
.
TestCase
.
setUp
(
self
)
...
...
@@ -126,17 +142,15 @@ class NeoTestBase(unittest.TestCase):
test_case
,
logging
.
name
=
self
.
id
().
rsplit
(
'.'
,
1
)
logging
.
setup
(
os
.
path
.
join
(
getTempDirectory
(),
test_case
+
'.log'
))
def
tearDown
(
self
,
success
=
'ok'
if
sys
.
version_info
<
(
2
,
7
)
else
'success'
):
def
tearDown
(
self
):
assert
self
.
tearDown
.
im_func
is
NeoTestBase
.
tearDown
.
im_func
self
.
_tearDown
(
sys
.
_getframe
(
1
).
f_locals
[
success
])
self
.
_tearDown
(
sys
.
_getframe
(
1
).
f_locals
[
'success'
])
def
_tearDown
(
self
,
success
):
# Kill all unfinished transactions for next test.
# Note we don't even abort them because it may require a valid
# connection to a master node (see Storage.sync()).
transaction
.
manager
.
__init__
()
print
class
failureException
(
AssertionError
):
def
__init__
(
self
,
msg
=
None
):
...
...
neo/tests/functional/testClient.py
View file @
a5f2f604
...
...
@@ -26,6 +26,7 @@ from ZODB.FileStorage import FileStorage
from
ZODB.POSException
import
ConflictError
from
ZODB.tests.StorageTestBase
import
zodb_pickle
from
persistent
import
Persistent
from
..
import
expectedFailure
from
.
import
NEOCluster
,
NEOFunctionalTest
TREE_SIZE
=
6
...
...
@@ -220,6 +221,7 @@ class ClientTests(NEOFunctionalTest):
self
.
__checkTree
(
root
[
'trees'
])
@
expectedFailure
(
AttributeError
)
def
testExportFileStorageBug
(
self
):
# currently fails due to a bug in ZODB.FileStorage
self
.
testExport
(
True
)
...
...
neo/tests/threaded/test.py
View file @
a5f2f604
...
...
@@ -26,6 +26,7 @@ from neo.storage.transactions import TransactionManager, \
from
neo.lib.connection
import
ConnectionClosed
,
MTClientConnection
from
neo.lib.protocol
import
CellStates
,
ClusterStates
,
NodeStates
,
Packets
,
\
ZERO_TID
from
..
import
expectedFailure
,
_UnexpectedSuccess
from
.
import
ClientApplication
,
NEOCluster
,
NEOThreadedTest
,
Patch
from
neo.lib.util
import
add64
,
makeChecksum
from
neo.client.pool
import
CELL_CONNECTED
,
CELL_GOOD
...
...
@@ -237,6 +238,7 @@ class Test(NEOThreadedTest):
self
.
assertEqual
(
self
.
_testDeadlockAvoidance
([
2
,
4
]),
[
DelayedError
,
DelayedError
,
ConflictError
,
ConflictError
])
@
expectedFailure
(
POSException
.
ConflictError
)
def
testDeadlockAvoidance
(
self
):
# This test fail because deadlock avoidance is not fully implemented.
# 0: C1 -> S1
...
...
@@ -717,9 +719,13 @@ class Test(NEOThreadedTest):
# XXX: This is an expected failure. A ttid column was added to
# 'trans' table to permit recovery, by checking that the
# transaction was really committed.
self
.
assertRaises
(
ConnectionClosed
,
t
.
commit
)
try
:
t
.
commit
()
raise
_UnexpectedSuccess
except
ConnectionClosed
:
pass
t
.
begin
()
c
.
root
()[
'x'
]
expectedFailure
(
self
.
assertIn
)(
'x'
,
c
.
root
())
finally
:
cluster
.
stop
()
...
...
neo/tests/zodb/testPack.py
View file @
a5f2f604
...
...
@@ -16,14 +16,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
unittest
try
:
from
ZODB.tests.PackableStorage
import
PackableStorageWithOptionalGC
except
ImportError
:
from
ZODB.tests.PackableStorage
import
PackableStorage
as
\
PackableStorageWithOptionalGC
from
ZODB.tests.PackableStorage
import
PackableUndoStorage
from
ZODB.tests.PackableStorage
import
\
PackableStorageWithOptionalGC
,
PackableUndoStorage
from
ZODB.tests.StorageTestBase
import
StorageTestBase
from
..
import
expectedFailure
from
.
import
ZODBTestCase
class
PackableTests
(
ZODBTestCase
,
StorageTestBase
,
...
...
@@ -32,6 +29,10 @@ class PackableTests(ZODBTestCase, StorageTestBase,
def
setUp
(
self
):
super
(
PackableTests
,
self
).
setUp
(
cluster_kw
=
{
'adapter'
:
'MySQL'
})
checkPackAllRevisions
=
expectedFailure
()(
PackableStorageWithOptionalGC
.
checkPackAllRevisions
)
checkPackUndoLog
=
expectedFailure
()(
PackableUndoStorage
.
checkPackUndoLog
)
if
__name__
==
"__main__"
:
suite
=
unittest
.
makeSuite
(
PackableTests
,
'check'
)
unittest
.
main
(
defaultTest
=
'suite'
)
...
...
neo/tests/zodb/testUndo.py
View file @
a5f2f604
...
...
@@ -19,11 +19,14 @@ from ZODB.tests.StorageTestBase import StorageTestBase
from
ZODB.tests.TransactionalUndoStorage
import
TransactionalUndoStorage
from
ZODB.tests.ConflictResolution
import
ConflictResolvingTransUndoStorage
from
..
import
expectedFailure
from
.
import
ZODBTestCase
class
UndoTests
(
ZODBTestCase
,
StorageTestBase
,
TransactionalUndoStorage
,
ConflictResolvingTransUndoStorage
):
pass
checkTransactionalUndoAfterPack
=
expectedFailure
()(
TransactionalUndoStorage
.
checkTransactionalUndoAfterPack
)
# Don't run this test. It cannot run with pipelined store, and is not executed
# on Zeo - but because Zeo doesn't have an iterator, while Neo has.
...
...
tools/test_bot
View file @
a5f2f604
...
...
@@ -85,7 +85,7 @@ def main():
revision
[:
7
],
os
.
path
.
basename
(
test_home
),
backend
)
if
tests
:
subprocess
.
call
([
os
.
path
.
join
(
bin
,
'neotestrunner'
),
'-'
+
tests
,
'--title'
,
'NEO tests '
+
title
,
'-
v
'
+
tests
,
'--title'
,
'NEO tests '
+
title
,
]
+
sys
.
argv
[
1
:
arg_count
])
if
'm'
in
tasks
:
subprocess
.
call
([
os
.
path
.
join
(
bin
,
'python'
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment