feat: added pytest-bec-e2e plugin

This commit is contained in:
wakonig_k 2024-04-18 15:41:08 +02:00
parent 2e00112447
commit deaa2b022a
10 changed files with 48 additions and 6 deletions

View File

@ -41,6 +41,7 @@ stages:
- Deploy
.install-bec-services-dev: &install-bec-services-dev
- pip install -e ./pytest_bec_e2e
- pip install -e ./bec_server[dev]
- pip install -e ./bec_ipython_client[dev]
- pip install -e ./bec_lib[dev]
@ -297,6 +298,7 @@ end-2-end-conda:
- source ./bin/install_bec_dev.sh -t
- pip install ./pytest_bec_e2e
- cd ./bec_ipython_client
- pip install .[dev]
- pytest --start-servers -v ./tests/end-2-end/test_scans_e2e.py::test_grid_scan

View File

@ -34,14 +34,12 @@ dev = [
"pytest-timeout",
"pytest-redis",
"pytest-retry",
"pytest-bec-e2e",
]
[project.scripts]
bec = "bec_ipython_client.main:main"
[project.entry-points.pytest11]
bec_lib_end2end_fixtures = "bec_ipython_client.tests.end2end_fixtures"
[project.urls]
"Bug Tracker" = "https://gitlab.psi.ch/bec/bec/issues"
Homepage = "https://gitlab.psi.ch/bec/bec"

View File

@ -89,7 +89,7 @@ fi
# check if the conda environment has the correct dependencies. If not, install them.
conda activate ${conda_env_name}
dependencies=(bec_lib bec_ipython_client bec_server)
dependencies=(pytest_bec_e2e bec_lib bec_ipython_client bec_server)
# split virtual environment into separate environments for each package
if [ "$split_env" = true ]; then
for package in "${dependencies[@]}"

View File

@ -24,7 +24,11 @@ RUN git clone --branch ${OPHYD_BRANCH} https://gitlab.psi.ch/bec/ophyd_devices
WORKDIR /code/bec/ophyd_devices
RUN pip install -e .
WORKDIR /code/bec/
RUN pip install -e bec_server
RUN pip install -e pytest_bec_e2e
RUN pip install -e bec_server[dev]
RUN pip install -e bec_ipython_client[dev]
RUN pip install -e bec_lib[dev]
WORKDIR /code/bec/${BEC_SERVICE}
RUN pip install -e .[dev]

View File

@ -23,6 +23,8 @@ WORKDIR /code/bec
RUN git clone --branch ${OPHYD_BRANCH} https://gitlab.psi.ch/bec/ophyd_devices
WORKDIR /code/bec/ophyd_devices
RUN pip install -e .
WORKDIR /code/bec/pytest_bec_e2e
RUN pip install -e .
WORKDIR /code/bec/${BEC_SERVICE}
RUN pip install -e .[dev]

View File

@ -5,6 +5,7 @@ declare -a dirs=(
"bec_ipython_client"
"bec_lib"
"bec_server"
"pytest_bec_e2e"
)
mkdir dist

View File

@ -4,6 +4,7 @@ version_toml = [
"./bec_server/pyproject.toml:project.version",
"./bec_lib/pyproject.toml:project.version",
"./bec_ipython_client/pyproject.toml:project.version",
"./pytest_bec_e2e/pyproject.toml:project.version",
]
[tool.semantic_release.commit_author]

View File

@ -0,0 +1,35 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "pytest-bec-e2e"
version = "2.4.2"
description = "BEC pytest plugin for end-to-end tests"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
]
dependencies = [
"bec_lib",
"bec_ipython_client",
"bec_server",
"pytest",
"pytest_redis",
]
[project.entry-points.pytest11]
bec_end2end_fixtures = "pytest_bec_e2e.plugin"
[project.urls]
"Bug Tracker" = "https://gitlab.psi.ch/bec/bec/issues"
Homepage = "https://gitlab.psi.ch/bec/bec"
[tool.hatch.build.targets.wheel]
include = ["*"]
[tool.black]
line-length = 100
skip-magic-trailing-comma = true

View File

@ -6,7 +6,6 @@ import pathlib
import platform
import shutil
import tempfile
import warnings
import pytest
from pytest_redis import factories as pytest_redis_factories