Skip to content
Open
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
62 changes: 62 additions & 0 deletions .github/actions/run_osc_validation/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: "Run osc-validation"
description: "Install osc-validation, run pytest suite with HTML report, and collect artifacts"
runs:
using: "composite"
steps:

- name: Checkout osc-validation
uses: actions/checkout@v4
with:
repository: PMSFIT/osc-validation
ref: v0.1.0
fetch-depth: 1
path: osc-validation

- name: Set up Python venv
shell: bash
run: |
pushd osc-validation
python3 -m venv .venv
source .venv/bin/activate
pip install -e . "numpy<2.0"
popd

- name: Run osc-validation
id: run_tests
shell: bash
run: |
pushd osc-validation
source .venv/bin/activate

SIM_BIN="$(pwd)/../bin/esmini"
echo "Using esmini binary: $SIM_BIN"

mkdir -p osc_validation_results

set +e
osc-validate \
--tool ESMini \
--toolpath "$SIM_BIN" \
--test-profile "$GITHUB_ACTION_PATH/test_profile.toml" \
--html osc_validation_results/report.html
code=$?
echo "exitcode=$code" >> $GITHUB_OUTPUT
echo "osc-validation finished with exit code $code"

popd

- name: Upload osc-validation artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: osc-validation
path: osc-validation/osc_validation_results

- name: Fail if tests failed
if: always()
shell: bash
run: |
if [ "${{ steps.run_tests.outputs.exitcode }}" != "0" ]; then
echo "osc-validation failed"
exit 1
fi
15 changes: 15 additions & 0 deletions .github/actions/run_osc_validation/test_profile.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[[xfail]]
test = "scenario/trajectories/val_interpolation.py::test_timed_polyline_trajectory_interpolation[constant_acceleration_from_initial_speed-*]"
reason = "ESMini does not currently support timed polyline constant-acceleration interpolation."

[[xfail]]
test = "scenario/trajectories/val_follow_trajectory_future_time_reference.py::test_follow_trajectory_future_time_reference_continues_init_speed_until_first_vertex"
reason = "ESMini does not currently implement this OpenSCENARIO FollowTrajectoryAction special case (OpenSCENARIO Specification section 6.9.2)."

[[xfail]]
test = "scenario/trajectories/val_follow_trajectory_teleport.py::test_follow_trajectory_position_mode_teleports_to_current_trajectory_time[exact_trajectory_point-2.0]"
reason = "ESMini does not currently implement this OpenSCENARIO FollowTrajectoryAction special case (OpenSCENARIO Specification section 6.9.3)."

[[xfail]]
test = "scenario/trajectories/val_follow_trajectory_teleport.py::test_follow_trajectory_position_mode_teleports_to_current_trajectory_time[between_trajectory_points-1.0]"
reason = "ESMini does not currently implement this OpenSCENARIO FollowTrajectoryAction special case (OpenSCENARIO Specification section 6.9.3)."
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,25 @@ jobs:
if: ${{ failure() && env.USE_TMATE == 'true' }}
uses: mxschmitt/action-tmate@v3

osc-validation:
needs: [test]
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v6

- uses: actions/download-artifact@v4.1.7
with:
name: esmini-bin_Linux

- name: Extract Ubuntu release binary artifact
run: |
unzip -q esmini-bin_Linux.zip
ln -s esmini/bin bin

- name: Run osc-validation
uses: ./.github/actions/run_osc_validation

test-no-external-modules:
needs: [lint]

Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/memoryleak.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: MemoryLeak

on:
schedule:
# This will run the memory leak check job Nightly at 1AM every day for the dev branch
# * is a special character in YAML so you have to quote this string
- cron: '0 1 * * *'

workflow_dispatch:

jobs:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/sanitize.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: Sanitize

on:
schedule:
# This will run the sanitize job Nightly at 3AM every day for the dev branch
# * is a special character in YAML so you have to quote this string
- cron: '0 3 * * *'

workflow_dispatch:

jobs:
Expand Down
13 changes: 12 additions & 1 deletion OSMP_FMU/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,20 @@ execute_process(
ERROR_QUIET)

message("Version: " ${VERSION})
if(NOT VERSION OR VERSION STREQUAL "")
# git describe returned nothing (fork or shallow clone)
set(VERSION "v0.0.0")
endif()

# Strip prefix "v" and any trailing line break
string(SUBSTRING "${VERSION}" 1 -1 VERSION )
string(LENGTH "${VERSION}" _vlen)
if(_vlen GREATER 1)
string(SUBSTRING "${VERSION}" 1 -1 VERSION)
else()
# Fallback: remove leading v manually or leave unchanged
set(VERSION "0.0.0")
endif()

string(STRIP "${VERSION}" VERSION)

set(OSIVERSION "3.5.0")
Expand Down
6 changes: 3 additions & 3 deletions scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export SMOKE_TEST_FOLDER=${workingDir}/test
export ESMINI_CS_WRAPPER_FOLDER=${workingDir}/test/CSharpWrappers/build/${build_type}
export ESMINI_CS_WRAPPER_BINARY=libesmini_cs_wrapper_test

if [[ "$OSTYPE" == "msys" ]]; then
if [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "cygwin" ]]; then
export PATH=${PATH}":${workingDir}/build/EnvironmentSimulator/Libraries/esminiLib/${build_type}:${workingDir}/build/EnvironmentSimulator/Libraries/esminiRMLib/${build_type}"
export EXE_FOLDER="./$build_type"
export PYTHON="python"
Expand All @@ -66,7 +66,7 @@ else
echo "Unsupported OS: " $OSTYPE
fi

if [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "linux-gnu"* ]]; then
if [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "linux-gnu"* ]]; then

cd $UNIT_TEST_FOLDER

Expand Down Expand Up @@ -120,7 +120,7 @@ if [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "linux-gnu"* ]]; then
fi
fi

if [[ "$OSTYPE" == "msys" ]] && [[ "$add_wrapper_test" == true ]]; then
if [[ ("$OSTYPE" == "msys" || "$OSTYPE" == "cygwin") && "$add_wrapper_test" == true ]]; then
echo $'\n'Run C# esminiLib wrapper test:
cd ${workingDir}/bin
if ! ${ESMINI_CS_WRAPPER_FOLDER}/${ESMINI_CS_WRAPPER_BINARY}; then
Expand Down
Loading