Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci-benchmark: switch final checks #638

Merged
merged 1 commit into from
Oct 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions benchmarker/scripts/ci-benchmark
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ if ! curl -s -o /dev/null "$serverUrl"; then
fail_job
fi

log 'Checking open DB query count...'
timeout 120 bash -c "cd ..; while ! node lib/bin/check-open-db-queries.js; do sleep 1; done"

log 'Checking backend is serving requests...'
responseLog="$(mktemp)"
requestBody='{"email":"'"$userEmail"'","password":"'"$userPassword"'"}'
loginStatus="$(curl -s -o "$responseLog" -w '%{http_code}' \
--header 'Content-Type: application/json' --data "$requestBody" \
"$serverUrl/v1/sessions"
)"
if [[ "$loginStatus" = "200" ]]; then
log 'Backend survived; job should pass.'
else
if [[ "$loginStatus" != "200" ]]; then
log 'Backend behaving badly:'
log "$(cat "$responseLog")"
fail_job
fi

log 'Checking open DB query count...'
timeout 120 bash -c "cd ..; while ! node lib/bin/check-open-db-queries.js; do sleep 1; done"
log 'Backend survived; job passed.'

# TODO upload results to getodk.cloud for graphing. Include:
#
Expand Down