Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/_system_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
workflow_call:

env:
# https://github.com/pytest-dev/pytest/issues/2042
PY_IGNORE_IMPORTMISMATCH: "1"

jobs:
run:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 1
# Check out example services
submodules: true

- name: Set up Docker Compose
uses: docker/setup-compose-action@v2

- name: Compose service up
run: docker compose --profile test -f tests/system_tests/compose.yaml up -d

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Run tests
run: uv run --locked tox -e tests
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ name: CI

on:
push:
branches:
- main
tags:
- "*"
pull_request:

jobs:
Expand Down Expand Up @@ -58,3 +54,6 @@ jobs:
uses: ./.github/workflows/_release.yml
permissions:
contents: write

system-test:
uses: ./.github/workflows/_system_test.yml
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tests/system_tests/dev-environment"]
path = tests/system_tests/dev-environment
url = https://github.com/zohebshaikh/dev-environment
55 changes: 47 additions & 8 deletions tests/system_tests/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,49 @@
include:
- ./dev-environment/daq-services/compose.yaml

services:
rabbitmq:
image: docker.io/rabbitmq:4.0-management
ports:
- "1883:1883"
- "5672:5672"
- "15672:15672"
- "61613:61613"
blueapi:
image: ghcr.io/diamondlightsource/blueapi:1.18.0
network_mode: host # 8000
volumes:
- ./services/rabbitmq_plugins:/etc/rabbitmq/enabled_plugins:ro,Z
- ./services/blueapi:/blueapi
entrypoint: "sh /blueapi/start.sh"
depends_on:
keycloak:
condition: service_healthy
security_opt:
- label=disable
# Might be not required
# don't know if daq-queing-service make a call to blueapi at startup
# healthcheck:
# test: curl https://localhost/healthz
# interval: 10s
# timeout: 5s
# retries: 5
# start_period: 10s
profiles:
- test

daq-queuing-service:
build:
context: ../../
dockerfile: Dockerfile
volumes:
- ./services/daq_queuing_service.yaml:/etc/config/config.yaml
security_opt:
- label=disable
profiles:
- test
nexus:
image: gitlab.diamond.ac.uk:5050/daq/d2acq/services/nexus-file-converter:4.1.6
environment:
- BEAMLINE=i15-1
security_opt:
- label=disable
profiles:
- diamond

# A container with just puts bundler data for OPA
# and creates any keycloak clients that are required

#configure_beamline:
1 change: 1 addition & 0 deletions tests/system_tests/dev-environment
Submodule dev-environment added at bfe85a
52 changes: 52 additions & 0 deletions tests/system_tests/services/blueapi/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
api:
url: https://localhost:8000
env:
metadata:
instrument: i15-1
sources:
- kind: deviceManager
module: dodal.beamlines.i15_1
mock: True
- kind: planFunctions
module: dodal.plans
- kind: planFunctions
module: dodal.plan_stubs
- kind: planFunctions
module: crystallography_bluesky.i15_1.plans
- kind: planFunctions
module: crystallography_bluesky.common.plans
events:
broadcast_status_events: false

stomp:
auth:
username: guest
password: guest
url: tcp://localhost:61613/
enabled: true

numtracker:
url: http://localhost:8406/graphql

tiled:
enabled: true
url: "http://localhost:8407/api/v1"
authentication:
client_id: "tiled-writer"
client_secret: "secret"

oidc:
issuer: "http://localhost:8081/realms/master"
client_id: "ixx-cli-blueapi"
client_audience: "ixx-blueapi"
logout_redirect_endpoint: "oauth2/sign_out"

scratch:
repositories:
- name: dodal
remote_url: https://github.com/DiamondLightSource/dodal.git
- name: ophyd-async
remote_url: https://github.com/bluesky/ophyd-async.git
- name: crystallography-bluesky
remote_url: https://github.com/DiamondLightSource/crystallography-bluesky.git
target_revision: main
4 changes: 4 additions & 0 deletions tests/system_tests/services/blueapi/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
mkdir -p /tmp/scratch/blueapi
blueapi -c /blueapi/config.yaml setup-scratch
blueapi -c /blueapi/config.yaml serve
17 changes: 17 additions & 0 deletions tests/system_tests/services/daq_queuing_service_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
config:
converter:
path: "daq_queuing_service.plugins.i15_1_converter"
name: "I151Converter"
blueapi:
api:
url: "http://localhost:8000"
stomp:
enabled: true
url: tcp://localhost:61613
auth:
username: guest
password: guest
udcSecret:
enabled: true
udc-secret: "secret"
clientId: "i15-1udc"
1 change: 0 additions & 1 deletion tests/system_tests/services/rabbitmq_plugins

This file was deleted.

2 changes: 2 additions & 0 deletions tests/system_tests/test_system.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_one():
assert 1 + 1 == 2
Loading