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

Add integration tests #153

Merged
merged 14 commits into from
Jul 21, 2023
Merged

Add integration tests #153

merged 14 commits into from
Jul 21, 2023

Conversation

rosesyrett
Copy link
Contributor

@rosesyrett rosesyrett commented Jul 11, 2023

Check the master and slave scheduler in context with other components, with minimal mocking and test configurations.

Two test cases are set up; one for a regular simulation with a master scheduler, sink and source. Another for a simulation with a system simulation component. A fixture sets up the simulation and yields it before the tests, tearing it down afterwards by throwing an exception and device interrupt.

@rosesyrett
Copy link
Contributor Author

waiting on #160 to be closed; this is the last remaining failure.

In future I'd prefer it if I didn't have to schedule an interrupt for this to work. But this will be solved by #152 anyways, as then I could just stop the scheduler.

Base automatically changed from 76_running_event to master July 17, 2023 14:17
rosesyrett added a commit that referenced this pull request Jul 18, 2023
#160)

Remove asyncio.wait deprecation warning by only passing tasks to it.

In the master scheduler _do_task method, a coroutine is passed to
asyncio.wait. This is deprecated behaviour. I noticed this while working
on #153:

```
File "/workspace/tickit/src/tickit/core/management/schedulers/master.py", line 102, in _do_tick
    which, _ = await asyncio.wait(
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 377, in wait
    warnings.warn("The explicit passing of coroutine objects to "
DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
```
@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Merging #153 (c9f069a) into master (6066902) will increase coverage by 0.61%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #153      +/-   ##
==========================================
+ Coverage   94.50%   95.12%   +0.61%     
==========================================
  Files          44       44              
  Lines        1292     1292              
==========================================
+ Hits         1221     1229       +8     
+ Misses         71       63       -8     

see 1 file with indirect coverage changes

Copy link
Collaborator

@abbiemery abbiemery left a comment

Choose a reason for hiding this comment

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

Looks good, thank you for doing this. Please can you rename the tests to system tests rather than integration tests. But other than that, only a few questions really :)

tests/integration_tests/configs/nested.yaml Outdated Show resolved Hide resolved
tests/integration_tests/configs/test_with_master.yaml Outdated Show resolved Hide resolved
tests/integration_tests/test_with_master.py Outdated Show resolved Hide resolved
tests/integration_tests/test_with_master_and_slave.py Outdated Show resolved Hide resolved
tests/integration_tests/test_with_master_and_slave.py Outdated Show resolved Hide resolved
.vscode/launch.json Outdated Show resolved Hide resolved
rosesyrett and others added 5 commits July 21, 2023 10:29
This change introduces simple type aliases to improve readability for distinguishing between component input and output types.
This change shifts the simulation builder logic from the cli to a dedicated class, TickitSimulation. It adds a builder function to allow simulations to be constructed in a declarative fashion, allowing for further customisation in the future and better testing now. It is a step towards the larger changes required for simulating zebra devices and uniting master and nested simulation logic.
- No longer required for supported versions of python
Copy link
Collaborator

@abbiemery abbiemery left a comment

Choose a reason for hiding this comment

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

LGTM.

@rosesyrett rosesyrett merged commit aef4042 into master Jul 21, 2023
16 checks passed
@abbiemery abbiemery deleted the add_integration_tests branch July 21, 2023 11:32
@abbiemery abbiemery mentioned this pull request Jul 25, 2023
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.

3 participants