diff --git a/ci-operator/step-registry/openshift-qe/orion/openshift-qe-orion-commands.sh b/ci-operator/step-registry/openshift-qe/orion/openshift-qe-orion-commands.sh index 317b5d36161a6..8796fc6a82f22 100755 --- a/ci-operator/step-registry/openshift-qe/orion/openshift-qe-orion-commands.sh +++ b/ci-operator/step-registry/openshift-qe/orion/openshift-qe-orion-commands.sh @@ -42,18 +42,19 @@ esac export ES_SERVER pip install . -EXTRA_FLAGS=" --lookback ${LOOKBACK}d --hunter-analyze" + +EXTRA_FLAGS=(--lookback "${LOOKBACK}d" --hunter-analyze) if [[ ! -z "$UUID" ]]; then - EXTRA_FLAGS+=" --uuid ${UUID}" + EXTRA_FLAGS+=(--uuid "${UUID}") fi if [ ${OUTPUT_FORMAT} == "JUNIT" ]; then - EXTRA_FLAGS+=" --output-format junit --save-output-path=junit.xml" + EXTRA_FLAGS+=(--output-format junit --save-output-path junit.xml) elif [ "${OUTPUT_FORMAT}" == "JSON" ]; then - EXTRA_FLAGS+=" --output-format json" + EXTRA_FLAGS+=(--output-format json) elif [ "${OUTPUT_FORMAT}" == "TEXT" ]; then - EXTRA_FLAGS+=" --output-format text" + EXTRA_FLAGS+=(--output-format text) else echo "Unsupported format: ${OUTPUT_FORMAT}" exit 1 @@ -86,11 +87,11 @@ if [[ -n "$ACK_FILE" ]]; then ackFilePath="$ARTIFACT_DIR/$ACK_FILE" curl -sL https://raw.githubusercontent.com/cloud-bulldozer/orion/refs/heads/main/ack/${VERSION}_${ACK_FILE} -o "$ackFilePath" fi - EXTRA_FLAGS+=" --ack $ackFilePath" + EXTRA_FLAGS+=(--ack "$ackFilePath") fi if [ ${COLLAPSE} == "true" ]; then - EXTRA_FLAGS+=" --collapse" + EXTRA_FLAGS+=(--collapse) fi if [[ -n "${ORION_ENVS}" ]]; then @@ -105,16 +106,25 @@ if [[ -n "${ORION_ENVS}" ]]; then fi if [[ -n "${LOOKBACK_SIZE}" ]]; then - EXTRA_FLAGS+=" --lookback-size ${LOOKBACK_SIZE}" + EXTRA_FLAGS+=(--lookback-size "${LOOKBACK_SIZE}") +fi + +if [[ -n "${PULL_NUMBER}" ]]; then + JOBTYPE="pull" + EXTRA_FLAGS+=(--input-vars "{\"jobtype\": \"${JOBTYPE}\", \"pull_number\": \"${PULL_NUMBER}\", \"organization\": \"openshift\", \"repository\": \"${REPO_NAME}\"}") +else + JOBTYPE="periodic" fi set +e set -o pipefail FILENAME=$(echo $CONFIG | awk -F/ '{print $2}' | awk -F. '{print $1}') -es_metadata_index=${ES_METADATA_INDEX} es_benchmark_index=${ES_BENCHMARK_INDEX} VERSION=${VERSION} jobtype="periodic" orion --node-count ${IGNORE_JOB_ITERATIONS} --config ${CONFIG} ${EXTRA_FLAGS} | tee ${ARTIFACT_DIR}/$FILENAME.txt +es_metadata_index=${ES_METADATA_INDEX} es_benchmark_index=${ES_BENCHMARK_INDEX} VERSION=${VERSION} jobtype="${JOBTYPE}" \ + orion --node-count ${IGNORE_JOB_ITERATIONS} --config ${CONFIG} "${EXTRA_FLAGS[@]}" | tee ${ARTIFACT_DIR}/$FILENAME.txt orion_exit_status=$? set -e cp *.csv *.xml *.json *.txt "${ARTIFACT_DIR}/" 2>/dev/null || true exit $orion_exit_status + diff --git a/ci-operator/step-registry/openshift-qe/orion/openshift-qe-orion-ref.yaml b/ci-operator/step-registry/openshift-qe/orion/openshift-qe-orion-ref.yaml index a7376ee4fe599..c0ff487cfbc23 100644 --- a/ci-operator/step-registry/openshift-qe/orion/openshift-qe-orion-ref.yaml +++ b/ci-operator/step-registry/openshift-qe/orion/openshift-qe-orion-ref.yaml @@ -74,6 +74,14 @@ ref: default: "" documentation: Comma separated list of envs that needs to exported in runtime for templated configurations. + - name: PULL_NUMBER + default: "" + documentation: | + Pull request number associated with the current job run. + - name: REPO_NAME + default: "" + documentation: | + Name of the GitHub repository under test. commands: openshift-qe-orion-commands.sh timeout: 6h credentials: