Skip to content

Commit

Permalink
response to review
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Jan 10, 2023
1 parent a620f92 commit 65690e7
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 72 deletions.
9 changes: 7 additions & 2 deletions tests/functional/cylc-combination-scripts/01-vr-reload.t
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# In this case the target workflow is running so cylc reload is run.

. "$(dirname "$0")/test_header"
set_test_number 6
set_test_number 7


# Setup (Must be a running workflow, note the unusual absence of --no-detach)
Expand All @@ -41,10 +41,15 @@ run_ok "${TEST_NAME_BASE}-runs" cylc vr "${WORKFLOW_NAME}"

# Grep for VR reporting revalidation, reinstallation and reloading
grep "\$" "${TEST_NAME_BASE}-runs.stdout" > VIPOUT.txt
named_grep_ok "${TEST_NAME_BASE}-it-revalidated" "$ cylc validate --against-source" "VIPOUT.txt"
named_grep_ok "${TEST_NAME_BASE}-it-validated" "$ cylc validate --against-source" "VIPOUT.txt"
named_grep_ok "${TEST_NAME_BASE}-it-installed" "$ cylc reinstall" "VIPOUT.txt"
named_grep_ok "${TEST_NAME_BASE}-it-reloaded" "$ cylc reload" "VIPOUT.txt"

cylc play "${WORKFLOW_NAME}"

named_grep_ok "${TEST_NAME_BASE}-it-logged-reload" \
"Reloading the workflow definition" \
"${WORKFLOW_RUN_DIR}/log/scheduler/log"

# Clean Up.
run_ok "teardown (stop workflow)" cylc stop "${WORKFLOW_NAME}" --now --now
Expand Down
54 changes: 0 additions & 54 deletions tests/functional/cylc-combination-scripts/03-vr-resume.t

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ run_ok "setup (vip)" \
cylc vip --debug \
--workflow-name "${WORKFLOW_NAME}" \
--no-run-name


# Get the workflow into an unreachable state

CONTACTFILE="${RUN_DIR}/${WORKFLOW_NAME}/.service/contact"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

[runtime]
[[foo]]
script = sleep 500
script = cylc pause ${WORKFLOW_ID}
6 changes: 0 additions & 6 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,6 @@ def flow(run_dir, test_dir):
yield partial(_make_flow, run_dir, test_dir)


@pytest.fixture
def flow_src(tmp_path):
"""A function for creating function-level flows."""
yield partial(_make_src_flow, tmp_path)


@pytest.fixture(scope='module')
def mod_scheduler():
"""Return a Scheduler object for a flow.
Expand Down
7 changes: 3 additions & 4 deletions tests/integration/scripts/test_validate_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@

"""Integration tests for Cylc Validate CLI script."""

from cylc.flow.scripts.validate import wrapped_main as validate
from cylc.flow.parsec.exceptions import IllegalItemError
import pytest
from cylc.flow.parsec.exceptions import Jinja2Error


async def test_revalidate_checks_source(
async def test_validate_against_source_checks_source(
capsys, validate, workflow_source, install, one_conf
):
"""Validation fails if revalidating with broken config.
"""Validation fails if validating against source with broken config.
"""
src_dir = workflow_source(one_conf)
workflow_id = install(src_dir)
Expand All @@ -44,7 +43,7 @@ async def test_revalidate_checks_source(
validate(workflow_id, against_source=True)


async def test_revalidate_gets_old_tvars(
async def test_validate_against_source_gets_old_tvars(
workflow_source, capsys, validate, scheduler, run, install, run_dir
):
"""Validation will retrieve template variables from a previously played
Expand Down
9 changes: 5 additions & 4 deletions tests/integration/test_get_old_tvars.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

import pytest
from pytest import param
from types import SimpleNamespace

from cylc.flow.option_parsers import Options

from cylc.flow.scripts.validate import (
wrapped_main as validate,
Expand Down Expand Up @@ -70,14 +71,14 @@ def _setup(mod_scheduler, mod_flow):
param(cylclist, list_gop, 'bar', id='list')
)
)
async def test_revalidate_validate(
async def test_validate_with_old_tvars(
_setup, mod_start, capsys, function, parser, expect,
):
"""It (A Cylc CLI Command) can get template vars stored in db.
"""It (A Cylc CLI Command - see parameters) can
get template vars stored in db.
Else the jinja2 in the config would cause these tasks to fail.
"""
from cylc.flow.option_parsers import Options
parser = parser()
opts = Options(parser)()
if function == graph:
Expand Down
1 change: 0 additions & 1 deletion tests/integration/utils/flow_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def _make_flow(
test_dir: Path,
conf: Union[dict, str],
name: Optional[str] = None,
is_run: Optional[bool] = True
) -> str:
"""Construct a workflow on the filesystem."""
if name is None:
Expand Down

0 comments on commit 65690e7

Please sign in to comment.