DiamondLightSource / DiamondLightSource/mx-bluesky
deploy_mx_bluesky deployment script fails during unit tests
- Dominant language
- Python
- Stars
- 4
- Forks
- 5
- Avg merge
- 1d 30m
- Merged PRs (30d)
- 2
Description
`deploy_mx_bluesky.py` runs `dls_dev_env.sh` to deploy mx-bluesky onto the control server.
The last step of the script runs the tests with `pytest`, which fails with the below failures.
The failures are due to
* The BEAMLINE being set to an unexpected value
* Tests writing to `/dls_sw` because of the deployment location
```
FAILED tests/unit_tests/common/utils/test_log.py::test_get_logging_dir_uses_tmp_if_no_env_var[False] - AssertionError: assert (PosixPath('/dls_sw/i03/logs/bluesky'), PosixPath('/dls/tmp/i03/logs/bluesky')) == (PosixPath('/tmp/logs/bluesky'), PosixPath('/tmp/logs/bluesky'))
At index 0 diff: PosixPath('/dls_sw/i03/logs/bluesky') != PosixPath('/tmp/logs/bluesky')
Full diff:
(
+ PosixPath('/dls_sw/i03/logs/bluesky'),
- PosixPath('/tmp/logs/bluesky'),
+ PosixPath('/dls/tmp/i03/logs/bluesky'),
? ++++ ++++
- PosixPath('/tmp/logs/bluesky'),
)
FAILED tests/unit_tests/hyperion/experiment_plans/test_robot_load_then_centre.py::test_box_size_passed_through_to_gridscan - AssertionError: Attempt to open /dls_sw/i03/software/daq_configuration/json/OAVCentring_hyperion.json from inside a unit test
assert not True
+ where True = is_relative_to(PosixPath('/dls_sw'))
+ where is_relative_to = PosixPath('/dls_sw/i03/software/daq_configuration/json/OAVCentring_hyperion.json').is_relative_to
FAILED tests/unit_tests/hyperion/external_interaction/test_write_rotation_nexus.py::test_rotation_scan_nexus_output_compared_to_existing_full_compare - AssertionError: /entry/instrument/name actual and expected did not match b'DIAMOND BEAMLINE i03', b'DIAMOND BEAMLINE S03'.
assert np.bytes_(b'DIAMOND BEAMLINE i03') == b'DIAMOND BEAMLINE S03'
At index 17 diff: b'i' != b'S'
Full diff:
- (b'DIAMOND BEAMLINE S03')
? ^
+ np.bytes_(b'DIAMOND BEAMLINE i03')
? +++++++++ ^
FAILED tests/unit_tests/hyperion/test_main_system.py::test_context_created_with_dev_mode[False] - AssertionError: Attempt to open /dls_sw/i03/logs/bluesky/hyperion.log from inside a unit test
assert not True
+ where True = is_relative_to(PosixPath('/dls_sw'))
+ where is_relative_to = PosixPath('/dls_sw/i03/logs/bluesky/hyperion.log').is_relative_to
FAILED tests/unit_tests/hyperion/test_main_system.py::test_hyperion_in_udc_mode_starts_udc_loop - AssertionError: Attempt to open /dls_sw/i03/logs/bluesky/hyperion.log from inside a unit test
assert not True
+ where True = is_relative_to(PosixPath('/dls_sw'))
+ where is_relative_to = PosixPath('/dls_sw/i03/logs/bluesky/hyperion.log').is_relative_to
FAILED tests/unit_tests/hyperion/test_main_system.py::test_hyperion_in_gda_mode_doesnt_start_udc_loop - AssertionError: Attempt to open /dls_sw/i03/logs/bluesky/hyperion.log from inside a unit test
assert not True
+ where True = is_relative_to(PosixPath('/dls_sw'))
+ where is_relative_to = PosixPath('/dls_sw/i03/logs/bluesky/hyperion.log').is_relative_to
FAILED tests/unit_tests/hyperion/test_main_system.py::test_hyperion_exposes_run_endpoint_only_if_gda_mode_selected[gda] - AssertionError: Attempt to open /dls_sw/i03/logs/bluesky/hyperion.log from inside a unit test
assert not True
+ where True = is_relative_to(PosixPath('/dls_sw'))
+ where is_relative_to = PosixPath('/dls_sw/i03/logs/bluesky/hyperion.log').is_relative_to
FAILED tests/unit_tests/hyperion/test_main_system.py::test_hyperion_exposes_run_endpoint_only_if_gda_mode_selected[udc] - AssertionError: Attempt to open /dls_sw/i03/logs/bluesky/hyperion.log from inside a unit test
assert not True
+ where True = is_relative_to(PosixPath('/dls_sw'))
+ where is_relative_to = PosixPath('/dls_sw/i03/logs/bluesky/hyperion.log').is_relative_to
```
Contributor guide
Assessment
This issue has not been assessed yet.