From 6212284581b67f8765855d0b11d190f19614ff7d Mon Sep 17 00:00:00 2001 From: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:46:28 +0100 Subject: [PATCH] Tidy --- cylc/flow/xtriggers/suite_state.py | 15 +++------------ tests/functional/workflow-state/11-multi.t | 8 ++++---- .../workflow-state/11-multi/{c7.schema => c7.sql} | 0 .../11-multi/{c8a.schema => c8a.sql} | 0 .../11-multi/{c8b.schema => c8b.sql} | 0 5 files changed, 7 insertions(+), 16 deletions(-) rename tests/functional/workflow-state/11-multi/{c7.schema => c7.sql} (100%) rename tests/functional/workflow-state/11-multi/{c8a.schema => c8a.sql} (100%) rename tests/functional/workflow-state/11-multi/{c8b.schema => c8b.sql} (100%) diff --git a/cylc/flow/xtriggers/suite_state.py b/cylc/flow/xtriggers/suite_state.py index 3ea6a61a71d..b2ce3783c32 100644 --- a/cylc/flow/xtriggers/suite_state.py +++ b/cylc/flow/xtriggers/suite_state.py @@ -16,7 +16,7 @@ from cylc.flow import LOG import cylc.flow.flags -from cylc.flow.xtriggers.workflow_state import workflow_state +from cylc.flow.xtriggers.workflow_state import _workflow_state_backcompat if not cylc.flow.flags.cylc7_back_compat: LOG.warning( @@ -72,15 +72,6 @@ def suite_state(suite, task, point, offset=None, status='succeeded', to this xtrigger. """ - if message is not None: - selector = message - is_message = True - else: - selector = status - is_message = False - - return workflow_state( - f"{suite}//{point}/{task}:{selector}", - offset=offset, is_message=is_message, - alt_cylc_run_dir=cylc_run_dir + return _workflow_state_backcompat( + suite, task, point, offset, status, message, cylc_run_dir ) diff --git a/tests/functional/workflow-state/11-multi.t b/tests/functional/workflow-state/11-multi.t index e0d7b0cfd41..41ed5c7cef0 100644 --- a/tests/functional/workflow-state/11-multi.t +++ b/tests/functional/workflow-state/11-multi.t @@ -25,13 +25,13 @@ install_workflow "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" # Create Cylc 7, 8 (pre-8.3.0), and 8(8.3.0+) DBs for workflow-state checking. DBDIR="${WORKFLOW_RUN_DIR}/dbs" for x in c7 c8a c8b; do - mkdir -p "${DBDIR}/${x}/log" - sqlite3 "${DBDIR}/${x}/log/db" < "${x}.schema" + mkdir -p "${DBDIR}/${x}/log" + sqlite3 "${DBDIR}/${x}/log/db" < "${x}.sql" done run_ok "${TEST_NAME_BASE}-validate" \ - cylc validate "${WORKFLOW_NAME}" --set="ALT=\"${DBDIR}\"" - + cylc validate "${WORKFLOW_NAME}" --set="ALT=\"${DBDIR}\"" + TEST_NAME="${TEST_NAME_BASE}-run" workflow_run_ok "${TEST_NAME}" \ cylc play "${WORKFLOW_NAME}" --set="ALT=\"${DBDIR}\"" \ diff --git a/tests/functional/workflow-state/11-multi/c7.schema b/tests/functional/workflow-state/11-multi/c7.sql similarity index 100% rename from tests/functional/workflow-state/11-multi/c7.schema rename to tests/functional/workflow-state/11-multi/c7.sql diff --git a/tests/functional/workflow-state/11-multi/c8a.schema b/tests/functional/workflow-state/11-multi/c8a.sql similarity index 100% rename from tests/functional/workflow-state/11-multi/c8a.schema rename to tests/functional/workflow-state/11-multi/c8a.sql diff --git a/tests/functional/workflow-state/11-multi/c8b.schema b/tests/functional/workflow-state/11-multi/c8b.sql similarity index 100% rename from tests/functional/workflow-state/11-multi/c8b.schema rename to tests/functional/workflow-state/11-multi/c8b.sql