DiamondLightSource / DiamondLightSource/blueapi

Create CI pipelines for offline testing of BlueAPI configuration

Open
#1,206 6 comments 0 reactions 0 assignees View on GitHub
ci decision pending tests
Dominant language
Python
Stars
13
Forks
13
Avg merge
2d 11h
Merged PRs (30d)
25

Description

As a developer in a support team I would like to be able to test that the following all work together to produce the expected outcome:
* My BlueAPI config
* My dodal devices
* My plans

e.g I have the following:

Inside `values.yaml`:
```python
env:
sources:
- kind: dodal
module: dodal.beamlines.i04
- kind: planFunctions
module: mx_bluesky.beamlines.i04
```

Inside `dodal.beamlines.i04`:

```python
@device_factory()
def device_a():
...

@device_factory()
def device_b():
...
```

Inside `mx_bluesky.beamlines.i04`:

```python
def my_plan(device_a = inject("device_a"), device_b = inject("device_b")) -> MsgGenerator
....

def my_bad_plan(device_a = inject("my_bad_device")) -> MsgGenerator
....

```

I would then like to run the following tests in CI:

```python
def test_blueapi_picks_up_my_plan():
assert "my_plan" in blueapi_context.plans

def test_blueapi_can_inject_all devices_into_all_plans():
# TBD what this looks like exactly but it should iterate through all plans
# known to blueAPI and make sure the devices requested can be found
# in the dodal module. i.e. `my_bad_plan` above will fail this
```

# Notes
* This probably needs to be done in a separate repo to dodal/plan repo/blueAPI but it makes sense to add the issue here as BlueAPI is what ties it all together.

## Acceptance Criteria
- There is a CI job that does this for an example set of repos
- There is some documentation on how to add the same for the support team's repo

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.