Table of Contents
Test Report
View CI Run 2251 | Commit 20bbc4d
🧪 Test Report
Generated on 2025-08-14 15:01:43 CEST
🧾 General Info
- duration: 5.448577165603638
- root: /workspace/tligui_y/slic
- environment: {}
📋 Summary
- Failed: 5
- Total: 5
- Collected: 5
🔎 Tests
❌ Failed (5)
-
📄 test_utils_elog.py
↳ Function: test_get_default_elog_instance_with_direct_password_and_real_check
-
❌ Test 1
📌 Setup phase
duration:
0.0003922269679605961outcome:
passed📌 Call phase
duration:
0.005929328966885805outcome:
failedcrash:
path: /workspace/tligui_y/slic/tests/test_utils_elog.py lineno: 24 message: Failed: elog.open() raised an unexpected exception: Invalid username or password.traceback:
- path: tests/test_utils_elog.py lineno: 24 message: Failedlongrepr:
def test_get_default_elog_instance_with_direct_password_and_real_check(): url = "http://localhost:8080/demo" user = "robot" password = "testpassword" text = "This is a message1" elog = Elog("http://localhost:8080/demo", user=user, password=password, encrypt_pwd=False) try: > elog.post(text) tests/test_utils_elog.py:22: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ slic/utils/elog.py:17: in post return self._log.post(*args, **kwargs) slic/utils/logbook.py:273: in post resp_message, resp_headers, resp_msg_id = _validate_response(response) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ response = <Response [200]> def _validate_response(response): """ Validate response of the request.""" msg_id = None if response.status_code not in [200, 302]: # 200 --> OK; 302 --> Found # Html page is returned with error description (handling errors same way as on original client. Looks # like there is no other way. err = re.findall('<td.*?class="errormsg".*?>.*?</td>', response.content.decode('utf-8', 'ignore'), flags=re.DOTALL) if len(err) > 0: # Remove html tags # If part of the message has: Please go back... remove this part since it is an instruction for # the user when using browser. err = re.sub('(?:<.*?>)', '', err[0]) if err: raise LogbookMessageRejected('Rejected because of: ' + err) else: raise LogbookMessageRejected('Rejected because of unknown error.') # Other unknown errors raise LogbookMessageRejected('Rejected because of unknown error.') else: location = response.headers.get('Location') if location is not None: if 'has moved' in location: raise LogbookServerProblem('Logbook server has moved to another location.') elif 'fail' in location: raise LogbookAuthenticationError('Invalid username or password.') else: # returned locations is something like: '<host>/<sub_dir>/<logbook>/<msg_id><query> # with urllib.parse.urlparse returns attribute path=<sub_dir>/<logbook>/<msg_id> try: msg_id = int(urllib.parse.urlsplit(location).path.split('/')[-1]) except ValueError as e: # it was not possible to get the msg_id. # this may happen when deleting the last entry of a logbook msg_id = None if b'type=password' in response.content or b'type="password"' in response.content: # Not too smart to check this way, but no other indication of this kind of error. # C client does it the same way > raise LogbookAuthenticationError('Invalid username or password.') E slic.utils.logbook_exceptions.LogbookAuthenticationError: Invalid username or password. slic/utils/logbook.py:838: LogbookAuthenticationError During handling of the above exception, another exception occurred: def test_get_default_elog_instance_with_direct_password_and_real_check(): url = "http://localhost:8080/demo" user = "robot" password = "testpassword" text = "This is a message1" elog = Elog("http://localhost:8080/demo", user=user, password=password, encrypt_pwd=False) try: elog.post(text) except Exception as e: > pytest.fail(f"elog.open() raised an unexpected exception: {e}") E Failed: elog.open() raised an unexpected exception: Invalid username or password. tests/test_utils_elog.py:24: Failed📌 Teardown phase
duration:
0.00034636398777365685outcome:
passed
↳ Function: test_get_default_elog_instance_with_wrong_password_and_real_check
-
❌ Test 2
📌 Setup phase
duration:
0.0001376061700284481outcome:
passed📌 Call phase
duration:
0.0034339288249611855outcome:
failedcrash:
path: /workspace/tligui_y/slic/tests/test_utils_elog.py lineno: 44 message: Failed: DID NOT RAISE <class 'elog.logbook_exceptions.LogbookAuthenticationError'>traceback:
- path: tests/test_utils_elog.py lineno: 44 message: Failedlongrepr:
def test_get_default_elog_instance_with_wrong_password_and_real_check(): url = "http://localhost:8080/demo" user = "robot" wrong_password = "wrongpassword" with pytest.raises(LogbookAuthenticationError): > Elog(url, user=user, password=wrong_password) E Failed: DID NOT RAISE <class 'elog.logbook_exceptions.LogbookAuthenticationError'> tests/test_utils_elog.py:44: Failed📌 Teardown phase
duration:
0.0001710420474410057outcome:
passed
↳ Function: test_get_default_elog_instance_asks_password_and_opens
-
❌ Test 3
📌 Setup phase
duration:
0.00013083172962069511outcome:
passed📌 Call phase
duration:
0.007468622177839279outcome:
failedcrash:
path: /workspace/tligui_y/slic/tests/test_utils_elog.py lineno: 61 message: Failed: elog.open() raised an unexpected exception: Invalid username or password.traceback:
- path: tests/test_utils_elog.py lineno: 61 message: Failedlongrepr:
mock_home = <MagicMock name='home' id='140304201313008'> mock_getpass = <MagicMock name='getpass' id='140304195612736'> @patch("slic.utils.elog.getpass") @patch("slic.utils.elog.Path.home") def test_get_default_elog_instance_asks_password_and_opens(mock_home, mock_getpass): mock_home.return_value = Path("/does/not/exist") # Fausse home → lecture échoue mock_getpass.return_value = "testpassword" user = "robot" text = "This is a message2" url = "http://localhost:8080/demo" elog = Elog("http://localhost:8080/demo", user=user) try: > elog.post(text) tests/test_utils_elog.py:59: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ slic/utils/elog.py:17: in post return self._log.post(*args, **kwargs) slic/utils/logbook.py:273: in post resp_message, resp_headers, resp_msg_id = _validate_response(response) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ response = <Response [200]> def _validate_response(response): """ Validate response of the request.""" msg_id = None if response.status_code not in [200, 302]: # 200 --> OK; 302 --> Found # Html page is returned with error description (handling errors same way as on original client. Looks # like there is no other way. err = re.findall('<td.*?class="errormsg".*?>.*?</td>', response.content.decode('utf-8', 'ignore'), flags=re.DOTALL) if len(err) > 0: # Remove html tags # If part of the message has: Please go back... remove this part since it is an instruction for # the user when using browser. err = re.sub('(?:<.*?>)', '', err[0]) if err: raise LogbookMessageRejected('Rejected because of: ' + err) else: raise LogbookMessageRejected('Rejected because of unknown error.') # Other unknown errors raise LogbookMessageRejected('Rejected because of unknown error.') else: location = response.headers.get('Location') if location is not None: if 'has moved' in location: raise LogbookServerProblem('Logbook server has moved to another location.') elif 'fail' in location: raise LogbookAuthenticationError('Invalid username or password.') else: # returned locations is something like: '<host>/<sub_dir>/<logbook>/<msg_id><query> # with urllib.parse.urlparse returns attribute path=<sub_dir>/<logbook>/<msg_id> try: msg_id = int(urllib.parse.urlsplit(location).path.split('/')[-1]) except ValueError as e: # it was not possible to get the msg_id. # this may happen when deleting the last entry of a logbook msg_id = None if b'type=password' in response.content or b'type="password"' in response.content: # Not too smart to check this way, but no other indication of this kind of error. # C client does it the same way > raise LogbookAuthenticationError('Invalid username or password.') E slic.utils.logbook_exceptions.LogbookAuthenticationError: Invalid username or password. slic/utils/logbook.py:838: LogbookAuthenticationError During handling of the above exception, another exception occurred: mock_home = <MagicMock name='home' id='140304201313008'> mock_getpass = <MagicMock name='getpass' id='140304195612736'> @patch("slic.utils.elog.getpass") @patch("slic.utils.elog.Path.home") def test_get_default_elog_instance_asks_password_and_opens(mock_home, mock_getpass): mock_home.return_value = Path("/does/not/exist") # Fausse home → lecture échoue mock_getpass.return_value = "testpassword" user = "robot" text = "This is a message2" url = "http://localhost:8080/demo" elog = Elog("http://localhost:8080/demo", user=user) try: elog.post(text) except Exception as e: > pytest.fail(f"elog.open() raised an unexpected exception: {e}") E Failed: elog.open() raised an unexpected exception: Invalid username or password. tests/test_utils_elog.py:61: Failed📌 Teardown phase
duration:
0.00021110475063323975outcome:
passed
↳ Function: test_get_default_elog_with_path_home
-
❌ Test 4
📌 Setup phase
duration:
0.00013434793800115585outcome:
passed📌 Call phase
duration:
0.013198011089116335outcome:
failedcrash:
path: /workspace/tligui_y/slic/tests/test_utils_elog.py lineno: 95 message: Failed: elog.open() raised an unexpected exception: Invalid username or password.traceback:
- path: tests/test_utils_elog.py lineno: 95 message: Failedlongrepr:
mock_home = <MagicMock name='home' id='140304193191504'> mock_getuser = <MagicMock name='getuser' id='140304193278640'> mock_getpass = <MagicMock name='getpass' id='140304193162304'> @patch("slic.utils.elog.getpass") @patch("slic.utils.elog.getuser") @patch("slic.utils.elog.Path.home") def test_get_default_elog_with_path_home(mock_home, mock_getuser, mock_getpass): fake_user = "robot" fake_pw = "testpassword" mock_getuser.return_value = fake_user mock_getpass.return_value = fake_pw # fallback safety text = "This is a message3" url = "http://localhost:8080/demo" tmp_home = Path("/tmp/fake_home_for_robot") tmp_home.mkdir(parents=True, exist_ok=True) pw_file = tmp_home / ".elog_psi" pw_file.write_text(fake_pw) mock_home.return_value = tmp_home try: elog = Elog("http://localhost:8080/demo") try: > elog.post(text) tests/test_utils_elog.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ slic/utils/elog.py:17: in post return self._log.post(*args, **kwargs) slic/utils/logbook.py:273: in post resp_message, resp_headers, resp_msg_id = _validate_response(response) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ response = <Response [200]> def _validate_response(response): """ Validate response of the request.""" msg_id = None if response.status_code not in [200, 302]: # 200 --> OK; 302 --> Found # Html page is returned with error description (handling errors same way as on original client. Looks # like there is no other way. err = re.findall('<td.*?class="errormsg".*?>.*?</td>', response.content.decode('utf-8', 'ignore'), flags=re.DOTALL) if len(err) > 0: # Remove html tags # If part of the message has: Please go back... remove this part since it is an instruction for # the user when using browser. err = re.sub('(?:<.*?>)', '', err[0]) if err: raise LogbookMessageRejected('Rejected because of: ' + err) else: raise LogbookMessageRejected('Rejected because of unknown error.') # Other unknown errors raise LogbookMessageRejected('Rejected because of unknown error.') else: location = response.headers.get('Location') if location is not None: if 'has moved' in location: raise LogbookServerProblem('Logbook server has moved to another location.') elif 'fail' in location: raise LogbookAuthenticationError('Invalid username or password.') else: # returned locations is something like: '<host>/<sub_dir>/<logbook>/<msg_id><query> # with urllib.parse.urlparse returns attribute path=<sub_dir>/<logbook>/<msg_id> try: msg_id = int(urllib.parse.urlsplit(location).path.split('/')[-1]) except ValueError as e: # it was not possible to get the msg_id. # this may happen when deleting the last entry of a logbook msg_id = None if b'type=password' in response.content or b'type="password"' in response.content: # Not too smart to check this way, but no other indication of this kind of error. # C client does it the same way > raise LogbookAuthenticationError('Invalid username or password.') E slic.utils.logbook_exceptions.LogbookAuthenticationError: Invalid username or password. slic/utils/logbook.py:838: LogbookAuthenticationError During handling of the above exception, another exception occurred: mock_home = <MagicMock name='home' id='140304193191504'> mock_getuser = <MagicMock name='getuser' id='140304193278640'> mock_getpass = <MagicMock name='getpass' id='140304193162304'> @patch("slic.utils.elog.getpass") @patch("slic.utils.elog.getuser") @patch("slic.utils.elog.Path.home") def test_get_default_elog_with_path_home(mock_home, mock_getuser, mock_getpass): fake_user = "robot" fake_pw = "testpassword" mock_getuser.return_value = fake_user mock_getpass.return_value = fake_pw # fallback safety text = "This is a message3" url = "http://localhost:8080/demo" tmp_home = Path("/tmp/fake_home_for_robot") tmp_home.mkdir(parents=True, exist_ok=True) pw_file = tmp_home / ".elog_psi" pw_file.write_text(fake_pw) mock_home.return_value = tmp_home try: elog = Elog("http://localhost:8080/demo") try: elog.post(text) except Exception as e: > pytest.fail(f"elog.open() raised an unexpected exception: {e}") E Failed: elog.open() raised an unexpected exception: Invalid username or password. tests/test_utils_elog.py:95: Failed📌 Teardown phase
duration:
0.0002265828661620617outcome:
passed
↳ Function: test_screenshot
-
❌ Test 5
📌 Setup phase
duration:
0.00014498038217425346outcome:
passed📌 Call phase
duration:
0.008210990112274885outcome:
failedcrash:
path: /workspace/tligui_y/slic/slic/utils/logbook.py lineno: 812 message: slic.utils.logbook_exceptions.LogbookMessageRejected: Rejected because of: Cannot write attachment file "/root/elog_instance/logbooks/demo/2025/250814_130140_fake_screenshot.png"traceback:
- path: tests/test_utils_elog.py lineno: 134 message: None - path: slic/utils/elog.py lineno: 22 message: in screenshot - path: slic/utils/elog.py lineno: 17 message: in post - path: slic/utils/logbook.py lineno: 273 message: in post - path: slic/utils/logbook.py lineno: 812 message: LogbookMessageRejectedlongrepr:
mock_screenshot_class = <MagicMock name='Screenshot' id='140304193398288'> @patch("slic.utils.elog.Screenshot") def test_screenshot(mock_screenshot_class): fake_path = "/tmp/fake_screenshot.png" with open(fake_path, "wb") as f: f.write(b"fake image data") mock_instance = mock_screenshot_class.return_value mock_instance.shoot.return_value = [fake_path] elog = elog = Elog("http://localhost:8080/demo", user="robot", password="testpassword") test_msg = "SCREENSHOT_INTEGRATION_TEST_MSG_456" > elog.screenshot(message=test_msg) tests/test_utils_elog.py:134: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ slic/utils/elog.py:22: in screenshot self.post(message, **kwargs) slic/utils/elog.py:17: in post return self._log.post(*args, **kwargs) slic/utils/logbook.py:273: in post resp_message, resp_headers, resp_msg_id = _validate_response(response) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ response = <Response [404]> def _validate_response(response): """ Validate response of the request.""" msg_id = None if response.status_code not in [200, 302]: # 200 --> OK; 302 --> Found # Html page is returned with error description (handling errors same way as on original client. Looks # like there is no other way. err = re.findall('<td.*?class="errormsg".*?>.*?</td>', response.content.decode('utf-8', 'ignore'), flags=re.DOTALL) if len(err) > 0: # Remove html tags # If part of the message has: Please go back... remove this part since it is an instruction for # the user when using browser. err = re.sub('(?:<.*?>)', '', err[0]) if err: > raise LogbookMessageRejected('Rejected because of: ' + err) E slic.utils.logbook_exceptions.LogbookMessageRejected: Rejected because of: Cannot write attachment file "/root/elog_instance/logbooks/demo/2025/250814_130140_fake_screenshot.png" slic/utils/logbook.py:812: LogbookMessageRejected📌 Teardown phase
duration:
0.0002348572015762329outcome:
passed
-
📚 Collected files
✅ (1 tests)
-
✅
- Outcome:
passed - result:
- nodeid: tests/test_utils_elog.py type: Module - Outcome:
✅ tests (1 tests)
-
✅ tests/test_utils_elog.py
- Outcome:
passed - result:
- nodeid: tests/test_utils_elog.py::test_get_default_elog_instance_with_direct_password_and_real_check type: Function lineno: 12 - nodeid: tests/test_utils_elog.py::test_get_default_elog_instance_with_wrong_password_and_real_check type: Function lineno: 37 - nodeid: tests/test_utils_elog.py::test_get_default_elog_instance_asks_password_and_opens type: Function lineno: 46 - nodeid: tests/test_utils_elog.py::test_get_default_elog_with_path_home type: Function lineno: 72 - nodeid: tests/test_utils_elog.py::test_screenshot type: Function lineno: 121 - Outcome:
⚠️ Warnings
Warnings nº1
message: invalid escape sequence \-
category: DeprecationWarning
when: collect
filename: /workspace/tligui_y/slic/.pixi/envs/default/lib/python3.8/site-packages/bsread/h5.py
lineno: 207
Warnings nº2
message: The module numpy.dual is deprecated. Instead of using dual, use the functions directly from numpy or scipy.
category: DeprecationWarning
when: collect
filename: /workspace/tligui_y/slic/.pixi/envs/default/lib/python3.8/site-packages/scipy/fft/__init__.py
lineno: 97