Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bliss
bliss
Commits
bb72ab66
Commit
bb72ab66
authored
Jul 12, 2021
by
Wout De Nolf
Browse files
deprecation warning for the ICAT tango servers
parent
1daf16ca
Pipeline
#50504
passed with stages
in 108 minutes and 46 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bliss/scanning/scan_saving.py
View file @
bb72ab66
...
...
@@ -854,6 +854,9 @@ class ESRFScanSaving(BasicScanSaving):
try
:
self
.
_icat_client
=
icat_client_from_config
()
except
Exception
:
logtools
.
user_warning
(
"The `icat_servers` beacon configuration is missing. Falling back to the deprecated ICAT tango servers."
)
self
.
_icat_client
=
IcatTangoProxy
(
self
.
beamline
,
self
.
session
)
return
self
.
_icat_client
...
...
tests/conftest.py
View file @
bb72ab66
...
...
@@ -1170,17 +1170,13 @@ def icat_backend(stomp_server, activemq_rest_server, icat_logbook_server):
elogbook_url
=
f
"http://localhost:
{
port
}
"
host
,
port
=
activemq_rest_server
metadata_queue_monitor_port
=
port
yield
{
icat_servers
=
{
"metadata_urls"
:
metadata_urls
,
"elogbook_url"
:
elogbook_url
,
"metadata_queue_monitor_port"
:
metadata_queue_monitor_port
,
}
@
pytest
.
fixture
def
icat_config_backend
(
icat_backend
):
config
=
static
.
get_config
()
config
.
root
[
"icat_servers"
]
=
icat_
backend
config
.
root
[
"icat_servers"
]
=
icat_
servers
try
:
yield
finally
:
...
...
tests/data_policy/conftest.py
View file @
bb72ab66
...
...
@@ -56,7 +56,7 @@ def _esrf_data_policy(session):
@
pytest
.
fixture
def
esrf_data_policy
(
session
,
icat_
config_
backend
):
def
esrf_data_policy
(
session
,
icat_backend
):
yield
from
_esrf_data_policy
(
session
)
...
...
@@ -75,7 +75,7 @@ def session2(beacon, scan_tmpdir):
@
pytest
.
fixture
def
esrf_data_policy2
(
session2
,
icat_
config_
backend
):
def
esrf_data_policy2
(
session2
,
icat_backend
):
yield
from
_esrf_data_policy
(
session2
)
...
...
tests/session/test_setup_logging.py
View file @
bb72ab66
...
...
@@ -47,7 +47,7 @@ def logging_session_without_elogserver(beacon_with_logging_esrf, log_directory):
@
pytest
.
fixture
def
logging_session_with_elogserver
(
beacon_with_logging_esrf
,
metaexp_with_backend
,
metamgr_with
_backend
,
log_directory
beacon_with_logging_esrf
,
icat
_backend
,
log_directory
):
logfile
=
os
.
path
.
join
(
log_directory
,
"test_logging_session.log"
)
with
open
(
logfile
,
"w"
):
...
...
@@ -63,14 +63,19 @@ def check_scripts_finished(session):
assert
session
.
env_dict
.
get
(
"scriptfinished"
)
def
check_user_logging
(
capsys
,
elog_offline
=
False
):
def
check_user_logging
(
capsys
,
elog_offline
=
False
,
data_policy
=
True
):
captured
=
capsys
.
readouterr
().
err
.
split
(
"
\n
"
)
captured
=
[
s
for
s
in
captured
if
s
]
assert
len
(
captured
)
==
6
+
elog_offline
,
captured
nexpected
=
6
+
elog_offline
+
(
elog_offline
and
data_policy
)
assert
len
(
captured
)
==
nexpected
,
captured
i
=
0
expected
=
"ERROR: LogInitController: user error"
assert
captured
[
i
]
==
expected
i
+=
1
if
data_policy
and
elog_offline
:
expected
=
"WARNING: The `icat_servers` beacon configuration is missing. Falling back to the deprecated ICAT tango servers."
assert
captured
[
i
]
==
expected
i
+=
1
if
elog_offline
:
expected
=
"Electronic logbook failed"
assert
expected
in
captured
[
i
]
...
...
@@ -142,7 +147,7 @@ def test_setup_logging_no_data_policy(
):
logfile
=
os
.
path
.
join
(
log_directory
,
logging_session
.
name
+
".log"
)
check_scripts_finished
(
logging_session
)
check_user_logging
(
capsys
)
check_user_logging
(
capsys
,
data_policy
=
False
)
check_beacon_logging
(
caplog
,
logfile
)
assert
len
(
icat_logbook_subscriber
)
==
0
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment