Skip to content

Commit

Permalink
documentation: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-sanders committed Jan 31, 2019
1 parent ed95397 commit a907e90
Show file tree
Hide file tree
Showing 17 changed files with 55 additions and 63 deletions.
4 changes: 2 additions & 2 deletions lib/cylc/broadcast_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def put_broadcast(
Return a tuple (modified_settings, bad_options) where:
modified_settings is list of modified settings in the form:
[("20200202", "foo", {"command scripting": "true"}, ...]
[("20200202", "foo", {"script": "true"}, ...]
bad_options is as described in the docstring for self.clear().
"""
modified_settings = []
Expand Down Expand Up @@ -315,7 +315,7 @@ def _prune(self):
Return a list of pruned broadcasts in the form:
[
["20200202", "foo", "command scripting"],
["20200202", "foo", "script"],
["20020202", "bar", "environment", "BAR"],
]
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/cylc/network/httpserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ def put_broadcast(
Return a tuple (modified_settings, bad_options) where:
modified_settings is list of modified settings in the form:
[("20200202", "foo", {"command scripting": "true"}, ...]
[("20200202", "foo", {"script": "true"}, ...]
bad_options is as described in the docstring for self.clear().
"""
self._check_access_priv_and_report(PRIV_FULL_CONTROL)
Expand Down
14 changes: 7 additions & 7 deletions tests/broadcast/03-expire/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ t2[-P5Y] => broadcast-expire
"""
[runtime]
[[broadcast]]
command scripting="""
script="""
cylc broadcast \
-s '[environment]FABRIC=Wool' \
-s "[environment]ORGANISM=sheep" \
Expand All @@ -26,40 +26,40 @@ cylc broadcast \
"${CYLC_SUITE_NAME}" \
| tee 'broadcast.out'
"""
post-command scripting="""
post-script="""
diff -u - 'broadcast.out' <<__OUT__
Broadcast set:
+ [F1.${CYLC_TASK_CYCLE_POINT}] [environment]FABRIC=Wool
+ [F1.${CYLC_TASK_CYCLE_POINT}] [environment]ORGANISM=sheep
__OUT__
"""
[[broadcast-expire]]
command scripting="""
script="""
NEXT_CYCLE_POINT=$(cylc cycletime --offset=P5Y)
cylc broadcast --expire="${NEXT_CYCLE_POINT}" "${CYLC_SUITE_NAME}" \
| tee 'broadcast.out'
"""
post-command scripting="""
post-script="""
diff -u - 'broadcast.out' <<__OUT__
Broadcast cancelled:
- [F1.${CYLC_TASK_CYCLE_POINT}] [environment]FABRIC=Wool
- [F1.${CYLC_TASK_CYCLE_POINT}] [environment]ORGANISM=sheep
__OUT__
"""
[[F1]]
command scripting = """
script = """
echo "${FABRIC} is from ${ORGANISM}." | tee 'echo.out'
"""
[[[environment]]]
FABRIC=Silk
ORGANISM=silk worm
[[t1]]
inherit=F1
post-command scripting="""
post-script="""
diff -u - 'echo.out' <<<'Wool is from sheep.'
"""
[[t2]]
inherit=F1
post-command scripting="""
post-script="""
diff -u - 'echo.out' <<<'Silk is from silk worm.'
"""
4 changes: 2 additions & 2 deletions tests/broadcast/04-empty/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
graph="broadcast => t1"
[runtime]
[[broadcast]]
command scripting="""
script="""
cylc broadcast -s '[environment]EMPTY=' -p '1' -n 't1' "${CYLC_SUITE_NAME}" \
| tee 'broadcast.out'
diff -u - 'broadcast.out' <<__OUT__
Expand All @@ -19,7 +19,7 @@ Broadcast set:
__OUT__
"""
[[t1]]
command scripting = """
script = """
printenv EMPTY | tee 'echo.out'
diff -u - 'echo.out' <<<''
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/broadcast/05-bad-point/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
graph = broadcast
[runtime]
[[broadcast]]
command scripting="""
script="""
# Broadcast to an integer point, not valid for this suite; and
# fail if the broadcast succeeds (it should fail).
! cylc broadcast -s 'title=foo' -p '1' "${CYLC_SUITE_NAME}"
Expand Down
29 changes: 11 additions & 18 deletions tests/cylc-doc/00-cylc-doc.t
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,18 @@
# Test the cylc-doc command on printing cylc URLs.
. $(dirname $0)/test_header
#-------------------------------------------------------------------------------
set_test_number 2
set_test_number 4
#-------------------------------------------------------------------------------
LOCAL="local = ${PWD}/doc/built-sphinx/index.html"
ONLINE='http://cylc.github.io/cylc/doc/built-sphinx/index.html'
create_test_globalrc "" "
[documentation]
[[files]]
html user guides = ${PWD}/doc/built-sphinx/index.html
[[urls]]
internet homepage = http://cylc.github.com/cylc/
local index = http://localhost/cylc/index.html"
#-------------------------------------------------------------------------------
mkdir -p doc/built-sphinx
touch doc/built-sphinx/index.html
cylc doc -s -g > stdout1.txt
cmp_ok stdout1.txt <<__END__
${PWD}/doc/built-sphinx/index.html
__END__
#-------------------------------------------------------------------------------
cylc doc -s > stdout2.txt
cmp_ok stdout2.txt <<__END__
http://localhost/cylc/index.html
__END__
local = ${LOCAL}
online = ${ONLINE}"
#-------------------------------------------------------------------------------
TEST_NAME="${TEST_NAME_BASE}-online"
run_ok "${TEST_NAME}" cylc doc -s
cmp_ok "${TEST_NAME}.stdout" <<< "${ONLINE}"
TEST_NAME="${TEST_NAME_BASE}-local"
run_ok "${TEST_NAME}" cylc doc -s --local
cmp_ok "${TEST_NAME}.stdout" <<< "${LOCAL}"
9 changes: 4 additions & 5 deletions tests/cylc-doc/01-suite-urls.t
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@
#-------------------------------------------------------------------------------
set_test_number 3
#-------------------------------------------------------------------------------
LOCAL="local = ${PWD}/doc/built-sphinx/index.html"
ONLINE='http://cylc.github.io/cylc/doc/built-sphinx/index.html'
create_test_globalrc "" "
[documentation]
[[files]]
html user guides = ${PWD}/doc/built-sphinx/index.html
[[urls]]
internet homepage = http://cylc.github.com/cylc/
local index = http://localhost/cylc/index.html"
local = ${LOCAL}
online = ${ONLINE}"
#-------------------------------------------------------------------------------
install_suite $TEST_NAME_BASE $TEST_NAME_BASE
#-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion tests/cylc-get-site-config/00-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ run_ok $TEST_NAME.doc-section-python \
run_ok $TEST_NAME.multiple-secs \
cylc get-site-config --item='[documentation]' --item='[hosts]'
run_ok $TEST_NAME.doc-entry \
cylc get-site-config --item='[documentation][files]html user guides'
cylc get-site-config --item='[documentation]online'
run_fail $TEST_NAME.non-existent \
cylc get-site-config --item='[this][doesnt]exist'
#-------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions tests/cylc-insert/03-insert-old/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

[runtime]
[[foo_cold, foo]]
command scripting = "true"
script = "true"
[[reinsert_foo]]
command scripting = """
script = """
cylc insert $CYLC_SUITE_NAME foo_cold.20140101T0000Z
"""
8 changes: 4 additions & 4 deletions tests/deprecations/00-all.t
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ cmp_ok val.out <<__END__
* (6.1.3) [visualization][enable live graph movie] - DELETED (OBSOLETE)
* (6.4.0) [runtime][foo, cat, dog][environment scripting] -> [runtime][foo, cat, dog][env-script] - value unchanged
* (6.4.0) [runtime][foo, cat, dog][initial scripting] -> [runtime][foo, cat, dog][init-script] - value unchanged
* (6.4.0) [runtime][foo, cat, dog][post-command scripting] -> [runtime][foo, cat, dog][post-script] - value unchanged
* (6.4.0) [runtime][foo, cat, dog][pre-command scripting] -> [runtime][foo, cat, dog][pre-script] - value unchanged
* (6.4.0) [runtime][foo, cat, dog][command scripting] -> [runtime][foo, cat, dog][script] - value unchanged
* (6.4.0) [runtime][foo, cat, dog][dummy mode][command scripting] -> [runtime][foo, cat, dog][dummy mode][script] - value unchanged
* (6.4.0) [runtime][foo, cat, dog][post-script] -> [runtime][foo, cat, dog][post-script] - value unchanged
* (6.4.0) [runtime][foo, cat, dog][pre-script] -> [runtime][foo, cat, dog][pre-script] - value unchanged
* (6.4.0) [runtime][foo, cat, dog][script] -> [runtime][foo, cat, dog][script] - value unchanged
* (6.4.0) [runtime][foo, cat, dog][dummy mode][script] -> [runtime][foo, cat, dog][dummy mode][script] - value unchanged
* (6.5.0) [scheduling][special tasks][clock-triggered] -> [scheduling][special tasks][clock-trigger] - value unchanged
* (6.5.0) [scheduling][special tasks][external-triggered] -> [scheduling][special tasks][external-trigger] - value unchanged
* (6.11.0) [runtime][foo, cat, dog][event hooks] -> [runtime][foo, cat, dog][events] - value unchanged
Expand Down
10 changes: 5 additions & 5 deletions tests/deprecations/00-all/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
[[foo, cat, dog]]
initial scripting = "echo init-script" # deprecate
environment scripting = "echo env-script" # deprecate
pre-command scripting = "echo pre-script" # deprecate
command scripting = "echo script" # deprecate
post-command scripting = "echo post-script" # deprecate
pre-script = "echo pre-script" # deprecate
script = "echo script" # deprecate
post-script = "echo post-script" # deprecate
retry delays = 6*PT1H # deprecate
submission polling intervals = PT1H, PT2H
execution polling intervals = 10*PT30M
[[[simulation mode]]]
command scripting = "echo script" # deprecate
script = "echo script" # deprecate
[[[dummy mode]]]
command scripting = "echo script" # deprecate
script = "echo script" # deprecate
[[[job submission]]] # deprecate all these
command template = qsub something something
method = pbs
Expand Down
16 changes: 8 additions & 8 deletions tests/ext-trigger/00-satellite/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ until triggered by an external system."""
[runtime]
[[prep]]
title = clean the suite output directories
command scripting = \
script = \
rm -rf $CYLC_SUITE_SHARE_DIR $CYLC_SUITE_WORK_DIR

[[satsim]]
title = simulate a satellite data feed
description = """Generates {{N_DATASETS}} arbitrarily labelled
datasets very quickly, to show parallel processing streams."""
pre-command scripting = mkdir -p {{DATA_IN_DIR}}
command scripting = """
pre-script = mkdir -p {{DATA_IN_DIR}}
script = """
COUNT=0
while ((COUNT < {{N_DATASETS}})); do
# sleep $((RANDOM % 20))
Expand All @@ -88,30 +88,30 @@ done"""
inherit = WORKDIR
title = retrieve next dataset
description = just do it - we know it exists already
command scripting = mv {{DATA_IN_DIR}}/${DATASET}.raw $PWD
script = mv {{DATA_IN_DIR}}/${DATASET}.raw $PWD

[[proc1]]
inherit = WORKDIR
title = convert .raw dataset to .proc1 form
command scripting = mv ${DATASET}.raw ${DATASET}.proc1
script = mv ${DATASET}.raw ${DATASET}.proc1

[[proc2]]
inherit = WORKDIR
title = convert .proc1 dataset to .proc2 form
command scripting = mv ${DATASET}.proc1 ${DATASET}.proc2
script = mv ${DATASET}.proc1 ${DATASET}.proc2

[[products]]
inherit = WORKDIR
title = generate products from .proc2 processed dataset
command scripting = """
script = """
mkdir -p {{PRODUCT_DIR}}
mv ${DATASET}.proc2 {{PRODUCT_DIR}}/${DATASET}.prod"""

[[collate]]
title = collate all products from the suite run
# Note you might want to use "cylc suite-state" to check that
# _all_ product tasks have finished before collating results.
command scripting = """
script = """
echo PRODUCTS:
ls {{PRODUCT_DIR}}
##sleep 20"""
Expand Down
2 changes: 1 addition & 1 deletion tests/hold-release/hold-after-point/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
script = true
[runtime]
[[foo]]
command scripting = sleep 5
script = sleep 5
4 changes: 2 additions & 2 deletions tests/jinja2/filters/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
graph = foo => bar
[runtime]
[[foo]]
pre-command scripting = {{ true|truly }}
command scripting = {{ false|truly }}
pre-script = {{ true|truly }}
script = {{ false|truly }}
[[bar]]
4 changes: 2 additions & 2 deletions tests/jinja2/filters/suite.rc-expanded
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
graph = foo => bar
[runtime]
[[foo]]
pre-command scripting = true
command scripting = true
pre-script = true
script = true
[[bar]]
2 changes: 1 addition & 1 deletion tests/validate/31-fail-not-integer/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

[runtime]
[[foo]]
command scripting = sleep 10
script = sleep 10
2 changes: 1 addition & 1 deletion tests/validate/32-fail-graph-bracket-missing/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"""
[runtime]
[[foo, bar, baz]]
command scripting = echo "Hello"
script = echo "Hello"

0 comments on commit a907e90

Please sign in to comment.