Skip to content

Commit a178884

Browse files
a-w50hikinggrass
andauthored
* Adapt to EVerest/everest-utils#76 Signed-off-by: aw <aw@pionix.de> * Require everest-framework 0.6.2 Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de> * Add convenience target for integration tests Add everest-utils to dependencies.yaml to be able to use it for testing Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de> * Bump josev dependency Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de> --------- Signed-off-by: aw <aw@pionix.de> Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de> Co-authored-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
1 parent fbf976b commit a178884

File tree

8 files changed

+37
-37
lines changed

8 files changed

+37
-37
lines changed

CMakeLists.txt

+14
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,17 @@ if(BUILD_TESTING)
126126
else()
127127
message("Not running unit tests")
128128
endif()
129+
130+
# convenience target for integration tests
131+
add_custom_target(install_everest_testing
132+
COMMAND
133+
if [ -z "${CPM_PACKAGE_everest-utils_SOURCE_DIR}" ] \;
134+
then echo "Could not determine location of everest-utils, please install everest-testing manually!" \;
135+
else echo "Found everest-utils at ${CPM_PACKAGE_everest-utils_SOURCE_DIR}" \;
136+
${PYTHON_EXECUTABLE} -m pip install "${CPM_PACKAGE_everest-utils_SOURCE_DIR}/everest-testing" \;
137+
fi\;
138+
DEPENDS
139+
everestpy_pip_install_dist iso15118_pip_install_dist iso15118_requirements_pip_install_dist
140+
COMMENT
141+
"Installing dependencies for testing EVerest"
142+
)

dependencies.yaml

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
everest-framework:
33
git: https://github.com/EVerest/everest-framework.git
4-
git_tag: v0.6.1
4+
git_tag: v0.6.2
55
sigslot:
66
git: https://github.com/palacaze/sigslot
77
git_tag: v1.2.0
@@ -42,7 +42,7 @@ libocpp:
4242
# Josev
4343
Josev:
4444
git: https://github.com/EVerest/ext-switchev-iso15118.git
45-
git_tag: 43828f6
45+
git_tag: 646ceca
4646
# OpenV2G
4747
ext-openv2g:
4848
git: https://github.com/EVerest/ext-openv2g.git
@@ -52,3 +52,8 @@ ext-mbedtls:
5252
git: https://github.com/EVerest/ext-mbedtls.git
5353
git_tag: 8b3f26a
5454
options: ["ENABLE_PROGRAMS OFF", "ENABLE_TESTING OFF"]
55+
56+
# everest-testing
57+
everest-utils:
58+
git: https://github.com/EVerest/everest-utils.git
59+
git_tag: v0.1.4

modules/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ ev_add_module(PersistentStore)
2222
ev_add_module(PN532TokenProvider)
2323
ev_add_module(PyEvJosev)
2424
ev_add_module(PyJosev)
25-
ev_add_module(PyProbeModule)
2625
ev_add_module(Setup)
2726
ev_add_module(SerialCommHub)
2827
ev_add_module(Store)

modules/PyProbeModule/CMakeLists.txt

Whitespace-only changes.

modules/PyProbeModule/manifest.yaml

-28
This file was deleted.

modules/PyProbeModule/module.py

-1
This file was deleted.

tests/README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ cd ~/checkout/everest-workspace/everest-utils/everest-testing
1111
python3 -m pip install .
1212
```
1313

14+
You can also use the following cmake target to install everest-testing and its dependencies:
15+
```bash
16+
cd everest-core
17+
cmake --build build --target install_everest_testing
18+
```
19+
1420
## Execute locally
1521

1622
To start you should try executing the available basic tests:
@@ -83,4 +89,4 @@ For the moment, there is a *workaround available:* Use a new test-set (another p
8389

8490
**Cause:** Currently there is a bug in the EVSE manager implementation in everest-core, causing a race-condition between resetting the "amount charged" parameter and the event reporting for a "*transaction_finished*" event. Sometimes it reports correctly, other times it reports a value of 0.0kWh charged.
8591

86-
**Solution:** This problem is known and a fix is under way. For the moment, just re-run the test. Usually, this should then produce a passing result.
92+
**Solution:** This problem is known and a fix is under way. For the moment, just re-run the test. Usually, this should then produce a passing result.

tests/core_tests/startup_tests.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import queue
1111

1212
from everest.testing.core_utils.fixtures import *
13-
from everest.testing.core_utils.everest_core import EverestCore, TestControlModuleConnection
13+
from everest.testing.core_utils.everest_core import EverestCore, Requirement
1414

1515
from everest.framework import Module, RuntimeSession
1616

@@ -23,7 +23,7 @@ async def test_000_startup_check(everest_core: EverestCore):
2323

2424
class ProbeModule:
2525
def __init__(self, session: RuntimeSession):
26-
m = Module('probe_module', session)
26+
m = Module('probe', session)
2727
self._setup = m.say_hello()
2828

2929
# subscribe to session events
@@ -76,13 +76,18 @@ def test(self, timeout: float) -> bool:
7676

7777
return True
7878

79+
7980
@pytest.mark.everest_core_config('config-sil.yaml')
8081
@pytest.mark.asyncio
8182
async def test_001_start_test_module(everest_core: EverestCore):
8283
logging.info(">>>>>>>>> test_001_start_test_module <<<<<<<<<")
8384

84-
everest_core.start(standalone_module='probe_module', modules_to_test=[
85-
TestControlModuleConnection(evse_manager_id="connector_1", car_simulator_id="car_simulator", ocpp_id=None)])
85+
test_connections = {
86+
'test_control': [Requirement('car_simulator', 'main')],
87+
'connector_1': [Requirement('connector_1', 'evse')]
88+
}
89+
90+
everest_core.start(standalone_module='probe', test_connections=test_connections)
8691
logging.info("everest-core ready, waiting for probe module")
8792

8893
session = RuntimeSession(str(everest_core.prefix_path), str(everest_core.everest_config_path))

0 commit comments

Comments
 (0)