Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'cylc suite-state' negative offset bug. #2378

Merged
merged 1 commit into from
Aug 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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