Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Rework the Globals Paths and their use in tests #219

Merged
merged 3 commits into from
May 15, 2024

Conversation

gilesknap
Copy link
Member

Created a new pytest fixture epics_root which creates a new partly populated epics folder in tmp and patches globals to point at it.

This way most tests just need to reference that fixture and all is much tidier. honest.

@gilesknap
Copy link
Member Author

@GDYendell this PR is on top of the monster you have been reviewing for me.

I have made the Globals and the test fixtures neater I think.

If you have time perhaps you could see what you think. But essentially I think we are ready to merge the whole thing.

Thanks for you very useful input on this.

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.

The tests don't pass for me:

ERROR tests/test_cli.py::test_build_runtime_motorSim - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_build_runtime_motorSim0/epics/runtime'
ERROR tests/test_cli.py::test_build_utils_features - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_build_utils_features0/epics/runtime'
ERROR tests/test_cli.py::test_ipac - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_ipac0/epics/runtime'
ERROR tests/test_cli.py::test_gauges - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_gauges0/epics/runtime'
ERROR tests/test_cli.py::test_quadem - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_quadem0/epics/runtime'
ERROR tests/test_error.py::test_counter_reuse - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_counter_reuse0/epics/runtime'
ERROR tests/test_error.py::test_counter_overuse - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_counter_overuse0/epics/runtime'
ERROR tests/test_error.py::test_bad_db - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_bad_db0/epics/runtime'
ERROR tests/test_support.py::test_check_dependencies - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_check_dependencies0/epics/runtime'

src/ibek/ioc_cmds/commands.py Show resolved Hide resolved
src/ibek/globals.py Outdated Show resolved Hide resolved
src/ibek/globals.py Outdated Show resolved Hide resolved
src/ibek/globals.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
tests/conftest.py Show resolved Hide resolved
@GDYendell
Copy link
Member

I think we want really clear docstrings for the globals. Possibly we could pull some of the definitions from the EPICS docs so that we are using terms that other sites will recognise?

@gilesknap
Copy link
Member Author

The tests don't pass for me:

ERROR tests/test_cli.py::test_build_runtime_motorSim - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_build_runtime_motorSim0/epics/runtime'
ERROR tests/test_cli.py::test_build_utils_features - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_build_utils_features0/epics/runtime'
ERROR tests/test_cli.py::test_ipac - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_ipac0/epics/runtime'
ERROR tests/test_cli.py::test_gauges - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_gauges0/epics/runtime'
ERROR tests/test_cli.py::test_quadem - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_quadem0/epics/runtime'
ERROR tests/test_error.py::test_counter_reuse - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_counter_reuse0/epics/runtime'
ERROR tests/test_error.py::test_counter_overuse - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_counter_overuse0/epics/runtime'
ERROR tests/test_error.py::test_bad_db - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_bad_db0/epics/runtime'
ERROR tests/test_support.py::test_check_dependencies - FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-mef65357/pytest-3/test_check_dependencies0/epics/runtime'

Holy bat droppings! I'm seeing the same issue. It passed for me yesterday and it passed in CI.

Oh well --- investigating.

@gilesknap gilesknap merged commit 2d841f7 into add-collection-tests2 May 15, 2024
12 checks passed
@gilesknap gilesknap deleted the globals branch June 18, 2024 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants