Skip to content

Commit f3df4b8

Browse files
tests: support sqlite3 version 3.46.0+
* Closes #6630 * Fixes SQL statements in functional tests to recent changes in sqlite3.
1 parent e585631 commit f3df4b8

26 files changed

+41
-41
lines changed

tests/flakyfunctional/database/00-simple.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ cmp_ok "${NAME}" "${SORTED_ORIG}"
3838

3939
NAME='select-workflow-params.out'
4040
sqlite3 "${DB_FILE}" \
41-
'SELECT key, value FROM workflow_params
42-
WHERE key != "uuid_str" AND key != "cycle_point_tz" ORDER BY key' \
41+
"SELECT key, value FROM workflow_params
42+
WHERE key != 'uuid_str' AND key != 'cycle_point_tz' ORDER BY key" \
4343
>"${NAME}"
4444
cmp_ok "${NAME}" << __EOF__
4545
UTC_mode|0

tests/flakyfunctional/hold-release/15-hold-after.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ run_ok "${TEST_NAME_BASE}-validate" cylc validate "${WORKFLOW_NAME}"
2727
workflow_run_ok "${TEST_NAME_BASE}-1" \
2828
cylc play --reference-test --debug --no-detach "${WORKFLOW_NAME}"
2929
sqlite3 "${WORKFLOW_RUN_DIR}/log/db" \
30-
'SELECT cycle, name, status FROM task_pool WHERE cycle=="20140102T0000Z" ORDER BY name' \
30+
"SELECT cycle, name, status FROM task_pool WHERE cycle=='20140102T0000Z' ORDER BY name" \
3131
>'taskpool.out'
3232
cmp_ok 'taskpool.out' <<'__OUT__'
3333
20140102T0000Z|foo|waiting

tests/flakyfunctional/job-submission/19-chatty.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ done
7070
# Task pool in database contains the correct states
7171
TEST_NAME="${TEST_NAME_BASE}-db-task-pool"
7272
DB_FILE="${WORKFLOW_RUN_DIR}/log/db"
73-
QUERY='SELECT cycle, name, status FROM task_states WHERE name LIKE "nh%"'
73+
QUERY="SELECT cycle, name, status FROM task_states WHERE name LIKE 'nh%'"
7474
run_ok "$TEST_NAME" sqlite3 "$DB_FILE" "$QUERY"
7575
sort "${TEST_NAME}.stdout" > "${TEST_NAME}.stdout.sorted"
7676
cmp_ok "${TEST_NAME}.stdout.sorted" << '__OUT__'

tests/flakyfunctional/restart/46-stop-clock-time.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
dumpdbtables() {
2323
sqlite3 "${WORKFLOW_RUN_DIR}/log/db" \
24-
'SELECT * FROM workflow_params WHERE key=="stop_clock_time";' \
24+
"SELECT * FROM workflow_params WHERE key=='stop_clock_time';" \
2525
>'stopclocktime.out'
2626
}
2727

tests/functional/cylc-poll/11-event-time.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ workflow_run_ok "${TEST_NAME_BASE}" \
2727

2828
RUND="$RUN_DIR/${WORKFLOW_NAME}"
2929
sed -n 's/CYLC_JOB_EXIT_TIME=//p' "${RUND}/log/job/1/w1/NN/job.status" >'st-time.txt'
30-
sqlite3 "${RUND}/log/db" '
30+
sqlite3 "${RUND}/log/db" "
3131
SELECT time_run_exit FROM task_jobs
32-
WHERE cycle=="1" AND name=="w1" AND submit_num=="1"' >'db-time.txt'
32+
WHERE cycle=='1' AND name=='w1' AND submit_num=='1'" >'db-time.txt'
3333
run_ok "${TEST_NAME_BASE}-time-run-exit" diff -u 'st-time.txt' 'db-time.txt'
3434

3535
purge

