Skip to content

Commit

Permalink
Update tests/functional/cylc-set/00-set-succeeded.t
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Pillinger <[email protected]>
  • Loading branch information
hjoliver and wxtim authored Jan 25, 2024
1 parent e362ea9 commit a2ae736
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions tests/functional/cylc-set/00-set-succeeded.t
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,15 @@ do
sqlite3 ~/cylc-run/"${WORKFLOW_NAME}"/log/db \
"SELECT status FROM task_states WHERE name is \"$TASK\"" > "${TASK}.1"

cmp_ok ${TASK}.1 - << __OUT__
succeeded
__OUT__
cmp_ok ${TASK}.1 - <<<succeeded

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

# Json string list of outputs from the db may not be ordered correctly.
# E.g., '["submitted", "started", "succeeded", "failed"]'.
python3 - << __END__ > "${TASK}.3"
import json
with open("${TASK}.2", 'r') as f:
print(
','.join(
sorted(
json.load(f)
)
)
)
__END__

cmp_ok "${TASK}.3" - << __OUT__
failed,started,submitted,succeeded
__OUT__
cmp_json \
"check-${TASK}-outputs" \
"${TASK}.2" \
"${TASK}.2"<<<'["submitted", "started", "succeeded", "hello"]'

done
purge

0 comments on commit a2ae736

Please sign in to comment.