Skip to content

Commit ead0834

Browse files
Saurabh Pimpalgaokarupadhyeammit
authored andcommitted
Checking prcomments instead of job name
1 parent 83ce919 commit ead0834

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

pr_check.sh

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,52 @@
11
#!/bin/bash
22

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"
85
export COMPONENTS="ros-backend"
96
export IMAGE="quay.io/cloudservices/ros-backend"
107
export DOCKERFILE="Dockerfile"
118

12-
# NEW: Dual backend testing logic based on job name
139
echo "JOB_NAME: $JOB_NAME"
10+
echo "GitHub Comment: $ghprbCommentBody"
1411

15-
if [[ "$JOB_NAME" == *"ros-backend-v1-pr-tests"* ]]; then
16-
# Old backend testing configuration
12+
if [[ "$ghprbCommentBody" == *"[test-backend-v1]"* ]]; then
1713
export ROS_BACKEND_V2_FLAG_ENABLED="false"
1814
export IQE_MARKER_EXPRESSION="ros_smoke and insights_ros_v1"
1915
export IBUTSU_SOURCE="ros-backend-v1-pr"
20-
echo " Configured for OLD backend testing"
16+
echo "Configured for v1 backend testing"
2117
echo " - Unleash flag will be set to: FALSE"
2218
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
2520
export ROS_BACKEND_V2_FLAG_ENABLED="true"
2621
export IQE_MARKER_EXPRESSION="ros_smoke and insights_ros_v2"
2722
export IBUTSU_SOURCE="ros-backend-v2-pr"
28-
echo " Configured for NEW backend testing"
23+
echo "Configured for v2 backend testing"
2924
echo " - Unleash flag will be set to: TRUE"
3025
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"
3130
fi
3231

33-
# Standard IQE configuration
3432
export IQE_PLUGINS="ros"
3533
export IQE_FILTER_EXPRESSION=""
3634
export IQE_CJI_TIMEOUT="30m"
3735

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}"
4037

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:"
4243
echo " IQE_MARKER_EXPRESSION: $IQE_MARKER_EXPRESSION"
4344
echo " IBUTSU_SOURCE: $IBUTSU_SOURCE"
4445
echo " IQE_ENV_VARS: $IQE_ENV_VARS"
4546

46-
# Install bonfire repo/initialize
4747
CICD_URL=https://raw.githubusercontent.com/RedHatInsights/bonfire/master/cicd
4848
curl -s $CICD_URL/bootstrap.sh > .cicd_bootstrap.sh && source .cicd_bootstrap.sh
4949

5050
source $CICD_ROOT/build.sh
51-
52-
# Deploy ros to an ephemeral namespace for testing
5351
source $CICD_ROOT/deploy_ephemeral_env.sh
54-
55-
# Run iqe-ros smoke tests with ClowdJobInvocation
5652
source $CICD_ROOT/cji_smoke_test.sh

0 commit comments

Comments
 (0)