Skip to content

Commit

Permalink
added deprecation tests for simple cylc-8 deprecations [task][job]ite…
Browse files Browse the repository at this point in the history
…m -> [task]item
  • Loading branch information
wxtim committed Jan 16, 2020
1 parent e32664b commit a040fad
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 39 deletions.
5 changes: 0 additions & 5 deletions cylc/flow/cfgspec/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@
},
},
}
# - allowed_2, ...: the only other allowed values of this setting (optional).


def upg(cfg, descr):
Expand Down Expand Up @@ -302,8 +301,6 @@ def upg(cfg, descr):
['cylc', 'abort if any task fails'],
['cylc', 'events', 'abort if any task fails'])
u.obsolete('8.0.0', ['runtime', '__MANY__', 'job', 'shell'])
# TODO uncomment these deprecations when ready - see todo in
# [runtime][__MANY__] section.
for job_setting in [
'execution polling intervals',
'execution retry delays',
Expand All @@ -316,8 +313,6 @@ def upg(cfg, descr):
['runtime', '__MANY__', 'job', job_setting],
['runtime', '__MANY__', job_setting]
)
# TODO - there are some simple changes to the config (items from [remote]
# and [job] moved up 1 level for example) which should be upgraded here.
u.upgrade()

# Upgrader cannot do this type of move.
Expand Down
3 changes: 1 addition & 2 deletions flakytests/database/01-broadcast/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ t1:submit => recover-t1
[runtime]
[[t1]]
script=test -n "${HELLO}"
[[[job]]]
execution retry delays=PT10M # prevent task failure
execution retry delays=PT10M # prevent task failure
[[[environment]]]
HELLO=
[[recover-t1]]
Expand Down
3 changes: 1 addition & 2 deletions flakytests/database/02-retry/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
[runtime]
[[t1]]
script=test "${CYLC_TASK_SUBMIT_NUMBER}" -gt 2
[[[job]]]
execution retry delays=2*PT0S
execution retry delays=2*PT0S
6 changes: 2 additions & 4 deletions flakytests/events/01-task/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ do
done
cylc task message -p WARNING 'this is a user-defined warning message'
"""
[[[job]]]
execution retry delays = PT3S
execution retry delays = PT3S
[[[events]]]
succeeded handler = {{ HANDLER }}
warning handler = {{ HANDLER }}
Expand All @@ -56,8 +55,7 @@ cylc task message -p WARNING 'this is a user-defined warning message'
[[[events]]]
submission failed handler = {{ HANDLER }}
submission retry handler = {{ HANDLER }}
[[[job]]]
submission retry delays = PT3S
submission retry delays = PT3S
[[[remote]]]
host = NOHOST.NODOMAIN

Expand Down
5 changes: 2 additions & 3 deletions flakytests/execution-time-limit/04-poll/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@ __STATUS__
fi
exit
"""
[[[job]]]
execution time limit = PT10S
execution retry delays = PT0S
execution time limit = PT10S
execution retry delays = PT0S
3 changes: 1 addition & 2 deletions flakytests/hold-release/14-hold-kill/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@
sleep 120
fi
"""
[[[job]]]
execution retry delays = PT1S
execution retry delays = PT1S
5 changes: 5 additions & 0 deletions tests/deprecations/01-cylc8-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ cmp_ok val.out <<__END__
* (8.0.0) [cylc][reference test][suite shutdown event handler] - DELETED (OBSOLETE)
* (8.0.0) [cylc][abort if any task fails] -> [cylc][events][abort if any task fails] - value unchanged
* (8.0.0) [runtime][foo, cat, dog][job][shell] - DELETED (OBSOLETE)
* (8.0.0) [runtime][foo, cat, dog][job][execution polling intervals] -> [runtime][foo, cat, dog][execution polling intervals] - value unchanged
* (8.0.0) [runtime][foo, cat, dog][job][execution retry delays] -> [runtime][foo, cat, dog][execution retry delays] - value unchanged
* (8.0.0) [runtime][foo, cat, dog][job][execution time limit] -> [runtime][foo, cat, dog][execution time limit] - value unchanged
* (8.0.0) [runtime][foo, cat, dog][job][submission polling intervals] -> [runtime][foo, cat, dog][submission polling intervals] - value unchanged
* (8.0.0) [runtime][foo, cat, dog][job][submission retry delays] -> [runtime][foo, cat, dog][submission retry delays] - value unchanged
__END__

purge_suite "${SUITE_NAME}"
8 changes: 5 additions & 3 deletions tests/deprecations/01-cylc8-basic/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
required run mode =
suite shutdown event handler =


[scheduling]
initial cycle point = 20150808T00
final cycle point = 20150808T00
Expand All @@ -24,5 +23,8 @@
[[foo, cat, dog]]
[[[job]]]
shell = fish


execution polling intervals =
execution retry delays =
execution time limit =
submission polling intervals =
submission retry delays =
3 changes: 1 addition & 2 deletions tests/events/10-task-event-job-logs-retrieve/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
[runtime]
[[t1]]
script=test "${CYLC_TASK_TRY_NUMBER}" -eq 3
[[[job]]]
execution retry delays=PT0S, 2*PT1S
execution retry delays=PT0S, 2*PT1S
[[[remote]]]
host = {{HOST}}
{% if GLOBALCFG is not defined %}
Expand Down
3 changes: 1 addition & 2 deletions tests/events/29-task-event-mail-1/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
[runtime]
[[t1]]
script=test "${CYLC_TASK_TRY_NUMBER}" -eq 2
[[[job]]]
execution retry delays = PT1S
execution retry delays = PT1S
[[[events]]]
mail events = failed, retry
mail smtp = {{MAIL_SMTP}}
3 changes: 1 addition & 2 deletions tests/events/30-task-event-mail-2/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
[runtime]
[[t1, t2, t3, t4, t5]]
script=false
[[[job]]]
execution retry delays = 2*PT20S
execution retry delays = 2*PT20S
[[[events]]]
mail events = failed, retry
mail smtp = {{MAIL_SMTP}}
3 changes: 1 addition & 2 deletions tests/hold-release/11-retrying/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ t-retry-able => t-analyse
# Note under bash 4.2 failed bare arithmetic tests such as
# "(( VAR >= 3 ))" do not cause an abort under 'set -e'.
script = test "${CYLC_TASK_TRY_NUMBER}" -ge 3
[[[job]]]
execution retry delays = PT15S, 2*PT1S
execution retry delays = PT15S, 2*PT1S
[[t-hold-release]]
script = """
cylc__job__poll_grep_suite_log -F \
Expand Down
3 changes: 1 addition & 2 deletions tests/hold-release/12-hold-then-retry/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ t-submit-retry-able:submit => t-hold
false
fi
"""
[[[job]]]
execution retry delays = PT5S
execution retry delays = PT5S
[[t-submit-retry-able]]
env-script = """
if ((CYLC_TASK_SUBMIT_NUMBER == 1)); then
Expand Down
3 changes: 1 addition & 2 deletions tests/job-submission/01-job-nn-localhost/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ NN_VALUE="$(readlink "${JOB_LOG_DIR}/NN")"
test "${CYLC_TASK_SUBMIT_NUMBER}" -eq "100"
test "${NN_VALUE}" -eq "100"
"""
[[[job]]]
execution retry delays=99*PT0S
execution retry delays=99*PT0S
3 changes: 1 addition & 2 deletions tests/job-submission/04-submit-num/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ echo "${CYLC_TASK_SUBMIT_NUMBER}" >>"${CYLC_SUITE_RUN_DIR}/foo-submits.txt"
# bash 4.2.0 bug: ((VAR == VAL)) does not trigger 'set -e':
test "${CYLC_TASK_SUBMIT_NUMBER}" -gt "${CYLC_TASK_TRY_NUMBER}"
"""
[[[job]]]
execution retry delays=2*PT0S
execution retry delays=2*PT0S
[[bar]]
script = """
cylc trigger "${CYLC_SUITE_NAME}" foo 1
Expand Down
3 changes: 1 addition & 2 deletions tests/jobscript/12-err-script/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@
script = test "${CYLC_TASK_SUBMIT_NUMBER}" -ge 2
[[[environment]]]
FOO = foo bar baz qux
[[[job]]]
execution retry delays = PT0S
execution retry delays = PT0S
3 changes: 1 addition & 2 deletions tests/retries/execution/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
[runtime]
[[foo]]
script = test "${CYLC_TASK_TRY_NUMBER}" '-ge' '4'
[[[job]]]
execution retry delays = 3*PT0S
execution retry delays = 3*PT0S

0 comments on commit a040fad

Please sign in to comment.