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
30895a09
Commit
30895a09
authored
8 years ago
by
felmer
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-3505: escaping failure message in CDATA of test report xml.
SVN: 36288
parent
6a872e26
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
integration-tests/test.py
+4
-3
4 additions, 3 deletions
integration-tests/test.py
with
4 additions
and
3 deletions
integration-tests/test.py
+
4
−
3
View file @
30895a09
...
@@ -39,17 +39,18 @@ with open('targets/test-results/TEST-integration.xml', 'w') as out:
...
@@ -39,17 +39,18 @@ with open('targets/test-results/TEST-integration.xml', 'w') as out:
out
.
write
(
"
<testsuite name=
'
integration
'
tests=
'
%s
'
failures=
'
%s
'
errors=
'
0
'
timestamp=
'
%s
'
time=
'
%s
'
>
\n
"
out
.
write
(
"
<testsuite name=
'
integration
'
tests=
'
%s
'
failures=
'
%s
'
errors=
'
0
'
timestamp=
'
%s
'
time=
'
%s
'
>
\n
"
%
(
len
(
testCases
),
len
(
failedTestCases
),
renderedStartTime
,
int
(
1000
*
duration
)))
%
(
len
(
testCases
),
len
(
failedTestCases
),
renderedStartTime
,
int
(
1000
*
duration
)))
for
testCase
in
testCases
:
for
testCase
in
testCases
:
testCaseDuration
=
int
(
1000
*
testCaseDurations
[
testCase
])
if
testCase
in
failedTestCases
:
if
testCase
in
failedTestCases
:
out
.
write
(
"
<testcase name=
'
%s
'
time=
'
%s
'
>
\n
"
%
(
testCase
,
int
(
1000
*
testCaseDuration
s
[
testCase
])
))
out
.
write
(
"
<testcase name=
'
%s
'
time=
'
%s
'
>
\n
"
%
(
testCase
,
testCaseDuration
))
exceptionInfo
=
failedTestCases
[
testCase
]
exceptionInfo
=
failedTestCases
[
testCase
]
out
.
write
(
"
<failure>
\n
"
)
out
.
write
(
"
<failure>
\n
"
)
msgs
=
traceback
.
format_exception
(
exceptionInfo
[
0
],
exceptionInfo
[
1
],
exceptionInfo
[
2
])
msgs
=
traceback
.
format_exception
(
exceptionInfo
[
0
],
exceptionInfo
[
1
],
exceptionInfo
[
2
])
for
msg
in
msgs
:
for
msg
in
msgs
:
out
.
write
(
"
%s
\n
"
%
msg
)
out
.
write
(
"
<![CDATA[
\n
%s
\n
]]>
\n
"
%
msg
)
out
.
write
(
"
</failure>
\n
"
)
out
.
write
(
"
</failure>
\n
"
)
out
.
write
(
"
</testcase>
\n
"
)
out
.
write
(
"
</testcase>
\n
"
)
else
:
else
:
out
.
write
(
"
<testcase name=
'
%s
'
/>
\n
"
%
testCase
)
out
.
write
(
"
<testcase name=
'
%s
'
time=
'
%s
'
/>
\n
"
%
(
testCase
,
testCaseDuration
)
)
out
.
write
(
"
</testsuite>
\n
"
)
out
.
write
(
"
</testsuite>
\n
"
)
printAndFlush
(
'
=====================================
'
)
printAndFlush
(
'
=====================================
'
)
printAndFlush
(
"
%d test cases executed in %s
"
%
(
len
(
testCases
),
renderDuration
(
duration
)))
printAndFlush
(
"
%d test cases executed in %s
"
%
(
len
(
testCases
),
renderDuration
(
duration
)))
...
...
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