Skip to content

Commit

Permalink
Bump everest-framework to 0.19.1 (#987)
Browse files Browse the repository at this point in the history
* Bump everest-framework to 0.19.1

This includes the config restructure where module configs are now only parsed once in the manager and then distributed to the modules via MQTT

* Change probe module usage of error framework tests to newer style

* rust: update everest-framework to 0.19.1
update Cargo.lock

---------

Signed-off-by: Kai-Uwe Hermann <[email protected]>
Co-authored-by: Piet Gömpel <[email protected]>
  • Loading branch information
hikinggrass and Pietfried authored Dec 10, 2024
1 parent 7771a02 commit 50d8bac
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 61 deletions.
2 changes: 1 addition & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
---
everest-framework:
git: https://github.com/EVerest/everest-framework.git
git_tag: v0.18.1
git_tag: v0.19.1
options: [
"BUILD_TESTING OFF",
"everest-framework_USE_PYTHON_VENV ${PROJECT_NAME}_USE_PYTHON_VENV",
Expand Down
57 changes: 28 additions & 29 deletions modules/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions modules/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ members = [
]

[workspace.dependencies]
everestrs = { git = "https://github.com/everest/everest-framework.git", tag = "v0.18.1" }
everestrs-build = { git = "https://github.com/everest/everest-framework.git", tag = "v0.18.1" }
everestrs = { git = "https://github.com/everest/everest-framework.git", tag = "v0.19.1" }
everestrs-build = { git = "https://github.com/everest/everest-framework.git", tag = "v0.19.1" }
6 changes: 6 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ def pytest_configure(config):
continue
pytest.everest_configs['params'].append(config_path)
pytest.everest_configs['ids'].append(config_id)

@pytest.fixture
def started_test_controller(test_controller):
test_controller.start()
yield test_controller
test_controller.stop()
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,3 @@ active_modules:
error_raiser:
- module_id: probe
implementation_id: main
probe:
module: ProbeModule
connections:
test_error_handling:
- module_id: test_error_handling
implementation_id: main
test_error_handling_not_req:
- module_id: test_error_handling_not_req
implementation_id: main
34 changes: 14 additions & 20 deletions tests/framework_tests/cpp_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import asyncio

from everest.framework import error
from everest.testing.core_utils.common import Requirement
from everest.testing.core_utils.fixtures import *
from everest.testing.core_utils.everest_core import EverestCore
from everest.testing.core_utils.probe_module import ProbeModule
Expand Down Expand Up @@ -436,12 +437,23 @@ def get_state(self) -> ErrorHandlingTesterState:
len_test_error_handling_errors_cleared_global_all=len(self.test_error_handling['errors_cleared_global_all']),
)
return state

@pytest.mark.probe_module(
connections={
"test_error_handling": [
Requirement(module_id="test_error_handling", implementation_id="main")
],
"test_error_handling_not_req": [
Requirement(module_id="test_error_handling_not_req", implementation_id="main")
]
}
)
class TestErrorHandling:
"""
Tests for error handling
"""
@pytest.fixture
def probe_module(self, everest_core: EverestCore):
def probe_module(self, started_test_controller, everest_core):
return ProbeModule(everest_core.get_runtime_session())

@pytest.fixture
Expand All @@ -455,15 +467,13 @@ def error_handling_tester(self, probe_module: ProbeModule):
@pytest.mark.asyncio
async def test_raise_error(
self,
everest_core: EverestCore,
error_handling_tester: ErrorHandlingTester
error_handling_tester: ErrorHandlingTester,
):
"""
Tests that errors are raised correctly.
The probe module triggers the TestErrorHandling module to raise an error,
and then checks that the error is raised by subscribing to it.
"""
everest_core.start(standalone_module='probe')
err_args = await error_handling_tester.test_error_handling_raise_error_a()
await asyncio.sleep(0.5)
expected_state = ErrorHandlingTesterState(
Expand All @@ -481,7 +491,6 @@ async def test_raise_error(
@pytest.mark.asyncio
async def test_clear_errors_by_type(
self,
everest_core: EverestCore,
error_handling_tester: ErrorHandlingTester
):
"""
Expand All @@ -491,7 +500,6 @@ async def test_clear_errors_by_type(
and then checks that the correct errors are cleared.
"""

everest_core.start(standalone_module='probe')
await error_handling_tester.test_error_handling_raise_error_a()
await error_handling_tester.test_error_handling_raise_error_b()
await error_handling_tester.test_error_handling_raise_error_c()
Expand Down Expand Up @@ -521,7 +529,6 @@ async def test_clear_errors_by_type(
@pytest.mark.asyncio
async def test_clear_all_errors(
self,
everest_core: EverestCore,
error_handling_tester: ErrorHandlingTester
):
"""
Expand All @@ -531,7 +538,6 @@ async def test_clear_all_errors(
and then checks that all errors are cleared.
"""

everest_core.start(standalone_module='probe')
await error_handling_tester.test_error_handling_raise_error_a()
await error_handling_tester.test_error_handling_raise_error_b()
await error_handling_tester.test_error_handling_raise_error_c()
Expand Down Expand Up @@ -570,7 +576,6 @@ async def test_clear_all_errors(
@pytest.mark.asyncio
async def test_receive_req_error(
self,
everest_core: EverestCore,
error_handling_tester: ErrorHandlingTester
):
"""
Expand All @@ -579,7 +584,6 @@ async def test_receive_req_error(
Checks that the error is subscribed correctly.
"""

everest_core.start(standalone_module='probe')
err_object = error_handling_tester.probe_module_main_raise_error_a()
await asyncio.sleep(0.5)
expected_state = ErrorHandlingTesterState(
Expand All @@ -599,7 +603,6 @@ async def test_receive_req_error(
@pytest.mark.asyncio
async def test_receive_req_error_cleared(
self,
everest_core: EverestCore,
error_handling_tester: ErrorHandlingTester
):
"""
Expand All @@ -609,7 +612,6 @@ async def test_receive_req_error_cleared(
Checks that the error_cleared is subscribed correctly.
"""

everest_core.start(standalone_module='probe')
err_object = error_handling_tester.probe_module_main_raise_error_a()
await asyncio.sleep(0.5)
error_handling_tester.probe_module_main_clear_error(err_object.type, err_object.sub_type)
Expand All @@ -633,7 +635,6 @@ async def test_receive_req_error_cleared(
@pytest.mark.asyncio
async def test_receive_req_not_sub_error(
self,
everest_core: EverestCore,
error_handling_tester: ErrorHandlingTester
):
"""
Expand All @@ -642,7 +643,6 @@ async def test_receive_req_not_sub_error(
Checks that the error is subscribed correctly.
"""

everest_core.start(standalone_module='probe')
err_object = error_handling_tester.probe_module_main_raise_error_c()
await asyncio.sleep(0.5)
expected_state = ErrorHandlingTesterState(
Expand All @@ -660,7 +660,6 @@ async def test_receive_req_not_sub_error(
@pytest.mark.asyncio
async def test_receive_req_not_sub_error_cleared(
self,
everest_core: EverestCore,
error_handling_tester: ErrorHandlingTester
):
"""
Expand All @@ -670,7 +669,6 @@ async def test_receive_req_not_sub_error_cleared(
Checks that the error_cleared is subscribed correctly.
"""

everest_core.start(standalone_module='probe')
err_object = error_handling_tester.probe_module_main_raise_error_c()
await asyncio.sleep(0.5)
error_handling_tester.probe_module_main_clear_error(err_object.type, err_object.sub_type)
Expand All @@ -692,7 +690,6 @@ async def test_receive_req_not_sub_error_cleared(
@pytest.mark.asyncio
async def test_receive_not_req_error(
self,
everest_core: EverestCore,
error_handling_tester: ErrorHandlingTester
):
"""
Expand All @@ -702,7 +699,6 @@ async def test_receive_not_req_error(
Checks that the error is subscribed correctly.
"""

everest_core.start(standalone_module='probe')
err_arg = await error_handling_tester.test_error_handling_not_req_raise_error_a()
await asyncio.sleep(0.5)
expected_state = ErrorHandlingTesterState(
Expand All @@ -718,7 +714,6 @@ async def test_receive_not_req_error(
@pytest.mark.asyncio
async def test_receive_not_req_error_cleared(
self,
everest_core: EverestCore,
error_handling_tester: ErrorHandlingTester
):
"""
Expand All @@ -730,7 +725,6 @@ async def test_receive_not_req_error_cleared(
Checks that the error is subscribed correctly.
"""

everest_core.start(standalone_module='probe')
err_arg = await error_handling_tester.test_error_handling_not_req_raise_error_a()
await asyncio.sleep(0.5)
await error_handling_tester.test_error_handling_not_req_clear_error(err_arg['type'], err_arg['sub_type'])
Expand Down

0 comments on commit 50d8bac

Please sign in to comment.