Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate p38 to i22 #862

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

migrate p38 to i22 #862

wants to merge 4 commits into from

Conversation

stan-dot
Copy link
Contributor

Fixes #502

Instructions to reviewer on how to test:

  1. BEAMLINE=p38 dodal connect i22
  2. expect all to connect

Checks for reviewer

  • Would the PR title make sense to a scientist on a set of release notes
  • If a new device has been added does it follow the standards
  • If changing the API for a pre-existing device, ensure that any beamlines using this device have updated their Bluesky plans accordingly
  • Have the connection tests for the relevant beamline(s) been run via dodal connect ${BEAMLINE}

@stan-dot stan-dot added enhancement New feature or request python Pull requests that update Python code low priority Not needed for production in the near future i22 labels Oct 24, 2024
@stan-dot stan-dot self-assigned this Oct 24, 2024
@stan-dot
Copy link
Contributor Author

@pytest.fixture(scope="function")
def module_and_devices_for_beamline(request):
    beamline = request.param
    with patch.dict(os.environ, {"BEAMLINE": beamline}, clear=True):
        bl_mod = importlib.import_module("dodal.beamlines." + beamline)
        importlib.reload(bl_mod)
        mock_beamline_module_filepaths(beamline, bl_mod)
        devices, _ = make_all_devices(
            bl_mod,
            include_skipped=True,
            fake_with_ophyd_sim=True,
        )
        yield (bl_mod, devices)
        beamline_utils.clear_devices()
        del bl_mod

the conftest is very opinionated and overriding it 'from the other file' seems impossible,

the quick and easy way to fix is it to use another conftest,

or add some param to the fixture to skip the os environ patch if it's a lab beamline

@DominicOram , @callumforrester please share your perspectives

@DominicOram
Copy link
Contributor

the conftest is very opinionated and overriding it 'from the other file' seems impossible,

Sorry, I'm not sure I understand. You can override the BEAMLINE env variable by passing in the beamline you want like in @pytest.mark.parametrize("module_and_devices_for_beamline", ["i22"], indirect=True). Or are you trying to override something else?

On a side-note I would be careful about merging this until we have fixed #864 as it could be masking errors.

@stan-dot stan-dot marked this pull request as ready for review October 28, 2024 11:11
@stan-dot
Copy link
Contributor Author

now probably this is just waiting for the connect and device_factory applied to the main branch again

#864

@stan-dot
Copy link
Contributor Author

waiting for #921

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request i22 low priority Not needed for production in the near future python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically keep I22 and P38 in sync
3 participants