Test suite and ruff#18
Merged
Merged
Conversation
Contributor
Author
|
@JeanLucPons, could you check this? Modifications to existing files are limited to ruff formatting. All other changes consist of new tests. |
Contributor
|
The tests need the BESSY VA ? |
Contributor
|
Would it be possible to add this tests after the refurbishment ? |
Contributor
Author
|
I actually intend to use them for the refurbishment. I've added a test for the BPMs you mentioned. It would have caught the issues you were referring to. |
Contributor
Author
A VA isn't necessary here. It follows the same logic as tango-pyaml, using mocking and fake interfaces for simulation. As you can see, it works fine on the GitHub runner. |
JeanLucPons
approved these changes
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a first real pytest suite for
pyaml-cs-oa, focused on fast mocked tests that do not require live EPICS/Tango infrastructure.This PR also converts the existing tune scripts into proper pytest integration tests, adds a GitHub Actions workflow for linting and testing, and aligns the local Ruff configuration with PyAML.
Closes #17
Changes
pyproject.toml, including:test = ["pytest"]optional dependency group.python_files = ["test_*.py"]so pytest does not collect non-standard script names unexpectedly.integrationandrequires_control_systemmarkers.line-length = 127.E741andB024, matching the PyAML configuration.OAReadbackandOASetpoint.get_SP_RB()factories.OASignalbuild and metadata behavior.OphydAsyncControlSystem.attach()prefixing and caching behavior.OAScalarAggregatorvalidation, get, set, and readback behavior.tests/test-tune.pyandtests/test-tune-bessy.pyinto standard pytest files:tests/test_tune.pytests/test_tune_bessy.pytests/live_tune_helpers.pyintegrationandrequires_control_system, skipped by default unlessPYAML_CS_OA_RUN_INTEGRATION=1is set..github/workflows/tests.ymlto install dependencies, run Ruff, and run pytest.Validation
Local default test run:
Commands used locally:
The 2 skipped tests are the live integration tests, which require control-system infrastructure.
Also checked:
git diff --checkNotes
pyaml_cs_oa/epics.py:.github/workflows/tests.ymlruns Ruff. Without aligning the configuration here, the GitHub workflow would fail independently of the test-suite changes.