Skip to content

Commit

Permalink
Test errors are handled
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottWales committed Dec 2, 2024
1 parent f8e77a6 commit d271d9b
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions tests/integration/test_reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,18 @@ async def test_reload_global(
""")
assert glbl_cfg(reload=True).get(['platforms','localhost','meta','x']) == '1'

# Modify the global config file
global_config_path.write_text("""
[platforms]
[[localhost]]
[[[meta]]]
x = 2
""")

id_ = flow(one_conf)
schd = scheduler(id_)
async with start(schd) as log:

# Modify the global config file
global_config_path.write_text("""
[platforms]
[[localhost]]
[[[meta]]]
x = 2
""")

# reload the workflow and global config
await commands.run_cmd(commands.reload_workflow, schd, reload_global=True)

Expand All @@ -197,3 +197,25 @@ async def test_reload_global(

# Task platforms reflect the new config
assert schd.pool.get_tasks()[0].platform['meta']['x'] == '2'

# Modify the global config file with an error
global_config_path.write_text("""
[ERROR]
[[localhost]]
[[[meta]]]
x = 3
""")

# reload the workflow and global config
await commands.run_cmd(commands.reload_workflow, schd, reload_global=True)

# Error is noted in the log
assert log_filter(
log,
contains=(
'This is probably due to an issue with the new configuration.'
)
)

# Task platforms should be the last valid value
assert schd.pool.get_tasks()[0].platform['meta']['x'] == '2'

0 comments on commit d271d9b

Please sign in to comment.