diff --git a/sim/contrib/examples/Common/Scenarios/XOSC/Scenario.xosc b/sim/contrib/examples/Common/Scenarios/XOSC/Scenario.xosc new file mode 100644 index 0000000000000000000000000000000000000000..17eea7f30a63d17159e806a2021526205c2cef86 --- /dev/null +++ b/sim/contrib/examples/Common/Scenarios/XOSC/Scenario.xosc @@ -0,0 +1,210 @@ +<?xml version='1.0' encoding='UTF-8'?> +<OpenSCENARIO> + <FileHeader revMajor="1" revMinor="1" date="2020-06-26T00:17:00" description="openPASS default scenario" author="in-tech GmbH"/> + <CatalogLocations> + <VehicleCatalog> + <Directory path="../../Vehicles"/> + </VehicleCatalog> + <PedestrianCatalog> + <Directory path="../../Vehicles"/> + </PedestrianCatalog> + <ControllerCatalog> + <Directory path=""/> + </ControllerCatalog> + <ManeuverCatalog> + <Directory path=""/> + </ManeuverCatalog> + <MiscObjectCatalog> + <Directory path=""/> + </MiscObjectCatalog> + <EnvironmentCatalog> + <Directory path=""/> + </EnvironmentCatalog> + <TrajectoryCatalog> + <Directory path=""/> + </TrajectoryCatalog> + <RouteCatalog> + <Directory path=""/> + </RouteCatalog> + </CatalogLocations> + <RoadNetwork> + <LogicFile filepath="../../SceneryConfiguration.xodr"/> + <SceneGraphFile filepath=""/> + </RoadNetwork> + <Entities> + <ScenarioObject name="Ego"> + <CatalogReference catalogName="VehicleCatalog" entryName="car_mini_cooper"/> + <ObjectController name="Ego"> + <Controller name="libComplexController"> + <Properties> + <Property name="controllerConfig::name" value="Ego"/> + <Property name="controllerConfig::parameters::profile" value="MiddleClassCarAgent"/> + <Property name="simulator::paths::config" value="/home/jenkins/agent/opSimulation/repo/sim/contrib/examples/Common"/> + <Property name="simulator::paths::lib" value="/home/jenkins/agent/opSimulation/gecco/gecco/modules"/> + <Property name="entityProperties::bounding_box::dimension::height" value="1.420000"/> + <Property name="entityProperties::bounding_box::dimension::length" value="3.800000"/> + <Property name="entityProperties::bounding_box::dimension::width" value="1.890000"/> + <Property name="entityProperties::bounding_box::geometric_center::x" value="1.350000"/> + <Property name="entityProperties::bounding_box::geometric_center::y" value="0.000000"/> + <Property name="entityProperties::bounding_box::geometric_center::z" value="0.710000"/> + <Property name="entityProperties::classification" value="4"/> + <Property name="entityProperties::front_axle::bb_center_to_axle_center::x" value="1.130000"/> + <Property name="entityProperties::front_axle::bb_center_to_axle_center::y" value="0.000000"/> + <Property name="entityProperties::front_axle::bb_center_to_axle_center::z" value="-0.415000"/> + <Property name="entityProperties::front_axle::max_steering" value="0.476600"/> + <Property name="entityProperties::front_axle::track_width" value="1.800000"/> + <Property name="entityProperties::front_axle::wheel_diameter" value="0.590000"/> + <Property name="entityProperties::is_controlled_externally" value="0"/> + <Property name="entityProperties::is_host" value="1"/> + <Property name="entityProperties::mass" value="1235.000000"/> + <Property name="entityProperties::model" value="car_mini_cooper"/> + <Property name="entityProperties::performance::max_acceleration" value="9.806650"/> + <Property name="entityProperties::performance::max_acceleration_rate" value="inf"/> + <Property name="entityProperties::performance::max_deceleration" value="9.806650"/> + <Property name="entityProperties::performance::max_deceleration_rate" value="inf"/> + <Property name="entityProperties::performance::max_speed" value="58.330000"/> + <Property name="entityProperties::properties::AirDragCoefficient" value="0.3"/> + <Property name="entityProperties::properties::AxleRatio" value="3.789"/> + <Property name="entityProperties::properties::DecelerationFromPowertrainDrag" value="0.5"/> + <Property name="entityProperties::properties::FrictionCoefficient" value="1.0"/> + <Property name="entityProperties::properties::FrontSurface" value="2.07"/> + <Property name="entityProperties::properties::GearRatio1" value="4.154"/> + <Property name="entityProperties::properties::GearRatio2" value="2.45"/> + <Property name="entityProperties::properties::GearRatio3" value="1.557"/> + <Property name="entityProperties::properties::GearRatio4" value="1.09"/> + <Property name="entityProperties::properties::GearRatio5" value="0.843"/> + <Property name="entityProperties::properties::GearRatio6" value="0.675"/> + <Property name="entityProperties::properties::GearRatio7" value="0.547"/> + <Property name="entityProperties::properties::MaximumEngineSpeed" value="6000.0"/> + <Property name="entityProperties::properties::MaximumEngineTorque" value="220.0"/> + <Property name="entityProperties::properties::MinimumEngineSpeed" value="900.0"/> + <Property name="entityProperties::properties::MinimumEngineTorque" value="-54.0"/> + <Property name="entityProperties::properties::MomentInertiaPitch" value="0.0"/> + <Property name="entityProperties::properties::MomentInertiaRoll" value="0.0"/> + <Property name="entityProperties::properties::MomentInertiaYaw" value="0.0"/> + <Property name="entityProperties::properties::NumberOfGears" value="7"/> + <Property name="entityProperties::properties::SensorPosition/FrontCenter/Height" value="0.57"/> + <Property name="entityProperties::properties::SensorPosition/FrontCenter/Lateral" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/FrontCenter/Longitudinal" value="3.22"/> + <Property name="entityProperties::properties::SensorPosition/FrontCenter/Pitch" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/FrontCenter/Roll" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/FrontCenter/Yaw" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/FrontLeft/Height" value="0.65"/> + <Property name="entityProperties::properties::SensorPosition/FrontLeft/Lateral" value="0.65"/> + <Property name="entityProperties::properties::SensorPosition/FrontLeft/Longitudinal" value="3.05"/> + <Property name="entityProperties::properties::SensorPosition/FrontLeft/Pitch" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/FrontLeft/Roll" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/FrontLeft/Yaw" value="1.134464"/> + <Property name="entityProperties::properties::SensorPosition/FrontRight/Height" value="0.65"/> + <Property name="entityProperties::properties::SensorPosition/FrontRight/Lateral" value="-0.65"/> + <Property name="entityProperties::properties::SensorPosition/FrontRight/Longitudinal" value="3.05"/> + <Property name="entityProperties::properties::SensorPosition/FrontRight/Pitch" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/FrontRight/Roll" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/FrontRight/Yaw" value="-1.134464"/> + <Property name="entityProperties::properties::SensorPosition/FrontWindow/Height" value="1.28"/> + <Property name="entityProperties::properties::SensorPosition/FrontWindow/Lateral" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/FrontWindow/Longitudinal" value="1.83"/> + <Property name="entityProperties::properties::SensorPosition/FrontWindow/Pitch" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/FrontWindow/Roll" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/FrontWindow/Yaw" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/RearLeft/Height" value="0.6"/> + <Property name="entityProperties::properties::SensorPosition/RearLeft/Lateral" value="0.7"/> + <Property name="entityProperties::properties::SensorPosition/RearLeft/Longitudinal" value="-0.35"/> + <Property name="entityProperties::properties::SensorPosition/RearLeft/Pitch" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/RearLeft/Roll" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/RearLeft/Yaw" value="2.146755"/> + <Property name="entityProperties::properties::SensorPosition/RearRight/Height" value="0.6"/> + <Property name="entityProperties::properties::SensorPosition/RearRight/Lateral" value="-0.7"/> + <Property name="entityProperties::properties::SensorPosition/RearRight/Longitudinal" value="-0.35"/> + <Property name="entityProperties::properties::SensorPosition/RearRight/Pitch" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/RearRight/Roll" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/RearRight/Yaw" value="-2.146755"/> + <Property name="entityProperties::properties::SensorPosition/RearWindow/Height" value="1.33"/> + <Property name="entityProperties::properties::SensorPosition/RearWindow/Lateral" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/RearWindow/Longitudinal" value="-0.08"/> + <Property name="entityProperties::properties::SensorPosition/RearWindow/Pitch" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/RearWindow/Roll" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/RearWindow/Yaw" value="3.141592"/> + <Property name="entityProperties::properties::SensorPosition/SideLeft/Height" value="0.26"/> + <Property name="entityProperties::properties::SensorPosition/SideLeft/Lateral" value="0.81"/> + <Property name="entityProperties::properties::SensorPosition/SideLeft/Longitudinal" value="1.06"/> + <Property name="entityProperties::properties::SensorPosition/SideLeft/Pitch" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/SideLeft/Roll" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/SideLeft/Yaw" value="1.570796"/> + <Property name="entityProperties::properties::SensorPosition/SideRight/Height" value="0.26"/> + <Property name="entityProperties::properties::SensorPosition/SideRight/Lateral" value="-0.81"/> + <Property name="entityProperties::properties::SensorPosition/SideRight/Longitudinal" value="1.06"/> + <Property name="entityProperties::properties::SensorPosition/SideRight/Pitch" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/SideRight/Roll" value="0.0"/> + <Property name="entityProperties::properties::SensorPosition/SideRight/Yaw" value="-1.570796"/> + <Property name="entityProperties::properties::SteeringRatio" value="10.7"/> + <Property name="entityProperties::rear_axle::bb_center_to_axle_center::x" value="-1.350000"/> + <Property name="entityProperties::rear_axle::bb_center_to_axle_center::y" value="0.000000"/> + <Property name="entityProperties::rear_axle::bb_center_to_axle_center::z" value="-0.415000"/> + <Property name="entityProperties::rear_axle::max_steering" value="0.000000"/> + <Property name="entityProperties::rear_axle::track_width" value="1.800000"/> + <Property name="entityProperties::rear_axle::wheel_diameter" value="0.590000"/> + <Property name="entityProperties::type" value="2"/> + </Properties> + </Controller> + </ObjectController> + </ScenarioObject> + </Entities> + <Storyboard> + <Init> + <Actions> + <Private entityRef="Ego"> + <PrivateAction> + <TeleportAction> + <Position> + <LanePosition roadId="1" laneId="-1" offset="0.0" s="0.0"> + <Orientation type="relative"/> + </LanePosition> + </Position> + </TeleportAction> + </PrivateAction> + <PrivateAction> + <LongitudinalAction> + <SpeedAction> + <SpeedActionDynamics dynamicsShape="step" value="0.0" dynamicsDimension="rate"/> + <SpeedActionTarget> + <AbsoluteTargetSpeed value="43.5"/> + </SpeedActionTarget> + </SpeedAction> + </LongitudinalAction> + </PrivateAction> + <PrivateAction> + <ControllerAction> + <ActivateControllerAction objectControllerRef="Ego" lateral="true" longitudinal="true" /> + </ControllerAction> + </PrivateAction> + </Private> + </Actions> + </Init> + <Story name=""> + <Act name=""> + <ManeuverGroup name="" maximumExecutionCount="1"> + <Actors selectTriggeringEntities="false"/> + </ManeuverGroup> + <StartTrigger> + <ConditionGroup> + <Condition name="StartTime" delay="0" conditionEdge="rising"> + <ByValueCondition> + <SimulationTimeCondition value="0.0" rule="greaterOrEqual"/> + </ByValueCondition> + </Condition> + </ConditionGroup> + </StartTrigger> + </Act> + </Story> + <StopTrigger> + <ConditionGroup> + <Condition name="EndTime" delay="0" conditionEdge="rising"> + <ByValueCondition> + <SimulationTimeCondition value="30.0" rule="greaterThan"/> + </ByValueCondition> + </Condition> + </ConditionGroup> + </StopTrigger> + </Storyboard> +</OpenSCENARIO> diff --git a/sim/contrib/examples/Common/UserSettings/UserSettings.ini b/sim/contrib/examples/Common/UserSettings/UserSettings.ini new file mode 100644 index 0000000000000000000000000000000000000000..fe04e94051b4d002ffa27cc44983a6372ef266b6 --- /dev/null +++ b/sim/contrib/examples/Common/UserSettings/UserSettings.ini @@ -0,0 +1,39 @@ +# Version : 0.0.1 +# Documentation : see GT-Gen Core project from https://gitlab.eclipse.org/eclipse/openpass + +[FileLogging] +LogLevel = Debug + +[GroundTruth] +LaneMarkingDistance = 0.4 +SimplifyLaneMarkingsEpsilon = 0.01 +SimplifyLaneMarkings = true +AllowInvalidLaneLocations = true + +[HostVehicle] +Movement = InternalVehicle +BlockingCommunication = false +TimeScale = 1 +RecoveryMode = false + +[Map] +IncludeObstacles = false + +[MapChunking] +ChunkGridSize = 50 +CellsPerDirection = 2 + +[UserDirectories] +Scenarios = +Maps = +Plugins = {/home/jenkins/agent/opSimulation/gecco/gecco/modules} + +[SimulationResults] +LogCyclics = true +OutputDirectoryPath = /home/jenkins/agent/opSimulation/artifacts/config_output + +[Clock] +UseSystemClock = false + +[Foxglove] +WebsocketServer = false diff --git a/sim/tests/endToEndTests/test_end_to_end.json b/sim/tests/endToEndTests/test_end_to_end.json index a115652401d455d1573824ca45a41cbee9419ca0..edd027aeb45f6547761e3c018025051d928f95b1 100644 --- a/sim/tests/endToEndTests/test_end_to_end.json +++ b/sim/tests/endToEndTests/test_end_to_end.json @@ -1,7 +1,41 @@ { "config_sets": { "Generic": [ - "Common" + "ADAS_AEB_PreventingCollisionWithObstacle", + "Common", + "DynamicOSMPSensorDataToTUStepper", + "DynamicSSPStepper", + "LightStateAction", + "OSCAction_DoubleCubicLaneChangeLeft_Absolute", + "OSCAction_DoubleCubicLaneChangeLeft_Relative", + "OSCAction_DoubleCubicLaneChangeRight_Absolute", + "OSCAction_DoubleCubicLaneChangeRight_Relative", + "OSCAction_SpeedAction_Step", + "OSCAction_TeleportAction", + "StaticOSMPSensorDataToTUStepper", + "StaticSSPStepper", + "Sensor_Latency", + "SupplementaryTrafficSigns", + "TrafficJam" + ], + "DISABLED_Generic": [ + "ADAS_AEB_CutIn", + "ADAS_AEB_PreventingCollisionWithObstacleInCurve", + "ADAS_V2X", + "AFDM_TJunction", + "ByEntityCondition_RelativeLane", + "ByEntityCondition_RelativeSpeed", + "ByEntityCondition_RoadPosition", + "ByEntityCondition_TimeHeadway", + "ByEntityCondition_TimeToCollision", + "LocalizationOnJunction", + "ObjectAboveRoad", + "ObjectOfTypeRoadMark", + "OSCAction_ActivateController", + "OSCAction_TrafficSinkAction", + "Pedestrian_Trajectory", + "TurningRates", + "TrafficLight" ], "ByEntityCondition": [ "ByEntityCondition_RelativeLane", @@ -51,7 +85,9 @@ "Sensor_Failure_1_Car2X" ], "Sensor_Failure_0.5": [ - "Sensor_Failure_0.5_Geometric2D", + "Sensor_Failure_0.5_Geometric2D" + ], + "DISABLED_Sensor_Failure_0.5": [ "Sensor_Failure_0.5_Car2X" ], "PCM": [ @@ -75,16 +111,16 @@ "OSCAction_ActivateController": [ "OSCAction_ActivateController" ], - "OSCAction_SinusoidalLaneChange": [ - "OSCAction_SinusoidalLaneChangeLeft_Absolute", - "OSCAction_SinusoidalLaneChangeRight_Absolute", - "OSCAction_SinusoidalLaneChangeLeft_Relative", - "OSCAction_SinusoidalLaneChangeRight_Relative" + "OSCAction_CubicLaneChange": [ + "OSCAction_CubicLaneChangeLeft_Absolute", + "OSCAction_CubicLaneChangeRight_Absolute", + "OSCAction_CubicLaneChangeLeft_Relative", + "OSCAction_CubicLaneChangeRight_Relative" ], - "OSCAction_DoubleSinusoidalLaneChange": [ - "OSCAction_DoubleSinusoidalLaneChangeLeft_Absolute", - "OSCAction_DoubleSinusoidalLaneChangeLeft_Relative", - "OSCAction_DoubleSinusoidalLaneChangeRight_Relative" + "OSCAction_DoubleCubicLaneChange": [ + "OSCAction_DoubleCubicLaneChangeLeft_Absolute", + "OSCAction_DoubleCubicLaneChangeLeft_Relative", + "OSCAction_DoubleCubicLaneChangeRight_Relative" ], "OSCAction_SpeedAction_Absolute": [ "OSCAction_SpeedAction_Absolute" @@ -95,18 +131,12 @@ "OSCAction_SpeedAction_Step": [ "OSCAction_SpeedAction_Step" ], - "OSCAction_RemoveAgent": [ - "OSCAction_RemoveAgent" - ], "OSCAction_TeleportAction": [ "OSCAction_TeleportAction" ], "OSCAction_TrafficSinkAction": [ "OSCAction_TrafficSinkAction" ], - "Delay": [ - "OSCAction_RemoveAgentWithDelay" - ], "TUStepCtrl": [ "StaticOSMPSensorDataToTUStepper", @@ -131,6 +161,480 @@ "duration": 30, "invocations": 3, "determinism": true + }, + "generic_fmu_linux64": { + "config_sets": [ + "FMU" + ], + "duration": 30, + "invocations": 1, + "parameterization": { + "file": "systemConfigFmuActuator.xml", + "xpath": "//value[../id='FmuPath']", + "values": [ + "resources/linux64/dummyFMU1_StaticFMUActuator.fmu", + "resources/linux64/dummyFMU2_StaticFMUActuator.fmu" + ] + } + }, + "DISABLED_generic_fmu_win64": { + "config_sets": [ + "FMU" + ], + "duration": 30, + "invocations": 1, + "parameterization": { + "file": "systemConfigFmuActuator.xml", + "xpath": "//value[../id='FmuPath']", + "values": [ + "resources/win64/dummyFMU1_StaticFMUActuator.fmu", + "resources/win64/dummyFMU2_StaticFMUActuator.fmu" + ] + } + }, + "FMU_CustomCommandAction": { + "config_sets": [ + "FMU_CustomCommandAction" + ], + "duration": 1, + "invocations": 1, + "description": "Check if the XPosition(BB Center) of the ego agent is as expected", + "queries": [ + "count(AgentId | XPosition == 100 and Timestep == 100 and AgentId == 0) == 1" + ], + "success_rate": 1.0 + }, + "DISABLED_FMU_FollowPathAction": { + "config_sets": [ + "FMU_FollowPathAction" + ], + "duration": 1, + "invocations": 1, + "description": "Check if the XPosition_RA and YPosition_RA of the agent is as expected", + "queries": [ + "count(AgentId | XPosition_RA == 200.50 and YPosition_RA == 5.425 and Timestep == 100 and AgentId == 0) == 1" + ], + "success_rate": 1.0 + }, + "DISABLED_FMU_FollowTrajectoryAction": { + "config_sets": [ + "FMU_FollowTrajectoryAction" + ], + "duration": 5, + "invocations": 1, + "description": "Check if the XPosition_RA and YPosition_RA of the ego agent is as expected", + "queries": [ + "count(AgentId | XPosition_RA == 200.50 and YPosition_RA == 5.425 and Timestep == 100 and AgentId == 0) == 1" + ], + "success_rate": 1.0 + }, + "FMU_SpeedAction": { + "config_sets": [ + "FMU_SpeedAction" + ], + "duration": 1, + "invocations": 1, + "description": "Check if the speed of the ego agent is as expected", + "queries": [ + "count(AgentId | AgentId == 0 and Timestep == 100 and Velocity_RA == 20.0) == 1" + ], + "success_rate": 1.0 + }, + "DISABLED_ADAS_AEB": { + "config_sets": [ + "ADAS_AEB_PreventingCollisionWithObstacle" + ], + "duration": 30, + "invocations": 1, + "description": "AEB triggers if agent cannot stop", + "queries": [ + "mean(Velocity_RA | AgentId == 0 and PositionRoute > 285 and PositionRoute < 295) < 28.5" + ], + "success_rate": 1 + }, + "DISABLED_ADAS_Static_AEB": { + "config_sets": [ + "ADAS_Static_AEB_PreventingCollisionWithObstacle" + ], + "duration": 30, + "invocations": 1, + "description": "Static AEB Acting stage triggers with obstacle", + "queries": [ + "count(AgentId | #(Algorithm_AutonomousEmergencyBraking):ComponentState=='Acting') >= 1" + ], + "success_rate": 1 + }, + "DISABLED_ADAS_AEB_InCurve": { + "config_sets": [ + "ADAS_AEB_PreventingCollisionWithObstacleInCurve" + ], + "duration": 20, + "invocations": 1, + "description": "AEB Acting stage triggers with obstacle in curve", + "queries": [ + "count(AgentId | #(Algorithm_AutonomousEmergencyBraking):ComponentState=='Acting') >= 1" + ], + "success_rate": 1 + }, + "DISABLED_ADAS_AEB_CutIn_TriggersAndPreventsCollision": { + "config_sets": [ + "ADAS_AEB_CutIn" + ], + "duration": 30, + "invocations": 20, + "description": "AEB triggers and prevents collision", + "queries": [ + "count(AgentId | AgentId == 0 and #(Algorithm_AutonomousEmergencyBraking):ComponentState=='Acting') >= 1", + "count(AgentId | AgentId == 0 and #(Collision) >= 1) == 0" + ], + "success_rate": 0.95 + }, + "DISABLED_ADAS_V2X": { + "config_sets": [ + "ADAS_V2X" + ], + "duration": 20, + "invocations": 1, + "description": "Receiver car2x detects the object within the signal range", + "queries": [ + "count(AgentId | AgentId == 0 and Timestep > 0 and Timestep <= 10000 and Sensor0_DetectedAgents == 'nan') == 39", + "count(AgentId | AgentId == 1 and Timestep > 0 and Timestep <= 10000 and Sensor0_DetectedAgents == 'nan') == 39", + "count(AgentId | AgentId == 0 and Timestep > 0 and Timestep <= 20000 and Sensor0_DetectedAgents == '1') == 134", + "count(AgentId | AgentId == 1 and Timestep > 0 and Timestep <= 20000 and Sensor0_DetectedAgents == '0') == 135", + "count(AgentId | AgentId == 0 and Timestep > 10000 and Timestep <= 20000 and Sensor0_DetectedAgents == 'nan') == 27", + "count(AgentId | AgentId == 1 and Timestep > 10000 and Timestep <= 20000 and Sensor0_DetectedAgents == 'nan') == 26" + ], + "success_rate": 1, + "datatypes": { + "Sensor0_DetectedAgents": "str" + } + }, + "DISABLED_ByEntityCondition": { + "config_sets": [ + "ByEntityCondition" + ], + "duration": 11, + "invocations": 1, + "description": "Agent performs left Cubic lane change to lane id -3 if entity condition is met", + "queries": [ + "count(AgentId | AgentId == 0 and Timestep >= 10000 and Lane == -3) > 0" + ], + "success_rate": 1.0 + }, + "DISABLED_LightStateAction": { + "config_sets": [ + "LightStateAction" + ], + "duration": 10, + "invocations": 1, + "description": "IndicatorState for Ego is set to left", + "queries": [ + "count(AgentId | AgentId == 0 and Timestep <= 3000 and IndicatorState == 1) == 0", + "count(AgentId | AgentId == 0 and Timestep > 3000 and Timestep <= 6000 and IndicatorState == 1) > 0", + "count(AgentId | AgentId == 0 and Timestep > 6000 and IndicatorState == 1) == 0" + ], + "success_rate": 1.0 + }, + "DISABLED_LocalizationOnJunction": { + "config_sets": [ + "LocalizationOnJunction" + ], + "duration": 45, + "invocations": 10, + "description": "Agent is always located on defined route", + "queries": [ + "count(Road | Road !='R1' and Road !='R1_3' and Road !='R3') == 0" + ], + "success_rate": 0.99 + }, + "DISABLED_NoCollisionWithObject": { + "config_sets": [ + "NoCollisionWithObject" + ], + "duration": 5, + "invocations": 1, + "description": "No collision with the object", + "queries": [ + "count(AgentId | #(Collision) >= 1) == 0" + ], + "success_rate": 1.0 + }, + "DISABLED_OSCAction_ActivateController":{ + "config_sets": [ + "OSCAction_ActivateController" + ], + "duration": 2, + "invocations": 1, + "description": "Controllers of ego change", + "queries": [ + "count(AgentId | AgentId == 0 and Timestep == 600 and #(ActiveComponentChange):LongitudinalController=='Dynamics_Scenario') == 1", + "count(AgentId | AgentId == 0 and Timestep == 1600 and #(ActiveComponentChange):LongitudinalController=='AlgorithmAgentFollowingDriverModel') == 1" + ], + "success_rate": 1.0 + }, + "OSCAction_DoubleLaneChange": { + "config_sets": [ + "OSCAction_DoubleCubicLaneChange" + ], + "duration": 10, + "invocations": 1, + "description": "Agent performs a double lane change", + "queries": [ + "count(AgentId | AgentId == 0 and (Lane-1 != Lane)) == 2" + ], + "success_rate": 1.0 + }, + "DISABLED_OSCAction_FollowRouteAction": { + "config_sets": [ + "OSCAction_FollowRouteAction" + ], + "duration": 33, + "invocations": 10, + "description": "Agent follows the waypoints specified in the FollowRouteAction", + "queries": [ + "count(Road | Road == 2015840166) >= 1" + ], + "success_rate": 1.0 + }, + "DISABLED_OSCAction_TrafficSinkAction": { + "config_sets": [ + "OSCAction_TrafficSinkAction" + ], + "duration": 50.0, + "invocations": 10, + "description": "All agents should despawn before reaching s = 1000", + "queries": [ + "count(AgentId | Timestep > 0 and PositionRoute > 1000) == 0" + ], + "success_rate": 1.0 + }, + "OSCAction_SingleLaneChange": { + "config_sets": [ + "OSCAction_CubicLaneChange" + ], + "duration": 10, + "invocations": 1, + "description": "Agent performs a single lane change", + "queries": [ + "count(AgentId | AgentId == 0 and (Lane-1 != Lane)) == 1" + ], + "success_rate": 1.0 + }, + "OSCAction_SpeedAction_Absolute": { + "config_sets": [ + "OSCAction_SpeedAction_Absolute" + ], + "duration": 5, + "invocations": 1, + "description": "The speed of the ego agent is set to an absolute value via the OpenSCENARIO SpeedAction", + "queries": [ + "count(AgentId | AgentId == 0 and Timestep == 5000 and VelocityEgo <= 20.1) == 1" + ], + "success_rate": 1.0 + }, + "OSCAction_SpeedAction_Relative": { + "config_sets": [ + "OSCAction_SpeedAction_Relative" + ], + "duration": 10, + "invocations": 1, + "description": "The speed of the ego agent is set to a value relative to the scenario agent via the OpenSCENARIO SpeedAction", + "queries": [ + "count(AgentId | AgentId == 0 and Timestep == 10000 and VelocityEgo >= 44.9) == 1" + ], + "success_rate": 1.0 + }, + "OSCAction_SpeedAction_Step": { + "config_sets": [ + "OSCAction_SpeedAction_Step" + ], + "duration": 1, + "invocations": 1, + "description": "The speed of the ego agent is set to an absolute value via the OpenSCENARIO SpeedAction", + "queries": [ + "count(AgentId | AgentId == 0 and Timestep == 600 and VelocityEgo == 20) == 1" + ], + "success_rate": 1.0 + }, + "DISABLED_OSCAction_TeleportAction": { + "config_sets": [ + "OSCAction_TeleportAction" + ], + "duration": 3, + "invocations": 1, + "description": "The position of the ego agent is set to a value defined via the OpenSCENARIO TeleportAction", + "queries": [ + "count(AgentId | AgentId == 0 and Timestep == 100 and XPosition_RA == 0) == 1", + "count(AgentId | AgentId == 0 and Timestep == 1100 and XPosition_RA == 100) == 1", + "count(AgentId | AgentId == 0 and Timestep == 2100 and XPosition_RA >= 199) == 1", + "count(AgentId | AgentId == 0 and Timestep == 2100 and YawAngle == -0.5) == 1" + ], + "success_rate": 1.0 + }, + "DISABLED_Sensor_Delay": { + "config_sets": [ + "Sensor_Delay" + ], + "duration": 5, + "invocations": 1, + "description": "Sensor detects scenario agent with 1 second delay.", + "queries": [ + "count(AgentId | Timestep<=2000 and AgentId==0 and Sensor0_DetectedAgents=='nan') == 21", + "count(AgentId | Timestep==2100 and AgentId==0 and Sensor0_DetectedAgents=='1') == 1" + ], + "success_rate": 1, + "datatypes": { + "Sensor0_DetectedAgents": "str" + } + }, + "Sensor_Latency": { + "config_sets": [ + "Sensor_Latency" + ], + "duration": 5, + "invocations": 20, + "description": "Sensor detects scenario agent with 1 second delay.", + "queries": [ + "count(AgentId | Timestep==1100 and AgentId==0 and Sensor0_DetectedAgents-1=='nan' and Sensor0_DetectedAgents!='nan') == 1" + ], + "success_rate": 1, + "datatypes": { + "Sensor0_DetectedAgents": "str" + } + }, + "DISABLED_PCM": { + "config_sets": [ + "PCM" + ], + "duration": 10, + "invocations": 1, + "description": "Run a pcm case and check if the collision state is as expected", + "queries": [ + "count(AgentId | XPosition_RA > -1.71 and AgentId == 0 and Timestep == 4840) == 1" + ], + "success_rate": 1 + }, + "DISABLED_Sensor_Failure_0": { + "config_sets": [ + "Sensor_Failure_0" + ], + "duration": 20, + "invocations": 1, + "description": "Sensor detects scenario agent in every timestep.", + "queries": [ + "count(AgentId | AgentId == 0 and Timestep > 0 and Timestep <= 20000 and Sensor0_DetectedAgents == '1') == 200", + "count(AgentId | AgentId == 1 and Timestep > 0 and Timestep <= 20000 and Sensor0_DetectedAgents == '0') == 200" + ], + "success_rate": 1, + "datatypes": { + "Sensor0_DetectedAgents": "str" + } + }, + "DISABLED_Sensor_Failure_1": { + "config_sets": [ + "Sensor_Failure_1" + ], + "duration": 20, + "invocations": 1, + "description": "Sensor never detects scenario agent.", + "queries": [ + "count(AgentId | AgentId == 0 and Timestep > 0 and Timestep <= 20000 and Sensor0_DetectedAgents == 'nan') == 200", + "count(AgentId | AgentId == 1 and Timestep > 0 and Timestep <= 20000 and Sensor0_DetectedAgents == 'nan') == 200" + ], + "success_rate": 1, + "datatypes": { + "Sensor0_DetectedAgents": "str" + } + }, + "Sensor_Failure_0.5_Detected": { + "config_sets": [ + "Sensor_Failure_0.5" + ], + "duration": 5, + "invocations": 2, + "description": "Sensor detects scenario agent in some timestep.", + "queries": [ + "count(AgentId | AgentId==0 and Sensor0_DetectedAgents=='1001') > 0" + ], + "success_rate": 1, + "datatypes": { + "Sensor0_DetectedAgents": "str" + } + }, + "Sensor_Failure_0.5_Undetected": { + "config_sets": [ + "Sensor_Failure_0.5" + ], + "duration": 5, + "invocations": 2, + "description": "Sensor does not detect scenario agent in some timestep.", + "queries": [ + "count(AgentId | AgentId==0 and Sensor0_DetectedAgents=='nan') > 0" + ], + "success_rate": 1, + "datatypes": { + "Sensor0_DetectedAgents": "str" + } + }, + "TUStepCtrl": + { + "config_sets": [ + "TUStepCtrl" + ], + "duration": 2, + "invocations": 1, + "description": "Agent is moved by the trafficUpdateStepper", + "queries": [ + "count(AgentId | (AgentId==0 and Timestep > 0 and Velocity_RA > 0.14 and Velocity_RA < 0.142)) == 21" + ], + "success_rate": 1 + }, + "DISABLED_TrafficLightCheckPhases": + { + "config_sets": [ + "TrafficLight" + ], + "duration": 45, + "invocations": 1, + "description": "TrafficLight Events are posted by simulation and cycle through the states", + "queries": [ + "count(AgentId | #(TrafficLight):traffic_light_state=='red') >= 1", + "count(AgentId | #(TrafficLight):traffic_light_state=='yellow') >= 1", + "count(AgentId | #(TrafficLight):traffic_light_state=='green') >= 1", + "count(AgentId | #(TrafficLight):traffic_light_state=='red yellow') >= 1" + ], + "success_rate": 1 + }, + "DISABLED_Dynamics_Scenario": + { + "config": "Dynamics_Scenario", + "duration": 10, + "invocations": 1, + "description": "Agent equiped with Dynamics_Scenario keeps Velocity_RA and t-offset", + "queries": [ + "count(AgentId | AgentId == 0 and Velocity_RA != 43.5) == 0", + "median(TCoordinate | AgentId == 0) == 0.0", + "std(TCoordinate | AgentId == 0) < 0.1", + "min(TCoordinate | AgentId == 0) > -0.2", + "max(TCoordinate | AgentId == 0) < 0.2" + ], + "success_rate": 1 + }, + "DISABLED_ActiveComponentLogging": + { + "config_sets": [ + "ADAS_AEB_PreventingCollisionWithObstacle" + ], + "duration": 30, + "invocations": 1, + "description": "LongitudinalComponent changes from FollowDriver to AEB", + "queries": [ + "count(AgentId | Timestep == 0 and #(ActiveComponentChange):LongitudinalController=='AlgorithmAgentFollowingDriverModel') >= 1", + "count(AgentId | Timestep == 0 and #(ActiveComponentChange):LateralController=='AlgorithmAgentFollowingDriverModel') >= 1", + "count(AgentId | Timestep > 0 and #(ActiveComponentChange):LongitudinalController=='AEB') >= 1", + "count(AgentId | Timestep > 0 and #(ActiveComponentChange):LateralController=='AlgorithmAgentFollowingDriverModel') >= 1" + ], + "success_rate": 1 } } -} +} \ No newline at end of file diff --git a/utils/ci/Jenkinsfile b/utils/ci/Jenkinsfile index ecfd4c08162d3e2379eb2bf2595263ab85d3945f..b6b303d7a031e4a65ef79c93a325ada38b99dd71 100644 --- a/utils/ci/Jenkinsfile +++ b/utils/ci/Jenkinsfile @@ -13,6 +13,10 @@ pipeline { agent none parameters { booleanParam(name: 'BUILD_DOCKER_IMAGE', defaultValue: false, description: 'Force docker image (re-)build') + string(name: 'OPTESTRUNNER_URL', defaultValue: 'https://ci.eclipse.org/openpass/job/opTestrunner/job/add-invocations-random-seed/1/artifact/repo/plugin/optestrunner/dist/pytest_optestrunner-1.1-py3-none-any.whl', description: 'URL to download opTestrunner binaries') + string(name: 'GECCO_URL', defaultValue: 'https://ci.eclipse.org/openpass/job/gecco/view/change-requests/job/MR-4/3/artifact/artifacts/gecco.tar.gz', description: 'URL to download gecco binaries') + string(name: 'GTGEN_CLI_URL', defaultValue: 'https://ci.eclipse.org/openpass/job/GT-Gen-Simulator-PreMerge-Gate/view/tags/job/v11.3.0/lastSuccessfulBuild/artifact/artifacts/gtgen-cli_1.1.0_amd64.deb', description: 'URL to download gtgen cli binaries') + string(name: 'GTGEN_SIM_URL', defaultValue: 'https://ci.eclipse.org/openpass/job/GT-Gen-Simulator-PreMerge-Gate/view/tags/job/v11.3.0/lastSuccessfulBuild/artifact/artifacts/gtgen-simulator_11.3.0_amd64.deb', description: 'URL to download gtgen simulator binaries') } options { checkoutToSubdirectory('repo') @@ -106,6 +110,7 @@ spec: container('openpass-build') { sh 'bash repo/utils/ci/scripts/pull_gecco.sh' sh 'bash repo/utils/ci/scripts/pull_optestrunner.sh' + // sh 'bash repo/utils/ci/scripts/pull_gtgen.sh' sh 'bash repo/utils/ci/scripts/build_gtgen.sh' } } @@ -113,6 +118,7 @@ spec: stage('Linux: Run E2E') { steps { container('openpass-build') { + sh 'bash repo/utils/ci/scripts/run_gtgen.sh' sh 'bash repo/utils/ci/scripts/55_endtoend.sh' } } @@ -120,8 +126,11 @@ spec: } post { always { - archiveArtifacts allowEmptyArchive: true, artifacts: 'artifacts/**', followSymlinks: false - junit allowEmptyResults: true, testResults: 'build/**/*Tests.xml,repo/sim/tests/endToEndTests/pyOpenPASS/result_*.xml' + script { + sh 'bash repo/utils/ci/scripts/90_pack_artifacts.sh' + archiveArtifacts allowEmptyArchive: true, artifacts: 'artifacts/**', followSymlinks: false + junit allowEmptyResults: true, testResults: 'build/**/*Tests.xml,repo/sim/tests/endToEndTests/pyOpenPASS/result_*.xml' + } } } } diff --git a/utils/ci/scripts/55_endtoend.sh b/utils/ci/scripts/55_endtoend.sh index 35eb9889a1963fa66b166b36257b965f7dfa16b3..68e9abba8525a024b6d2813d710d1d65d8758e0e 100755 --- a/utils/ci/scripts/55_endtoend.sh +++ b/utils/ci/scripts/55_endtoend.sh @@ -24,13 +24,14 @@ OP_REPO_DIR="${OP_REPO_DIR:=$SCRIPT_DIR/../../..}" if [[ -z "${GECCO_DIR}" ]]; then # If not defined, set a default value - GTGEN_DIR="$SCRIPT_DIR/../../../../gtgen_repo" + GTGEN_DIR="$SCRIPT_DIR/../../../../gtgen_cli" GECCO_DIR="$SCRIPT_DIR/../../../../gecco" echo "WARN: GECCO_DIR variable is not set. Setting it to: GECCO_DIR is ${GECCO_DIR}" fi -GTGEN_CLI_PATH="$GTGEN_DIR/gt-gen-simulator-v11.1.0/bazel-out/k8-opt/bin/Cli" +GTGEN_VERSION="add-new-commandline-parameters" +GTGEN_CLI_PATH="$GTGEN_DIR/gt-gen-simulator-${GTGEN_VERSION}/bazel-out/k8-opt/bin/Cli" venv_python_executable="${OP_REPO_DIR}/.env/bin/python3" commonFolder=$GECCO_DIR/gecco/examples/Common @@ -45,8 +46,11 @@ pluginsPath="$GECCO_DIR"/gecco/modules echo "============================== Running test_gtgen_e2e ==============================" ${venv_python_executable} -m pytest -vvv --simulation="${GTGEN_CLI_PATH}/gtgen_cli" --mutual="${commonFolder}" --resources="${resourcePath}" --plugins-path="${pluginsPath}" --allowed-warnings="${allowedWarningsFiles}" --report-path="${GTGEN_CLI_PATH}"/testreport "${OP_REPO_DIR}"/sim/tests/endToEndTests/test_end_to_end.json +exit_code=$? mkdir -p "$SCRIPT_DIR/../../../../dist" || exit 1 mkdir -p "$SCRIPT_DIR"/../../../../dist/opSimulation || exit 1 cp -r "${GTGEN_CLI_PATH}"/artifacts "$SCRIPT_DIR"/../../../../dist/opSimulation || exit 1 cp -r "${GTGEN_CLI_PATH}"/testreport "$SCRIPT_DIR"/../../../../dist/opSimulation || exit 1 + +exit $exit_code \ No newline at end of file diff --git a/utils/ci/scripts/90_pack_artifacts.sh b/utils/ci/scripts/90_pack_artifacts.sh index 6bf805f2680d1a9708cee40d4fc2c5a0bbd60f06..82ab77ccb4a900f3d8e57cf7ca53af943a786b6b 100755 --- a/utils/ci/scripts/90_pack_artifacts.sh +++ b/utils/ci/scripts/90_pack_artifacts.sh @@ -21,15 +21,9 @@ cd "$MYDIR/../../../../dist" || exit 1 SIM_NAME=openPASS_SIM E2E_NAME=openPASS_EndToEndTests -if [[ "${OSTYPE}" = "msys" ]]; then - PLATFORM="windows" - ARCHIVE_TOOL="$MYDIR/util_zip.sh" - ARCHIVE_EXT="zip" -else - PLATFORM="linux" - ARCHIVE_TOOL="$MYDIR/util_tar.sh" - ARCHIVE_EXT="tar.gz" -fi +PLATFORM="linux" +ARCHIVE_TOOL="$MYDIR/util_tar.sh" +ARCHIVE_EXT="tar.gz" mkdir -p ../artifacts/testreport || exit 1 mv opSimulation/testreport ../artifacts/testreport/$PLATFORM diff --git a/utils/ci/scripts/build_gtgen.sh b/utils/ci/scripts/build_gtgen.sh index 71c054222bd59baa1ddd143bd149a9941945b42e..ce1e94d6cf88188f34562015b6e92de7bacdd7da 100755 --- a/utils/ci/scripts/build_gtgen.sh +++ b/utils/ci/scripts/build_gtgen.sh @@ -17,7 +17,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" if [[ -z "${GTGEN_DIR}" ]]; then # If not defined, set a default value - GTGEN_DIR="$SCRIPT_DIR/../../../../gtgen_repo" + GTGEN_DIR="$SCRIPT_DIR/../../../../gtgen_cli" echo "WARN: GTGEN_DIR variable is not set. Setting it to: GTGEN_DIR is ${GTGEN_DIR}" fi @@ -27,9 +27,9 @@ rm -rf -- * || { echo "Failed to clean $GTGEN_DIR directory"; exit 1; } bazel --version || { echo "Unable to run bazel"; exit 1; } # ToDo: Make it generic -GTGEN_URL="https://gitlab.eclipse.org/eclipse/openpass/gt-gen-simulator/-/archive/v11.1.0/gt-gen-simulator-v11.1.0.tar.gz" -GTGEN_VERSION="v11.1.0" -GTGEN_CLI_PATH="$GTGEN_DIR/gt-gen-simulator-v11.1.0/bazel-out/k8-opt/bin/Cli" +GTGEN_VERSION="add-new-commandline-parameters" +GTGEN_URL="https://gitlab.eclipse.org/eclipse/openpass/gt-gen-simulator/-/archive/${GTGEN_VERSION}/gt-gen-simulator-${GTGEN_VERSION}.tar.gz" +GTGEN_CLI_PATH="$GTGEN_DIR/gt-gen-simulator-${GTGEN_VERSION}/bazel-out/k8-opt/bin/Cli" CACHEDIR=$GTGEN_DIR # This override the cache folder of bazel @@ -40,14 +40,14 @@ export BAZELISK_HOME="${CACHEDIR}" download_gtgen() { echo "============================== Downloading gt-gen-simulator ==============================" wget $GTGEN_URL || { echo "Unable to download gt-gen-simulator"; exit 1; } - tar -xzvf gt-gen-simulator-v11.1.0.tar.gz || { echo "Unable to checkout $GTGEN_VERSION"; exit 1; } + tar -xzvf gt-gen-simulator-${GTGEN_VERSION}.tar.gz || { echo "Unable to checkout $GTGEN_VERSION"; exit 1; } echo "============================== Cloning Successful ==============================" } #build gtgen build_gtgen() { echo "============================== Building gt-gen-simulator ==============================" - cd "$GTGEN_DIR"/gt-gen-simulator-v11.1.0 || { echo "Unable to change directory into gt-gen-simulator"; exit 1; } + cd "$GTGEN_DIR"/gt-gen-simulator-${GTGEN_VERSION} || { echo "Unable to change directory into gt-gen-simulator"; exit 1; } bazel build --config=gt_gen_release //Cli/... //Simulator/... || { echo "Unable to build gt-gen-simulator"; exit 1; } echo "============================== Extraction Successful ==============================" } diff --git a/utils/ci/scripts/pull_gecco.sh b/utils/ci/scripts/pull_gecco.sh index f16abe35d5fe50ecae4dae56206cc548ad3aa09a..19b68158d7797dc175618b2fbec065790cbfb9ad 100755 --- a/utils/ci/scripts/pull_gecco.sh +++ b/utils/ci/scripts/pull_gecco.sh @@ -25,15 +25,12 @@ fi mkdir -p "$GECCO_DIR" && cd "$GECCO_DIR" || exit 1 rm -rf -- * || { echo "Failed to clean $GECCO_DIR directory"; exit 1; } -# ToDo: Make it generic -GECCO_BIN="https://ci.eclipse.org/openpass/job/gecco/job/use-protobuf-5.26/5/artifact/artifacts/gecco.tar.gz" - -GECCO_FILE=$(basename "$GECCO_BIN") +GECCO_FILE=$(basename "$GECCO_URL") #download gecco download_gecco() { echo "============================== Downloading $GECCO_FILE ==============================" - wget --no-check-certificate "${GECCO_BIN}" || { echo "Unable to download $GECCO_FILE"; exit 1; } + wget --no-check-certificate "${GECCO_URL}" || { echo "Unable to download $GECCO_FILE"; exit 1; } echo "============================== Download Successful ==============================" } diff --git a/utils/ci/scripts/pull_gtgen.sh b/utils/ci/scripts/pull_gtgen.sh index 6f38088176884a849d623e3b2fd8d0e13632d12a..d265013ee35f715adaebde5177531b5dcbab34ee 100755 --- a/utils/ci/scripts/pull_gtgen.sh +++ b/utils/ci/scripts/pull_gtgen.sh @@ -16,27 +16,23 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #ToDo: Set this variable at the top level -if [[ -z "${OP_GTGEN_CLI_DIR}" ]]; then +if [[ -z "${OP_GTGEN_DIR}" ]]; then # If not defined, set a default value - OP_GTGEN_CLI_DIR="$SCRIPT_DIR/../../../../gtgen_cli" - echo "WARN: OP_GTGEN_CLI_DIR variable is not set. Setting it to: - OP_GTGEN_CLI_DIR is ${OP_GTGEN_CLI_DIR}" + OP_GTGEN_DIR="$SCRIPT_DIR/../../../../gtgen_cli" + echo "WARN: OP_GTGEN_DIR variable is not set. Setting it to: + OP_GTGEN_DIR is ${OP_GTGEN_DIR}" fi -mkdir -p "$OP_GTGEN_CLI_DIR" && cd "$OP_GTGEN_CLI_DIR" || exit 1 -rm -rf -- * || { echo "Failed to clean $OP_GTGEN_CLI_DIR directory"; exit 1; } +mkdir -p "$OP_GTGEN_DIR" && cd "$OP_GTGEN_DIR" || exit 1 +rm -rf -- * || { echo "Failed to clean $OP_GTGEN_DIR directory"; exit 1; } -# ToDo: Make it generic -GTGEN_CORE_URL="https://ci.eclipse.org/openpass/job/GT-Gen-Simulator-PreMerge-Gate/job/main/lastSuccessfulBuild/artifact/artifacts/gtgen-simulator_11.1.0_amd64.deb" -GTGEN_CLI_URL="https://ci.eclipse.org/openpass/job/GT-Gen-Simulator-PreMerge-Gate/job/main/lastSuccessfulBuild/artifact/artifacts/gtgen-cli_1.1.0_amd64.deb" - -GTGEN_CORE_FILE=$(basename "$GTGEN_CORE_URL") +GTGEN_SIM_FILE=$(basename "$GTGEN_SIM_URL") GTGEN_CLI_FILE=$(basename "$GTGEN_CLI_URL") #download gtgen_core and gtgen_cli download_deb() { - echo "============================== Downloading $GTGEN_CORE_FILE ==============================" - wget --no-check-certificate "${GTGEN_CORE_URL}" || { echo "Unable to download gtgen core $GTGEN_CORE_FILE from ddad artifactory"; exit 1; } + echo "============================== Downloading $GTGEN_SIM_FILE ==============================" + wget --no-check-certificate "${GTGEN_SIM_URL}" || { echo "Unable to download gtgen core $GTGEN_SIM_FILE from ddad artifactory"; exit 1; } echo "============================== Download Successful ==============================" echo "============================== Downloading $GTGEN_CLI_FILE ==============================" wget --no-check-certificate "${GTGEN_CLI_URL}" || { echo "Unable to download gtgen cli $GTGEN_CLI_FILE from ddad artifactory"; exit 1; } @@ -45,19 +41,19 @@ download_deb() { #Installs gtgen_core and gtgen_cli install_deb() { - echo "============================== Installing $GTGEN_CORE_FILE ==============================" - dpkg-deb -X ./"$GTGEN_CORE_FILE" "$OP_GTGEN_CLI_DIR" || { echo "Unable to install gtgen simulator $GTGEN_CORE_FILE package"; exit 1; } + echo "============================== Installing $GTGEN_SIM_FILE ==============================" + dpkg-deb -X ./"$GTGEN_SIM_FILE" "$OP_GTGEN_DIR" || { echo "Unable to install gtgen simulator $GTGEN_SIM_FILE package"; exit 1; } echo "============================== Installation Successful ==============================" - echo "============================== Installing $GTGEN_CORE_FILE ==============================" - dpkg-deb -X ./"$GTGEN_CLI_FILE" "$OP_GTGEN_CLI_DIR" || { echo "Unable to install gtgen cli $GTGEN_CLI_FILE package"; exit 1; } + echo "============================== Installing $GTGEN_SIM_FILE ==============================" + dpkg-deb -X ./"$GTGEN_CLI_FILE" "$OP_GTGEN_DIR" || { echo "Unable to install gtgen cli $GTGEN_CLI_FILE package"; exit 1; } echo "============================== Installation Successful ==============================" } install_and_verify_deb() { download_deb install_deb - mv "$OP_GTGEN_CLI_DIR"/opt/gtgen_cli/* . || { echo "Unable to move gtgen cli to $OP_GTGEN_CLI_DIR directory"; exit 1; } - mv "$OP_GTGEN_CLI_DIR"/opt/gtgen_core/lib/* . || { echo "Unable to move gtgen core to $OP_GTGEN_CLI_DIR directory"; exit 1; } + mv "$OP_GTGEN_DIR"/opt/gtgen_cli/* . || { echo "Unable to move gtgen cli to $OP_GTGEN_DIR directory"; exit 1; } + mv "$OP_GTGEN_DIR"/opt/gtgen_core/lib/* . || { echo "Unable to move gtgen core to $OP_GTGEN_DIR directory"; exit 1; } ./gtgen_cli -v || { echo "Unable to execute gtgen cli with '-v' option"; exit 1; } } diff --git a/utils/ci/scripts/pull_optestrunner.sh b/utils/ci/scripts/pull_optestrunner.sh index ce19fb27f1781ada47dc381f934caf805cdcf8b6..ec5469fd7a03a103a56cd29996a85057ed3b6a33 100755 --- a/utils/ci/scripts/pull_optestrunner.sh +++ b/utils/ci/scripts/pull_optestrunner.sh @@ -27,16 +27,13 @@ fi mkdir -p "$OP_TESTRUNNER_DIR" && cd "$OP_TESTRUNNER_DIR" || exit 1 rm -rf -- * || { echo "Failed to clean $OP_TESTRUNNER_DIR directory"; exit 1; } -# ToDo: Make it generic -OP_TESTRUNNER_URL="https://download.eclipse.org/openpass/snapshots/opTestrunner/pytest_optestrunner-1.1-py3-none-any.whl" -# OP_TESTRUNNER_URL="https://ci.eclipse.org/openpass/job/opTestrunner/view/change-requests/job/MR-4/lastSuccessfulBuild/artifact/repo/plugin/optestrunner/dist/pytest_optestrunner-1.1-py3-none-any.whl" echo "Python virtual environment (.env) is being created at ${OP_REPO_DIR}" "${PYTHON_EXECUTABLE}" -m venv "${OP_REPO_DIR}/.env" venv_python_executable="${OP_REPO_DIR}/.env/bin/python3" "${venv_python_executable}" -m pip install --upgrade pip -"${venv_python_executable}" -m pip install "${OP_TESTRUNNER_URL}" || { echo "Failed to install dependencies"; exit 1; } +"${venv_python_executable}" -m pip install "${OPTESTRUNNER_URL}" || { echo "Failed to install dependencies"; exit 1; } echo "Following packages are installed successfully in the virtual environment at ${OP_REPO_DIR}/.env." diff --git a/utils/ci/scripts/run_gtgen.sh b/utils/ci/scripts/run_gtgen.sh new file mode 100755 index 0000000000000000000000000000000000000000..d978b5d754c794dada913020307f823695764cb3 --- /dev/null +++ b/utils/ci/scripts/run_gtgen.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +################################################################################ +# Copyright (c) 2025 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# SPDX-License-Identifier: EPL-2.0 +################################################################################ + +################################################################################ +# This Script runs gtgen with common configs +################################################################################ + +if [[ "$(uname)" != "Linux" ]]; then + echo "Skipping E2E tests on non-Linux platform" + exit 0 +fi +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +OP_REPO_DIR="${OP_REPO_DIR:=$SCRIPT_DIR/../../..}" + +if [[ -z "${GECCO_DIR}" ]]; then + # If not defined, set a default value + GTGEN_DIR="$SCRIPT_DIR/../../../../gtgen_cli" + GECCO_DIR="$SCRIPT_DIR/../../../../gecco" + echo "WARN: GECCO_DIR variable is not set. Setting it to: + GECCO_DIR is ${GECCO_DIR}" +fi + +mkdir -p "$SCRIPT_DIR/../../../../artifacts" || exit 1 +mkdir -p "$SCRIPT_DIR"/../../../../artifacts/config_output || exit 1 + +GTGEN_VERSION="add-new-commandline-parameters" +GTGEN_CLI_PATH="$GTGEN_DIR/gt-gen-simulator-${GTGEN_VERSION}/bazel-out/k8-opt/bin/Cli" +CONFIGS_PATH="$OP_REPO_DIR/sim/contrib/examples/Common" + +"${GTGEN_CLI_PATH}/gtgen_cli" -t 100 -s Scenario.xosc -d "${CONFIGS_PATH}" || exit 1; \ No newline at end of file