tests/functional/cylc-set/00-set-succeeded.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ reftest_run
2828
for TASK in foo bar
2929
do
3030
sqlite3 ~/cylc-run/"${WORKFLOW_NAME}"/log/db \
31-
"SELECT status FROM task_states WHERE name is \"$TASK\"" > "${TASK}.1"
31+
"SELECT status FROM task_states WHERE name is '$TASK'" > "${TASK}.1"
3232

3333
cmp_ok ${TASK}.1 - <<<succeeded
3434

3535
sqlite3 ~/cylc-run/"${WORKFLOW_NAME}"/log/db \
36-
"SELECT outputs FROM task_outputs WHERE name is \"$TASK\"" > "${TASK}.2"
36+
"SELECT outputs FROM task_outputs WHERE name is '$TASK'" > "${TASK}.2"
3737

3838
cmp_json \
3939
"check-${TASK}-outputs" \

tests/functional/cylc-set/03-set-failed.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ cylc stop --now --now --interval=2 --max-polls=5 "${WORKFLOW_NAME}"
4242

4343
# Check the DB records all the outputs.
4444
sqlite3 ~/cylc-run/"${WORKFLOW_NAME}"/log/db \
45-
"SELECT outputs FROM task_outputs WHERE name is \"foo\"" > db-foo.1
45+
"SELECT outputs FROM task_outputs WHERE name is 'foo'" > db-foo.1
4646

4747
# Json string list of outputs from the db may not be ordered correctly.
4848
python3 - << __END__ > db-foo.2

tests/functional/cylc-set/04-switch.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ reftest_run
2828
# The branch-point task foo should be recorded as succeeded.
2929

3030
sqlite3 ~/cylc-run/"${WORKFLOW_NAME}"/log/db \
31-
"SELECT status FROM task_states WHERE name is \"foo\"" > db-foo.2
31+
"SELECT status FROM task_states WHERE name is 'foo'" > db-foo.2
3232

3333
cmp_ok "db-foo.2" - << __OUT__
3434
succeeded
@@ -40,7 +40,7 @@ __OUT__
4040
# submitted, started
4141

4242
sqlite3 ~/cylc-run/"${WORKFLOW_NAME}"/log/db \
43-
"SELECT outputs FROM task_outputs WHERE name is \"foo\"" > db-foo.1
43+
"SELECT outputs FROM task_outputs WHERE name is 'foo'" > db-foo.1
4444

4545
# Json string list of outputs from the db may not be ordered correctly.
4646
python3 - << __END__ > db-foo.2

tests/functional/cylc-set/05-expire.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ install_and_validate
2626
reftest_run
2727

2828
sqlite3 ~/cylc-run/"${WORKFLOW_NAME}"/log/db \
29-
"SELECT status FROM task_states WHERE name is \"bar\"" > db-bar.1
29+
"SELECT status FROM task_states WHERE name is 'bar'" > db-bar.1
3030

3131
cmp_ok "db-bar.1" - << __OUT__
3232
expired
3333
__OUT__
3434

3535
sqlite3 ~/cylc-run/"${WORKFLOW_NAME}"/log/db \
36-
"SELECT outputs FROM task_outputs WHERE name is \"bar\"" > db-bar.2
36+
"SELECT outputs FROM task_outputs WHERE name is 'bar'" > db-bar.2
3737

3838
cmp_ok "db-bar.2" - << __OUT__
3939
{"expired": "(manually completed)"}

tests/functional/database/06-task-message.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ workflow_run_ok "${TEST_NAME_BASE}-run" \
2727
DB_FILE="$RUN_DIR/${WORKFLOW_NAME}/log/db"
2828

2929
NAME='select-task-events.out'
30-
sqlite3 "${DB_FILE}" '
30+
sqlite3 "${DB_FILE}" "
3131
SELECT
3232
cycle, name, event, message
3333
FROM
3434
task_events
3535
WHERE
36-
event GLOB "message *"
36+
event GLOB 'message *'
3737
ORDER BY
3838
event
39-
' >"${NAME}"
39+
" >"${NAME}"
4040
cmp_ok "${NAME}" <<'__SELECT__'
4141
1|t1|message critical|You are being critical
4242
1|t1|message info|You are normal

0 commit comments

Comments
 (0)