Skip to content
New issue

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

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

Already on GitHub? # to your account

Realistic examples in system tests #152

Merged
merged 4 commits into from
Dec 15, 2023
Merged

Realistic examples in system tests #152

merged 4 commits into from
Dec 15, 2023

Conversation

gilesknap
Copy link
Member

No description provided.

dependabot bot and others added 3 commits December 7, 2023 07:34
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.5.0 to 2.5.1.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](pydantic/pydantic@v2.5.0...v2.5.1)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@gilesknap gilesknap requested a review from GDYendell December 7, 2023 16:18
@gilesknap
Copy link
Member Author

@GDYendell you might be interested in this as it hopefully fixes an issue you raised with the ibek system tests.
But don't spend lots of time on it - the tests pass and the coverage is good (still need to add tests for the the subcommands that call shell - thats next).

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3818519) 70.62% compared to head (858582d) 70.51%.
Report is 7 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #152      +/-   ##
==========================================
- Coverage   70.62%   70.51%   -0.11%     
==========================================
  Files          17       17              
  Lines         926      926              
==========================================
- Hits          654      653       -1     
- Misses        272      273       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gilesknap
Copy link
Member Author

@coretl you might be interested to know I have added checks for jinja escaping. Does this cover what you asked me about recently?

- type: motorSim.simMotorAxis
controller: controllerOne
M: M{{ADDR}}
ADDR: 1
# verify escaping for jinja templating
DESC: "Motor {{ADDR}} {% raw %} {{enclosed in escaped curly braces}} {% endraw %}"
home: 500

pre_init:
- value: |
# Setting up Asyn Port {{name}} on {{port}}:
- when: first
# test escaping of jinja directives and use of 'first' to only print this line once
value: |
# {% raw %}AsynIPConfigure({{name}}, {{port}}, {{stop}}, {{parity}}, {{bits}}) {% endraw %}
- value: |
AsynIPConfigure({{name}}, {{port}}, {{stop}}, {{parity}}, {{bits}})
asynSetOption({{baud}}, 0, {{crtscts}}, {{disconnectOnReadTimeout}})
asynOctetSetInputEos({{input_eos}})
asynOctetSetOutputEos({{output_eos}})

- type: str
name: DESC
description: |-
The description of the controller
default: "Simulated Motion Controller testing escaping: {% raw %} {{enclosed in escaped curly braces}} {% endraw %}"
pre_init:
- value: |
# motorSimCreateController(controller_asyn_port_name, axis_count)
# testing escaping: {% raw %} {{enclosed in escaped curly braces}} {% endraw %}
motorSimCreateController({{controllerName}}, {{numAxes}})

See the expected results in https://github.com/epics-containers/ibek/tree/dev/tests/samples/outputs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also be turned into a realistic example if you choose an appropriate PV to describe in the yaml

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Will add that

Copy link
Member

@GDYendell GDYendell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Just one comment.

@gilesknap gilesknap merged commit 843d083 into main Dec 15, 2023
@gilesknap gilesknap deleted the dev branch December 15, 2023 14:28
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants