|
1 | 1 | #!/bin/bash |
2 | 2 |
|
3 | | -# -------------------------------------------- |
4 | | -# Options that must be configured by app owner |
5 | | -# -------------------------------------------- |
6 | | -export APP_NAME="ros" # name of app-sre "application" folder this component lives in |
7 | | -export COMPONENT_NAME="ros-backend" # name of app-sre "resourceTemplate" in deploy.yaml for this component |
| 3 | +export APP_NAME="ros" |
| 4 | +export COMPONENT_NAME="ros-backend" |
8 | 5 | export COMPONENTS="ros-backend" |
9 | 6 | export IMAGE="quay.io/cloudservices/ros-backend" |
10 | 7 | export DOCKERFILE="Dockerfile" |
11 | 8 |
|
12 | | -# NEW: Dual backend testing logic based on job name |
13 | 9 | echo "JOB_NAME: $JOB_NAME" |
| 10 | +echo "GitHub Comment: $ghprbCommentBody" |
14 | 11 |
|
15 | | -if [[ "$JOB_NAME" == *"ros-backend-v1-pr-tests"* ]]; then |
16 | | - # Old backend testing configuration |
| 12 | +if [[ "$ghprbCommentBody" == *"[test-backend-v1]"* ]]; then |
17 | 13 | export ROS_BACKEND_V2_FLAG_ENABLED="false" |
18 | 14 | export IQE_MARKER_EXPRESSION="ros_smoke and insights_ros_v1" |
19 | 15 | export IBUTSU_SOURCE="ros-backend-v1-pr" |
20 | | - echo " Configured for OLD backend testing" |
| 16 | + echo "Configured for v1 backend testing" |
21 | 17 | echo " - Unleash flag will be set to: FALSE" |
22 | 18 | echo " - Test markers: ros_smoke and insights_ros_v1" |
23 | | -elif [[ "$JOB_NAME" == *"ros-backend-v2-pr-tests"* ]]; then |
24 | | - # New backend testing configuration |
| 19 | +elif [[ "$ghprbCommentBody" == *"[test-backend-v2]"* ]]; then |
25 | 20 | export ROS_BACKEND_V2_FLAG_ENABLED="true" |
26 | 21 | export IQE_MARKER_EXPRESSION="ros_smoke and insights_ros_v2" |
27 | 22 | export IBUTSU_SOURCE="ros-backend-v2-pr" |
28 | | - echo " Configured for NEW backend testing" |
| 23 | + echo "Configured for v2 backend testing" |
29 | 24 | echo " - Unleash flag will be set to: TRUE" |
30 | 25 | echo " - Test markers: ros_smoke and insights_ros_v2" |
| 26 | +else |
| 27 | + export IQE_MARKER_EXPRESSION="" |
| 28 | + export IBUTSU_SOURCE="ros-backend-pr" |
| 29 | + echo "Normal PR check configuration" |
31 | 30 | fi |
32 | 31 |
|
33 | | -# Standard IQE configuration |
34 | 32 | export IQE_PLUGINS="ros" |
35 | 33 | export IQE_FILTER_EXPRESSION="" |
36 | 34 | export IQE_CJI_TIMEOUT="30m" |
37 | 35 |
|
38 | | -# CRITICAL: Pass ROS_BACKEND_V2_FLAG_ENABLED to IQE via IQE_ENV_VARS |
39 | | -export IQE_ENV_VARS="JOB_NAME=${JOB_NAME},BUILD_NUMBER=${BUILD_NUMBER},BUILD_URL=${BUILD_URL},ROS_BACKEND_V2_FLAG_ENABLED=${ROS_BACKEND_V2_FLAG_ENABLED}" |
| 36 | +export IQE_ENV_VARS="JOB_NAME=${JOB_NAME},BUILD_NUMBER=${BUILD_NUMBER},BUILD_URL=${BUILD_URL}" |
40 | 37 |
|
41 | | -echo " Final Configuration:" |
| 38 | +if [[ -n "$ROS_BACKEND_V2_FLAG_ENABLED" ]]; then |
| 39 | + export IQE_ENV_VARS="${IQE_ENV_VARS},ROS_BACKEND_V2_FLAG_ENABLED=${ROS_BACKEND_V2_FLAG_ENABLED}" |
| 40 | +fi |
| 41 | + |
| 42 | +echo "Final Configuration:" |
42 | 43 | echo " IQE_MARKER_EXPRESSION: $IQE_MARKER_EXPRESSION" |
43 | 44 | echo " IBUTSU_SOURCE: $IBUTSU_SOURCE" |
44 | 45 | echo " IQE_ENV_VARS: $IQE_ENV_VARS" |
45 | 46 |
|
46 | | -# Install bonfire repo/initialize |
47 | 47 | CICD_URL=https://raw.githubusercontent.com/RedHatInsights/bonfire/master/cicd |
48 | 48 | curl -s $CICD_URL/bootstrap.sh > .cicd_bootstrap.sh && source .cicd_bootstrap.sh |
49 | 49 |
|
50 | 50 | source $CICD_ROOT/build.sh |
51 | | - |
52 | | -# Deploy ros to an ephemeral namespace for testing |
53 | 51 | source $CICD_ROOT/deploy_ephemeral_env.sh |
54 | | - |
55 | | -# Run iqe-ros smoke tests with ClowdJobInvocation |
56 | 52 | source $CICD_ROOT/cji_smoke_test.sh |
0 commit comments