Skip to content

Commit

Permalink
Merge pull request #2378 from hjoliver/fix-suite-state-cli
Browse files Browse the repository at this point in the history
Fix 'cylc suite-state' negative offset bug.
  • Loading branch information
oliver-sanders authored Aug 8, 2017
2 parents bcd660d + 3733861 commit 5b78ea5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bin/cylc-suite-state
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def main():
except ValueError:
sys.exit("ERROR: Cannot parse offset: %s" % options.offset)
if oper == "-":
my_target_point -= my_shiftcycle_point_format
my_target_point -= my_shift
else:
my_target_point += my_shift
else:
Expand Down
15 changes: 8 additions & 7 deletions tests/suite-state/options/reference.log
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
2015-05-27T08:45:11Z INFO - Initial point: 20100101T0000Z
2015-05-27T08:45:11Z INFO - Final point: 20100103T0000Z
2015-05-27T08:45:11Z INFO - [foo.20100101T0000Z] -triggered off []
2015-05-27T08:45:14Z INFO - [foo.20100102T0000Z] -triggered off ['foo.20100101T0000Z']
2015-05-27T08:45:18Z INFO - [foo.20100103T0000Z] -triggered off ['foo.20100102T0000Z']
2015-05-27T08:45:21Z INFO - [offset_polling.20100103T0000Z] -triggered off ['foo.20100103T0000Z']
2015-05-27T08:45:21Z INFO - [env_polling.20100103T0000Z] -triggered off ['foo.20100103T0000Z']
2017-08-07T10:35:57Z INFO - Initial point: 20100101T0000Z
2017-08-07T10:35:57Z INFO - Final point: 20100103T0000Z
2017-08-07T10:35:57Z INFO - [foo.20100101T0000Z] -triggered off []
2017-08-07T10:36:00Z INFO - [foo.20100102T0000Z] -triggered off ['foo.20100101T0000Z']
2017-08-07T10:36:03Z INFO - [foo.20100103T0000Z] -triggered off ['foo.20100102T0000Z']
2017-08-07T10:36:03Z INFO - [env_polling.20100102T0000Z] -triggered off ['foo.20100102T0000Z']
2017-08-07T10:36:03Z INFO - [offset_polling.20100102T0000Z] -triggered off ['foo.20100102T0000Z']
2017-08-07T10:36:07Z INFO - [offset_polling2.20100102T0000Z] -triggered off ['foo.20100103T0000Z']
19 changes: 11 additions & 8 deletions tests/suite-state/options/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@
final cycle point = 20100103T00Z
[[dependencies]]
[[[T00]]]
graph = "foo[-P1D] => foo"
[[[R1/20100103T00Z]]]
graph = """foo => env_polling
foo => offset_polling
"""
graph = "foo[-P1D] => foo"
[[[R1/20100102T00Z]]]
graph = """foo => env_polling
foo => offset_polling
foo[+P1D] => offset_polling2
"""
[runtime]
[[foo]]
command scripting = true
script = true
[[env_polling]]
command scripting = cylc suite-state $CYLC_SUITE_NAME --task=foo --task-point -S succeeded
script = cylc suite-state $CYLC_SUITE_NAME --task=foo --task-point -S succeeded
[[offset_polling]]
command scripting = cylc suite-state $CYLC_SUITE_NAME --task=foo -p 20100101T0000Z --offset=P1D
script = cylc suite-state $CYLC_SUITE_NAME --task=foo -p 20100101T0000Z --offset=P1D
[[offset_polling2]]
script = cylc suite-state $CYLC_SUITE_NAME --task=foo -p 20100101T0000Z --offset=-P1D

0 comments on commit 5b78ea5

Please sign in to comment.