Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gaudi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gaudi
Gaudi
Commits
1b116260
Commit
1b116260
authored
1 year ago
by
Marco Clemencic
Browse files
Options
Downloads
Patches
Plain Diff
Make sure OutputStream instances are configured with and explicit OutputFile
parent
b945597f
No related branches found
No related tags found
1 merge request
!1467
Make sure OutputStream instances are configured with and explicit Output option
Pipeline
#5746955
passed
1 year ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GaudiCommonSvc/src/PersistencySvc/OutputStream.cpp
+5
-0
5 additions, 0 deletions
GaudiCommonSvc/src/PersistencySvc/OutputStream.cpp
GaudiExamples/tests/pytest/test_outputfile_not_defined.py
+47
-0
47 additions, 0 deletions
GaudiExamples/tests/pytest/test_outputfile_not_defined.py
with
52 additions
and
0 deletions
GaudiCommonSvc/src/PersistencySvc/OutputStream.cpp
+
5
−
0
View file @
1b116260
...
@@ -54,6 +54,11 @@ StatusCode OutputStream::initialize() {
...
@@ -54,6 +54,11 @@ StatusCode OutputStream::initialize() {
auto
status
=
Algorithm
::
initialize
();
auto
status
=
Algorithm
::
initialize
();
if
(
status
.
isFailure
()
)
return
status
;
if
(
status
.
isFailure
()
)
return
status
;
if
(
m_output
.
empty
()
)
{
fatal
()
<<
"property Output not set. OutputStream instances require an output"
<<
endmsg
;
return
StatusCode
::
FAILURE
;
}
// Reset the number of events written
// Reset the number of events written
m_events
=
0
;
m_events
=
0
;
// Get access to the DataManagerSvc
// Get access to the DataManagerSvc
...
...
This diff is collapsed.
Click to expand it.
GaudiExamples/tests/pytest/test_outputfile_not_defined.py
0 → 100644
+
47
−
0
View file @
1b116260
#####################################################################################
# (c) Copyright 2023 CERN for the benefit of the LHCb and ATLAS collaborations #
# #
# This software is distributed under the terms of the Apache version 2 licence, #
# copied verbatim in the file "LICENSE". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
#####################################################################################
import
os
import
sys
from
GaudiTests
import
run_gaudi
def
config
():
"""
Configure a job writing to an empty file.
"""
from
Configurables
import
GaudiPersistency
from
GaudiConfig2
import
Configurables
as
C
GaudiPersistency
()
out
=
C
.
OutputStream
(
ItemList
=
[
"
/Event#999
"
],
)
app
=
C
.
ApplicationMgr
(
EvtMax
=
1
,
OutStream
=
[
out
.
__opt_value__
()])
return
[
app
,
out
]
def
test
(
tmp_path
):
"""
Check that an output file is created even if no event is written to it.
"""
os
.
chdir
(
tmp_path
)
result
=
run_gaudi
(
f
"
{
__file__
}
:config
"
,
capture_output
=
True
,
errors
=
"
surrogateescape
"
)
print
(
result
.
stdout
,
end
=
""
)
print
(
result
.
stderr
,
end
=
""
,
file
=
sys
.
stderr
)
assert
result
.
returncode
==
1
assert
"
OutputStream instances require an output
"
in
result
.
stdout
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