From 3733861e86048704c5cf64988b8d3a54caad4be0 Mon Sep 17 00:00:00 2001 From: Hilary James Oliver Date: Mon, 7 Aug 2017 22:12:16 +1200 Subject: [PATCH] Fix 'cylc suite-state' negative offset bug. --- bin/cylc-suite-state | 2 +- tests/suite-state/options/reference.log | 15 ++++++++------- tests/suite-state/options/suite.rc | 19 +++++++++++-------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/bin/cylc-suite-state b/bin/cylc-suite-state index 6e0319dd77f..70ccccab878 100755 --- a/bin/cylc-suite-state +++ b/bin/cylc-suite-state @@ -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: diff --git a/tests/suite-state/options/reference.log b/tests/suite-state/options/reference.log index 66c5fc74cdf..ca26954095e 100644 --- a/tests/suite-state/options/reference.log +++ b/tests/suite-state/options/reference.log @@ -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'] diff --git a/tests/suite-state/options/suite.rc b/tests/suite-state/options/suite.rc index a39345c8745..afd67ec7255 100644 --- a/tests/suite-state/options/suite.rc +++ b/tests/suite-state/options/suite.rc @@ -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