Debian Codegraph @

tests/functional/jobscript/00-torture/flow.cylc

raw
1 [meta]
2 title = "job script torture test"
3
4 description = """Any task job script may fail regardless of user runtime
5 settings if changes to cylc re-order the job script sections badly: e.g.
6 "cylc task started" must be called after the CYLC_ environment variables
7 are exported. Additionally, users may rely on the order of variable
8 definition in each environment and script section: e.g. workflow
9 bin directory must go in PATH before the task runtime environment is
10 defined because workflow bin commands could be used in variable assignment
11 expressions."""
12
13 [scheduling]
14 [[graph]]
15 R1 = "foo"
16 [runtime]
17 [[foo]]
18 platform = localhost
19 init-script = """
20 echo "HELLO FROM INIT-SCRIPT"
21 # define a variable
22 export VAR_IS=is"""
23 pre-script = """
24 echo "HELLO FROM PRE-SCRIPT"
25 # init-script must be done:
26 echo VAR_IS is $VAR_IS
27 # user environment must be done:
28 echo E_ONE is $E_ONE
29 echo E_TWO is $E_TWO
30 echo E_THR is $E_THR
31 echo E_FOU is $E_FOU
32 echo E_FIV is $E_FIV
33 # define a variable
34 export VAR_PreCS=precs"""
35 script = """
36 echo "HELLO FROM SCRIPT"
37 # init-script must be done:
38 echo VAR_IS is $VAR_IS
39 # pre-script must be done:
40 echo VAR_PreCS is $VAR_PreCS
41 # environment must be done:
42 echo E_ONE is $E_ONE
43 echo E_TWO is $E_TWO
44 echo E_THR is $E_THR
45 echo E_FOU is $E_FOU
46 echo E_FIV is $E_FIV
47 # define a variable
48 export VAR_CS=var_cs"""
49 post-script = """
50 echo "HELLO FROM POST-SCRIPT"
51 # init-script must be done:
52 echo VAR_IS is $VAR_IS
53 # pre-script must be done:
54 echo VAR_PreCS is $VAR_PreCS
55 # script must be done:
56 echo VAR_CS is $VAR_CS
57 # environment must be done:
58 echo E_ONE is $E_ONE
59 echo E_TWO is $E_TWO
60 echo E_THR is $E_THR
61 echo E_FOU is $E_FOU
62 echo E_FIV is $E_FIV
63 echo VAR_IS is $VAR_IS
64 echo VAR_PreCS is $VAR_PreCS
65 echo VAR_CS is $VAR_CS
66 # define a variable
67 export VAR_PostCS=postcs"""
68 [[[environment]]]
69 # path to cylc must be available:
70 E_ONE = $(( RANDOM % 10 ))
71 # init-script must be done:
72 E_TWO = $VAR_IS
73 # cylc-defined variables must be done:
74 E_THR = $CYLC_WORKFLOW_SHARE_DIR
75 E_FOU = $CYLC_TASK_NAME
76 # the workflow bin must be in $PATH already:
77 E_FIV = $( foo.sh )