Skip to content

Commit

Permalink
response to review
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Dec 6, 2022
1 parent 22ba527 commit 64150dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
7 changes: 5 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ ones in. -->
-------------------------------------------------------------------------------
## __cylc-8.1.0 (<span actions:bind='release-date'>Upcoming</span>)__

### Breaking Changes

* Workflows started with Cylc 8.0 which contain multiple "flows" cannot be
restarted with Cylc 8.1 due to database changes.

### Enhancements

[#5184](https://github.com/cylc/cylc-flow/pull/5184) - scan for active
Expand All @@ -33,8 +38,6 @@ command to validate, install and play a workflow.
[#5081](https://github.com/cylc/cylc-flow/pull/5081) - Reduced amount that
gets logged at "INFO" level in scheduler logs.

### Fixes

[#5259](https://github.com/cylc/cylc-flow/pull/5259) - Add flow_nums
to task_jobs table in the workflow database.

Expand Down
13 changes: 7 additions & 6 deletions tests/unit/test_workflow_db_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _inner(values):
return _inner


def test_upgrade_pre_804_fails_on_multiple_flows(_setup_db):
def test_upgrade_pre_810_fails_on_multiple_flows(_setup_db):
values = (
r'INSERT INTO task_states VALUES'
r" ('foo', '10050101T0000Z', '[1, 3]',"
Expand All @@ -72,12 +72,12 @@ def test_upgrade_pre_804_fails_on_multiple_flows(_setup_db):
pri_dao = CylcWorkflowDAO(db_file_name)
with pytest.raises(
CylcError,
match='^Cannot .* 8.0.3 to 8.0.4 .* used.$'
match='^Cannot .* 8.0.x to 8.1.0 .* used.$'
):
WorkflowDatabaseManager.upgrade_pre_804(pri_dao)
WorkflowDatabaseManager.upgrade_pre_810(pri_dao)


def test_upgrade_pre_804_pass_on_single_flow(_setup_db):
def test_upgrade_pre_810_pass_on_single_flow(_setup_db):
values = (
r'INSERT INTO task_states VALUES'
r" ('foo', '10050101T0000Z', '[1]',"
Expand All @@ -86,7 +86,8 @@ def test_upgrade_pre_804_pass_on_single_flow(_setup_db):
)
db_file_name = _setup_db(values)
pri_dao = CylcWorkflowDAO(db_file_name)
WorkflowDatabaseManager.upgrade_pre_804(pri_dao)
WorkflowDatabaseManager.upgrade_pre_810(pri_dao)
conn = sqlite3.connect(db_file_name)
result = conn.execute('SELECT flow_nums FROM task_jobs;').fetchall()[0][0]
result = conn.execute(
'SELECT DISTINCT flow_nums FROM task_jobs;').fetchall()[0][0]
assert result == '[1]'

0 comments on commit 64150dd

Please sign in to comment.