Debian Codegraph @

tests/functional/n-window/01-past-present-future.t

raw
1 #!/usr/bin/env bash
2 # THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
3 # Copyright (C) NIWA & British Crown (Met Office) & Contributors.
4 #
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #-------------------------------------------------------------------------------
18
19 # Test window size using graphql and cylc-show for all tasks.
20
21 . "$(dirname "$0")/test_header"
22
23 set_test_number 7
24
25 install_workflow "${TEST_NAME_BASE}" "${TEST_NAME_BASE}"
26
27 TEST_NAME="${TEST_NAME_BASE}-validate"
28 run_ok "${TEST_NAME}" cylc validate "${WORKFLOW_NAME}"
29
30 TEST_NAME="${TEST_NAME_BASE}-run"
31 # 'a => b => c => d => e', 'a' sets window size to 2, 'c' uses cylc show on all.
32 workflow_run_ok "${TEST_NAME}" cylc play --no-detach --debug "${WORKFLOW_NAME}"
33
34 TEST_NAME="${TEST_NAME_BASE}-show-a.past"
35 contains_ok "$WORKFLOW_RUN_DIR/show-a.txt" <<__END__
36 state: succeeded
37 prerequisites: (None)
38 __END__
39
40 TEST_NAME="${TEST_NAME_BASE}-show-b.past"
41 contains_ok "$WORKFLOW_RUN_DIR/show-b.txt" <<__END__
42 state: succeeded
43 prerequisites: (n/a for past tasks)
44 __END__
45
46 TEST_NAME="${TEST_NAME_BASE}-show-c.present"
47 contains_ok "${WORKFLOW_RUN_DIR}/show-c.txt" <<__END__
48 prerequisites: ('⨯': not satisfied)
49 ✓ 1/b succeeded
50 __END__
51
52 TEST_NAME="${TEST_NAME_BASE}-show-d.future"
53 contains_ok "${WORKFLOW_RUN_DIR}/show-d.txt" <<__END__
54 state: waiting
55 prerequisites: ('⨯': not satisfied)
56 ⨯ 1/c succeeded
57 __END__
58
59 TEST_NAME="${TEST_NAME_BASE}-show-e.future"
60 contains_ok "${WORKFLOW_RUN_DIR}/show-e.txt" <<__END__
61 state: waiting
62 prerequisites: ('⨯': not satisfied)
63 ⨯ 1/d succeeded
64 __END__
65
66 purge