Debian Codegraph @

tests/f/cylc-show/06-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 cylc-show prerequisites for past, future, and present tasks.
20
21 . "$(dirname "$0")/test_header"
22
23 set_test_number 6
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 # First run: task c shuts the scheduler down then fails.
31 TEST_NAME="${TEST_NAME_BASE}-run-1"
32 workflow_run_ok "${TEST_NAME}" cylc play --no-detach --debug "${WORKFLOW_NAME}"
33
34 # Restart: task kick-c triggers off of c's failure, and re-triggers c.
35 # Then, c runs `cylc show` on tasks b, c, and d.
36 TEST_NAME="${TEST_NAME_BASE}-run-2"
37 workflow_run_ok "${TEST_NAME}" cylc play --no-detach --debug "${WORKFLOW_NAME}"
38
39 TEST_NAME="${TEST_NAME_BASE}-show.past"
40 contains_ok "$WORKFLOW_RUN_DIR/show-b.txt" <<__END__
41 state: succeeded
42 prerequisites: (n/a for past tasks)
43 __END__
44
45 # Note trigger command satisfies off-flow prerequisites.
46 TEST_NAME="${TEST_NAME_BASE}-show.present"
47 contains_ok "${WORKFLOW_RUN_DIR}/show-c.txt" <<__END__
48 state: running
49 prerequisites: ('⨯': not satisfied)
50 ✓ 1/b succeeded
51 __END__
52
53 TEST_NAME="${TEST_NAME_BASE}-show.future"
54 contains_ok "${WORKFLOW_RUN_DIR}/show-d.txt" <<__END__
55 state: waiting
56 prerequisites: ('⨯': not satisfied)
57 ⨯ 1/c succeeded
58 __END__
59
60 purge