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

Feature: Add functionality to /simulation/:id path #470

Merged
merged 14 commits into from
May 18, 2023

Conversation

antonykamp
Copy link
Collaborator

Fixes #

This PR adds the functionality to get, update, and remove a simulation configuration with the REST API.

While writing tests, I recognized a mistake in the simulation configuration fixtures. The result is that no fixtures were connected to the configurations, like spawner or fault configurations.
I tried to fix it but ran into a big problem with celery. We cannot pass mocks to the celery worker. I tried to use the fixtures of the worker and app provided by Celery, but they don't work properly. After a week of trying to fix it, I decided to skip every test connected to celery and create a new issue (see #469) .

PR checklist

  • Acceptance criteria fulfilled
  • Additional features are tested
  • Dev-branch has been merged into local branch to resolve conflicts
  • Tests and linter have passed AFTER local merge
  • Another dev reviewed and approved

Introduce UpdateSimulationConfiguration schema because spawner isn't required when updating the simulation configuration.
Extract utility functions for creating simulations to reuse it for updating simulations
Initialize simulation configuration correctly by creating reference objects
Add duplicates of configuration objects to use them in update operation
We have to use the original celery worker, becuase the fixtures of celery aren't working properly.
We can't mock the next_tick functions of the components, because they aren't forwarded to the celery worker.
That's the reason why I had to skip tests connected to celery as long as we figure out why the celery fixtures aren't working properly.
@antonykamp antonykamp self-assigned this May 16, 2023
@antonykamp antonykamp linked an issue May 16, 2023 that may be closed by this pull request
5 tasks
@antonykamp antonykamp marked this pull request as ready for review May 16, 2023 13:30
Copy link
Collaborator

@instant-sky instant-sky 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 from what I can tell. Just two small questions below :)

tests/communicator/test_communicator.py Show resolved Hide resolved
tests/implementor/conftest.py Outdated Show resolved Hide resolved
@antonykamp antonykamp requested a review from instant-sky May 18, 2023 08:18
Copy link
Collaborator

@instant-sky instant-sky left a comment

Choose a reason for hiding this comment

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

Thank you, looks good now! 🦃

@antonykamp antonykamp merged commit 335b505 into dev May 18, 2023
@antonykamp antonykamp deleted the feature/213-add-functionality-to-simulationid-path branch May 18, 2023 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add functionality to /simulation/{id} path
2 participants