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

Update Mock Service to Version 4.0 #70

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,17 @@ jobs:
update_check: true
annotate_only: true

- uses: 5monkeys/cobertura-action@master
- uses: irongut/CodeCoverageSummary@v1.3.0
with:
path: results/CodeCoverage/cobertura-coverage.xml
minimum_coverage: 80
show_line: true
show_branch: true
fail_below_threshold: false
filename: results/CodeCoverage/cobertura-coverage.xml
badge: true
format: markdown
hide_complexity: true
indicators: true
output: both

- run: |
cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY

run-local-integration-tests:
name: Run Integration Tests for local runtime
Expand Down
18 changes: 10 additions & 8 deletions mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
from lib.dsl import (
create_animation_action,
create_behavior,
create_event_trigger,
create_set_action,
get_datapoint_value,
mock_datapoint,
)
from lib.trigger import ClockTrigger, EventTrigger, EventType
from lib.trigger import ClockTrigger, EventType

mock_datapoint(
path="Vehicle.Speed",
Expand All @@ -42,7 +43,7 @@
initial_value=0,
behaviors=[
create_behavior(
trigger=EventTrigger(EventType.ACTUATOR_TARGET),
trigger=create_event_trigger(EventType.ACTUATOR_TARGET),
action=create_animation_action(
duration=10.0,
values=["$self", "$event.value"],
Expand All @@ -56,7 +57,7 @@
initial_value="STOP_HOLD",
behaviors=[
create_behavior(
trigger=EventTrigger(EventType.ACTUATOR_TARGET),
trigger=create_event_trigger(EventType.ACTUATOR_TARGET),
action=create_set_action("$event.value"),
)
],
Expand All @@ -67,7 +68,7 @@
initial_value=0,
behaviors=[
create_behavior(
trigger=EventTrigger(EventType.ACTUATOR_TARGET),
trigger=create_event_trigger(EventType.ACTUATOR_TARGET),
action=create_set_action("$event.value"),
)
],
Expand All @@ -78,15 +79,15 @@
initial_value=0,
behaviors=[
create_behavior(
trigger=EventTrigger(EventType.ACTUATOR_TARGET),
trigger=create_event_trigger(EventType.ACTUATOR_TARGET),
condition=lambda ctx: get_datapoint_value(
ctx, "Vehicle.Body.Windshield.Front.Wiping.System.Mode"
)
== "EMERGENCY_STOP",
action=create_set_action(0),
),
create_behavior(
trigger=EventTrigger(EventType.ACTUATOR_TARGET),
trigger=create_event_trigger(EventType.ACTUATOR_TARGET),
condition=lambda ctx: get_datapoint_value(
ctx, "Vehicle.Body.Windshield.Front.Wiping.System.Mode"
)
Expand All @@ -100,7 +101,7 @@
),
),
create_behavior(
trigger=EventTrigger(EventType.ACTUATOR_TARGET),
trigger=create_event_trigger(EventType.ACTUATOR_TARGET),
condition=lambda ctx: get_datapoint_value(
ctx, "Vehicle.Body.Windshield.Front.Wiping.System.Mode"
)
Expand All @@ -121,7 +122,8 @@
initial_value=False,
behaviors=[
create_behavior(
EventTrigger(EventType.ACTUATOR_TARGET), create_set_action("$event.value")
create_event_trigger(EventType.ACTUATOR_TARGET),
create_set_action("$event.value"),
)
],
)
6 changes: 3 additions & 3 deletions runtime.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,19 @@
"config": [
{
"key": "image",
"value": "ghcr.io/boschglobal/kuksa.val.services/mock_service:latest"
"value": "ghcr.io/eclipse-kuksa/kuksa-mock-provider/mock-provider:0.4.0"
},
{
"key": "env",
"value": "VDB_ADDRESS=127.0.0.1:55555"
},
{
"key": "mount",
"value": "$pathInWorkspaceOrPackage( ${{ mockFilePath }} ):/mock.py"
"value": "$pathInWorkspaceOrPackage( ${{ mockFilePath }} ):/mock/mock.py"
},
{
"key": "start-pattern",
"value": ".*[cC]onnected to data broker.*"
"value": ".*Databroker connected!*"
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions runtime_kanto/src/runtime/deployment/mockservice.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"container_name": "mockservice",
"image": {
"name": "ghcr.io/boschglobal/kuksa.val.services/mock_service:latest"
"name": "ghcr.io/eclipse-kuksa/kuksa-mock-provider/mock-provider:0.4.0"
},
"mount_points": [
{
"destination": "mock.py",
"destination": "/mock/mock.py",
"source": "/workspaces/vehicle-app-python-template/mock.py",
"propagation_mode": "rprivate"
}
Expand Down
Loading