Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
3e96ef06
Commit
3e96ef06
authored
11 years ago
by
felmer
Browse files
Options
Downloads
Patches
Plain Diff
SP-1064, SWE-36: test_yeastx.py: 'ignore-empty-dir' and 'ignore-no-index' examples added
SVN: 30364
parent
6ee41670
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
integration-tests/test_yeastx.py
+30
-19
30 additions, 19 deletions
integration-tests/test_yeastx.py
with
30 additions
and
19 deletions
integration-tests/test_yeastx.py
+
30
−
19
View file @
3e96ef06
...
...
@@ -27,6 +27,9 @@ class TestCase(systemtest.testcase.TestCase):
for
name
in
os
.
listdir
(
self
.
getExpectedErrorLogsFolder
(
openbisController
.
testName
)):
dataName
=
name
[
0
:
-
4
]
self
.
dropInvalidData
(
openbisController
,
dataName
)
self
.
dropInvalidData
(
openbisController
,
'
ignore-empty-dir
'
,
expectingEmptyData
=
True
)
self
.
dropInvalidData
(
openbisController
,
'
ignore-no-index
'
,
expectingEmptyData
=
True
)
def
executeInDevMode
(
self
):
openbisController
=
self
.
createOpenbisController
(
dropDatabases
=
False
)
...
...
@@ -38,30 +41,38 @@ class TestCase(systemtest.testcase.TestCase):
openbisController
.
assertNumberOfDataSets
(
numberOfDataSets
,
openbisController
.
getDataSets
())
def
dropInvalidData
(
self
,
openbisController
,
dataName
):
def
dropInvalidData
(
self
,
openbisController
,
dataName
,
expectingEmptyData
=
False
):
openbisController
.
drop
(
dataName
,
'
incoming
'
)
openbisController
.
waitUntilConditionMatched
(
util
.
RegexCondition
(
"
File %s not written to faulty paths
"
%
dataName
))
dataFolder
=
"
%s/data/incoming/%s
"
%
(
openbisController
.
installPath
,
dataName
)
logFile
=
"
%s/error-log.txt
"
%
dataFolder
if
not
os
.
path
.
exists
(
"
%s/_delete_me_after_correcting_errors
"
%
dataFolder
):
self
.
fail
(
"
Expected marker file
'
_delete_me_after_correcting_errors
'
doesn
'
t exists in %s.
"
%
dataFolder
)
if
not
os
.
path
.
exists
(
logFile
):
self
.
fail
(
"
Expected error log doesn
'
t exist: %s
"
%
logFile
)
else
:
lines
=
self
.
getErrorLog
(
logFile
)
expectedLines
=
self
.
getExpectedLogEntries
(
openbisController
.
testName
,
dataName
)
failed
=
False
for
i
,
line
,
expectedLine
in
zip
(
range
(
len
(
lines
)),
lines
,
expectedLines
):
if
not
self
.
assertEquals
(
"
%d. line of
'
%s
'"
%
(
i
+
1
,
dataName
),
expectedLine
.
rstrip
(),
line
.
rstrip
()):
self
.
printLogEntries
(
lines
)
failed
=
True
break
if
not
failed
:
if
not
self
.
assertEquals
(
"
number of log entries
"
,
len
(
expectedLines
),
len
(
lines
)):
self
.
printLogEntries
(
lines
)
try
:
if
expectingEmptyData
:
if
os
.
path
.
exists
(
"
%s/_delete_me_after_correcting_errors
"
%
dataFolder
):
self
.
fail
(
"
Not expecting marker file
'
_delete_me_after_correcting_errors
'
in %s.
"
%
dataFolder
)
if
os
.
path
.
exists
(
logFile
):
self
.
fail
(
"
Not expecting error log file: %s
"
%
logFile
)
else
:
util
.
printAndFlush
(
"
Log file %s contains expected messages
"
%
dataFolder
)
util
.
deleteFolder
(
dataFolder
)
if
not
os
.
path
.
exists
(
"
%s/_delete_me_after_correcting_errors
"
%
dataFolder
):
self
.
fail
(
"
Expected marker file
'
_delete_me_after_correcting_errors
'
doesn
'
t exists in %s.
"
%
dataFolder
)
if
not
os
.
path
.
exists
(
logFile
):
self
.
fail
(
"
Expected error log doesn
'
t exist: %s
"
%
logFile
)
else
:
lines
=
self
.
getErrorLog
(
logFile
)
expectedLines
=
self
.
getExpectedLogEntries
(
openbisController
.
testName
,
dataName
)
failed
=
False
for
i
,
line
,
expectedLine
in
zip
(
range
(
len
(
lines
)),
lines
,
expectedLines
):
if
not
self
.
assertEquals
(
"
%d. line of
'
%s
'"
%
(
i
+
1
,
dataName
),
expectedLine
.
rstrip
(),
line
.
rstrip
()):
self
.
printLogEntries
(
lines
)
failed
=
True
break
if
not
failed
:
if
not
self
.
assertEquals
(
"
number of log entries
"
,
len
(
expectedLines
),
len
(
lines
)):
self
.
printLogEntries
(
lines
)
else
:
util
.
printAndFlush
(
"
Log file %s contains expected messages
"
%
dataFolder
)
finally
:
util
.
deleteFolder
(
dataFolder
)
def
printLogEntries
(
self
,
lines
):
util
.
printAndFlush
(
"
All log entries:
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment