/.github/{scripts,workflows}: ensure noms bin format gets sent in payload

This commit is contained in:
coffeegoddd
2022-07-22 10:06:47 -07:00
parent 2c9a75797b
commit 8d4ef5ad58
4 changed files with 17 additions and 61 deletions
@@ -3,7 +3,7 @@
set -e
if [ "$#" -ne 6 ]; then
echo "Usage: ./get-dolt-correctness-job-json.sh <jobname> <fromVersion> <toVersion> <timeprefix> <actorprefix> <format>"
echo "Usage: ./get-dolt-correctness-job-json.sh <jobname> <fromVersion> <toVersion> <timeprefix> <actorprefix> <format> <nomsBinFormat>"
exit 1
fi
@@ -13,9 +13,14 @@ toVersion="$3"
timeprefix="$4"
actorprefix="$5"
format="$6"
nomsBinFormat="$7"
precision="2"
if [ -n "$nomsBinFormat" ]; then
nomsBinFormat="\"--noms-bin-format=$nomsBinFormat\","
fi
resultCountQuery="select result, count(*) as total from results where result != 'skipped' group by result;"
testCountQuery="select count(*) as total_tests from results where result != 'skipped';"
correctnessQuery="select ROUND(100.0 * (cast(ok_results.total as decimal) / (cast(all_results.total as decimal) + .000001)), $precision) as correctness_percentage from (select count(*) as total from results where result = 'ok') as ok_results join (select count(*) as total from results where result != 'skipped') as all_results"
@@ -47,6 +52,7 @@ echo '
"--schema=/correctness.sql",
"--output='$format'",
"--version='$toVersion'",
'"$nomsBinFormat"'
"--bucket=sql-correctness-github-actions-results",
"--region=us-west-2",
"--results-dir='$timeprefix'",
@@ -1,59 +0,0 @@
#!/bin/sh
set -e
if [ "$#" -ne 6 ]; then
echo "Usage: ./get-dolt-regressions-job-json.sh <jobname> <fromVersion> <toVersion> <timeprefix> <actorprefix> <format>"
exit 1
fi
jobname="$1"
fromVersion="$2"
toVersion="$3"
timeprefix="$4"
actorprefix="$5"
format="$6"
regressionsQuery="select count(*) from from_results;"
echo '
{
"apiVersion": "batch/v1",
"kind": "Job",
"metadata": {
"name": "'$jobname'",
"namespace": "sql-correctness"
},
"spec": {
"backoffLimit": 1,
"template": {
"spec": {
"serviceAccountName": "sql-correctness",
"containers": [
{
"name": "sql-correctness",
"image": "407903926827.dkr.ecr.us-west-2.amazonaws.com/liquidata/sql-correctness:latest",
"env": [
{ "name": "REPO_ACCESS_TOKEN", "value": "'$REPO_ACCESS_TOKEN'"},
{ "name": "ACTOR", "value": "'$ACTOR'"},
{ "name": "ACTOR_EMAIL", "value": "'$ACTOR_EMAIL'"}
],
"args": [
"--schema=/regressions.sql",
"--output='$format'",
"--from-version='$fromVersion'",
"--to-version='$toVersion'",
"--bucket=sql-correctness-github-actions-results",
"--region=us-west-2",
"--results-dir='$timeprefix'",
"--results-prefix='$actorprefix'",
"'"$regressionsQuery"'"
]
}
],
"restartPolicy": "Never"
}
}
}
}
'
@@ -60,7 +60,15 @@ if [[ "$MODE" = "release" || "$MODE" = "nightly" ]]; then
format="html"
fi
source "$TEMPLATE_SCRIPT" "$jobname" "$FROM_VERSION" "$TO_VERSION" "$timeprefix" "$actorprefix" "$format" > job.json
source \
"$TEMPLATE_SCRIPT" \
"$jobname" \
"$FROM_VERSION" \
"$TO_VERSION" \
"$timeprefix" \
"$actorprefix" \
"$format" \
"$NOMS_BIN_FORMAT" > job.json
out=$(KUBECONFIG="$KUBECONFIG" kubectl apply -f job.json || true)
@@ -72,6 +72,7 @@ jobs:
with:
region: us-west-2
version: ${{ github.event.client_payload.dolt_version }}
format: ${{ github.event.client_payload.noms_bin_format }}
toAddresses: '["${{ secrets.PERF_REPORTS_EMAIL_ADDRESS }}"]'
dataFile: ${{ format('{0}/results.log', github.workspace) }}
- name: Send Email