Skip to content

Commit b3dffda

Browse files
author
Ahmad Shah
committed
migrate perf.send to cedar_report endpoint
1 parent 1c3fdc8 commit b3dffda

File tree

1 file changed

+40
-8
lines changed

1 file changed

+40
-8
lines changed

.evergreen/.evg.yml

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ functions:
256256
. ./activate-authawsvenv.sh
257257
python ./lib/aws_assign_instance_profile.py
258258
fi
259-
259+
260260
"run tests":
261261
- command: shell.exec
262262
type: test
@@ -277,9 +277,9 @@ functions:
277277
AZUREKMS_KEY_NAME: ${testazurekms_keyname}
278278
script: |
279279
${PREPARE_SHELL}
280-
280+
281281
. ${DRIVERS_TOOLS}/.evergreen/csfle/set-temp-creds.sh
282-
282+
283283
export AWS_TEMP_ACCESS_KEY_ID=$CSFLE_AWS_TEMP_ACCESS_KEY_ID
284284
export AWS_TEMP_SECRET_ACCESS_KEY=$CSFLE_AWS_TEMP_SECRET_ACCESS_KEY
285285
export AWS_TEMP_SESSION_TOKEN=$CSFLE_AWS_TEMP_SESSION_TOKEN
@@ -375,7 +375,7 @@ functions:
375375
STREAM_TYPE="netty" AUTH="${AUTH}" SSL="${SSL}" NETTY_SSL_PROVIDER="${NETTY_SSL_PROVIDER}" MONGODB_URI="${MONGODB_URI}" \
376376
TOPOLOGY="${TOPOLOGY}" COMPRESSOR="${COMPRESSOR}" JAVA_VERSION="${JAVA_VERSION}" \
377377
AZUREKMS_KEY_VAULT_ENDPOINT=${testazurekms_keyvaultendpoint} AZUREKMS_KEY_NAME=${testazurekms_keyname} \
378-
.evergreen/run-tests.sh
378+
.evergreen/run-tests.sh
379379
380380
"run plain auth test":
381381
- command: shell.exec
@@ -683,11 +683,11 @@ functions:
683683
script: |
684684
${PREPARE_SHELL}
685685
. ${DRIVERS_TOOLS}/.evergreen/csfle/set-temp-creds.sh
686-
686+
687687
export AWS_TEMP_ACCESS_KEY_ID=$CSFLE_AWS_TEMP_ACCESS_KEY_ID
688688
export AWS_TEMP_SECRET_ACCESS_KEY=$CSFLE_AWS_TEMP_SECRET_ACCESS_KEY
689689
export AWS_TEMP_SESSION_TOKEN=$CSFLE_AWS_TEMP_SESSION_TOKEN
690-
690+
691691
MONGODB_URI="${MONGODB_URI}" JAVA_VERSION="${JAVA_VERSION}" .evergreen/run-csfle-tests-with-mongocryptd.sh
692692
693693
"trace artifacts":
@@ -777,9 +777,41 @@ functions:
777777
PROJECT_DIRECTORY=${PROJECT_DIRECTORY} .evergreen/run-perf-tests.sh
778778
779779
"send dashboard data":
780-
- command: perf.send
780+
- command: shell.exec
781781
params:
782-
file: src/results.json
782+
script: |
783+
if [ "${requester}" == "commit" ]; then
784+
echo "is_mainline: true" >> expansion.yml
785+
else
786+
echo "is_mainline: false" >> expansion.yml
787+
fi
788+
789+
echo "parsed_order_id: $(echo "${revision_order_id}" | awk -F'_' '{print $NF}')" >> expansion.yml
790+
- command: expansions.update
791+
params:
792+
file: expansion.yml
793+
- command: shell.exec
794+
params:
795+
script: |
796+
response=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X 'POST' \
797+
"https://performance-monitoring-api.corp.mongodb.com/raw_perf_results/cedar_report?project=${project_id}&version=${version_id}&variant=${build_variant}&order=${parsed_order_id}&task_name=${task_name}&task_id=${task_id}&execution=${execution}&mainline=${is_mainline}" \
798+
-H 'accept: application/json' \
799+
-H 'Content-Type: application/json' \
800+
-d @src/results.json)
801+
802+
http_status=$(echo "$response" | grep "HTTP_STATUS" | awk -F':' '{print $2}')
803+
response_body=$(echo "$response" | sed '/HTTP_STATUS/d')
804+
805+
# We want to throw an error if the data was not successfully submitted
806+
if [ "$http_status" -ne 200 ]; then
807+
echo "Error: Received HTTP status $http_status"
808+
echo "Response Body: $response_body"
809+
exit 1
810+
fi
811+
812+
echo "Response Body: $response_body"
813+
echo "HTTP Status: $http_status"
814+
add_expansions_to_env: true
783815

784816
"run graalvm native image app":
785817
- command: shell.exec

0 commit comments

Comments
 (0)