forked from cylc/cylc-flow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10-CYLC_WORKFLOW_SRC_DIR.t
More file actions
65 lines (52 loc) · 2.04 KB
/
10-CYLC_WORKFLOW_SRC_DIR.t
File metadata and controls
65 lines (52 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env bash
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#------------------------------------------------------------------------------
# Test `CYLC_WORKFLOW_SRC_DIR.t` is set
. "$(dirname "$0")/test_header"
set_test_number 6
WORKFLOW_NAME="cylctb-x$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c6)"
cat > flow.cylc <<__HERE__
#!jinja2
# TEST: {{ CYLC_WORKFLOW_SRC_DIR }}
[scheduler]
allow implicit tasks = true
[scheduling]
[[graph]]
R1 = foo
__HERE__
run_ok "${TEST_NAME_BASE}-view" cylc view -p .
named_grep_ok "${TEST_NAME_BASE}-src-path-in-view-p" "TEST: $PWD" \
"${TEST_NAME_BASE}-view.stdout"
# It starts playing:
run_ok "${TEST_NAME_BASE}-vip" \
cylc vip \
--pause \
--no-run-name \
--workflow-name "${WORKFLOW_NAME}"
# It can get CYLC_WORKFLOW_SRC_DIR
named_grep_ok "${TEST_NAME_BASE}-src-path-available" \
"TEST: $PWD" "${RUN_DIR}/${WORKFLOW_NAME}/log/config/flow-processed.cylc"
# It can be updated with Cylc VR
echo "[meta]" >> flow.cylc
run_ok "${TEST_NAME_BASE}-vr" \
cylc vr "${WORKFLOW_NAME}"
poll_grep "meta" "${RUN_DIR}/${WORKFLOW_NAME}/log/config/flow-processed.cylc"
# It can get CYLC_WORKFLOW_SRC_DIR
named_grep_ok "${TEST_NAME_BASE}-src-path-available" \
"TEST: $PWD" "${RUN_DIR}/${WORKFLOW_NAME}/log/config/flow-processed.cylc"
cylc stop "${WORKFLOW_NAME}"
purge "${WORKFLOW_NAME}"