-
Notifications
You must be signed in to change notification settings - Fork 93
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
#1332: Implement auto use of cycle-point format in a remote suite. #2134
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1420,7 +1420,7 @@ def match_ext_triggers(self): | |
if itask.state.external_triggers: | ||
ets.retrieve(itask) | ||
|
||
def put_rundb_suite_params(self, initial_point, final_point): | ||
def put_rundb_suite_params(self, initial_point, final_point, format=None): | ||
"""Put run mode, initial/final cycle point in runtime database. | ||
|
||
This method queues the relevant insert statements. | ||
|
@@ -1430,6 +1430,11 @@ def put_rundb_suite_params(self, initial_point, final_point): | |
{"key": "initial_point", "value": str(initial_point)}, | ||
{"key": "final_point", "value": str(final_point)}, | ||
]) | ||
if format: | ||
print "during format thing" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A stray bit of debug code? 😁 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well spotted, fixed now. |
||
self.db_inserts_map[self.TABLE_SUITE_PARAMS].extend([ | ||
{"key": "cycle_point_format", "value": str(format)} | ||
]) | ||
if self.is_held: | ||
self.db_inserts_map[self.TABLE_SUITE_PARAMS].append( | ||
{"key": "is_held", "value": 1}) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
# THIS FILE IS PART OF THE CYLC SUITE ENGINE. | ||
# Copyright (C) 2008-2017 NIWA | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
#------------------------------------------------------------------------------- | ||
# Test cylc suite-state "template" option | ||
. $(dirname $0)/test_header | ||
#------------------------------------------------------------------------------- | ||
set_test_number 5 | ||
#------------------------------------------------------------------------------- | ||
install_suite $TEST_NAME_BASE format | ||
#------------------------------------------------------------------------------- | ||
TEST_NAME=$TEST_NAME_BASE-run | ||
suite_run_ok $TEST_NAME cylc run --debug $SUITE_NAME | ||
#------------------------------------------------------------------------------- | ||
TEST_NAME=$TEST_NAME_BASE-cli-template-poll | ||
run_ok $TEST_NAME cylc suite-state $SUITE_NAME -p 20100101T0000Z \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe worth adding a test for STDOUT? |
||
--task=foo --status=succeeded | ||
contains_ok $TEST_NAME.stdout <<__OUT__ | ||
polling for 'succeeded': satisfied | ||
__OUT__ | ||
#------------------------------------------------------------------------------- | ||
TEST_NAME=$TEST_NAME_BASE-cli-template-dump | ||
run_ok $TEST_NAME cylc suite-state $SUITE_NAME -p 20100101T0000Z | ||
contains_ok $TEST_NAME.stdout <<__OUT__ | ||
foo, 2010-01-01, succeeded | ||
__OUT__ | ||
#------------------------------------------------------------------------------- | ||
purge_suite $SUITE_NAME | ||
#------------------------------------------------------------------------------- | ||
exit 0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[cylc] | ||
UTC mode = True | ||
cycle point format = CCYY-MM-DD | ||
[[reference test]] | ||
live mode suite timeout = PT1M | ||
|
||
[scheduling] | ||
initial cycle point = 20100101 | ||
|
||
[[dependencies]] | ||
[[[R1]]] | ||
graph = foo | ||
|
||
[runtime] | ||
[[foo]] | ||
script = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should add doc string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done