Skip to content

Commit

Permalink
Fix misspelling of 'Rakiura'. (#5869)
Browse files Browse the repository at this point in the history
Fix misspelling of 'Rakiura'.
  • Loading branch information
hjoliver authored Dec 8, 2023
1 parent b6efda4 commit d9669a8
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 48 deletions.
30 changes: 15 additions & 15 deletions tests/integration/tui/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def format_test_failure(expected, got, description):
'''


class RaikuraSession:
"""Convenience class for accessing Raikura functionality."""
class RakiuraSession:
"""Convenience class for accessing Rakiura functionality."""

def __init__(self, app, html_fragment, test_dir, test_name):
self.app = app
Expand Down Expand Up @@ -177,7 +177,7 @@ def force_update(self):
This is done automatically by compare_screenshot but you may want to
call it in a test, e.g. before pressing navigation keys.
With Raikura, the Tui event loop is not running so the data is never
With Rakiura, the Tui event loop is not running so the data is never
refreshed.
You do NOT need to call this method for key presses, but you do need to
Expand Down Expand Up @@ -215,16 +215,16 @@ def wait_until_loaded(self, *ids, retries=20):


@pytest.fixture
def raikura(test_dir, request, monkeypatch):
def rakiura(test_dir, request, monkeypatch):
"""Visual regression test framework for Urwid apps.
Like Cypress but for Tui so named after a NZ island with lots of Tuis.
When called this yields a RaikuraSession object loaded with test
When called this yields a RakiuraSession object loaded with test
utilities. All tests have default retries to avoid flaky tests.
Similar to the "start" fixture, which starts a Scheduler without running
the main loop, raikura starts Tui without running the main loop.
the main loop, rakiura starts Tui without running the main loop.
Arguments:
workflow_id:
Expand All @@ -234,25 +234,25 @@ def raikura(test_dir, request, monkeypatch):
separated string e.g. "80,50" for 80 cols wide by 50 rows tall.
Returns:
A RaikuraSession context manager which provides useful utilities for
A RakiuraSession context manager which provides useful utilities for
testing.
"""
return _raikura(test_dir, request, monkeypatch)
return _rakiura(test_dir, request, monkeypatch)


@pytest.fixture
def mod_raikura(test_dir, request, monkeypatch):
"""Same as raikura but configured to view module-scoped workflows.
def mod_rakiura(test_dir, request, monkeypatch):
"""Same as rakiura but configured to view module-scoped workflows.
Note: This is *not* a module-scoped fixture (no need, creating Tui sessions
is not especially slow), it is configured to display module-scoped
"scheduler" fixtures (which may be more expensive to create/destroy).
"""
return _raikura(test_dir.parent, request, monkeypatch)
return _rakiura(test_dir.parent, request, monkeypatch)


def _raikura(test_dir, request, monkeypatch):
def _rakiura(test_dir, request, monkeypatch):
# make the workflow and scan update intervals match (more reliable)
# and speed things up a little whilst we're at it
monkeypatch.setattr(
Expand Down Expand Up @@ -289,19 +289,19 @@ def get_display_id(id_):
workflow_filter = re.escape(id_base) + r'/.*'

@contextmanager
def _raikura(workflow_id=None, size='80,50'):
def _rakiura(workflow_id=None, size='80,50'):
screen, html_fragment = configure_screenshot(size)
app = TuiApp(screen=screen)
with app.main(
workflow_id,
id_filter=workflow_filter,
interactive=False,
):
yield RaikuraSession(
yield RakiuraSession(
app,
html_fragment,
test_dir,
request.function.__name__,
)

return _raikura
return _rakiura
38 changes: 19 additions & 19 deletions tests/integration/tui/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,37 +46,37 @@ def set_task_state(schd, task_states):
)


async def test_tui_basics(raikura):
async def test_tui_basics(rakiura):
"""Test basic Tui interaction with no workflows."""
with raikura(size='80,40') as rk:
with rakiura(size='80,40') as rk:
# the app should open
rk.compare_screenshot('test-raikura', 'the app should have loaded')
rk.compare_screenshot('test-rakiura', 'the app should have loaded')

# "h" should bring up the onscreen help
rk.user_input('h')
rk.compare_screenshot(
'test-raikura-help',
'test-rakiura-help',
'the help screen should be visible'
)

# "q" should close the popup
rk.user_input('q')
rk.compare_screenshot(
'test-raikura',
'test-rakiura',
'the help screen should have closed',
)

# "enter" should bring up the context menu
rk.user_input('enter')
rk.compare_screenshot(
'test-raikura-enter',
'test-rakiura-enter',
'the context menu should have opened',
)

# "enter" again should close it via the "cancel" button
rk.user_input('enter')
rk.compare_screenshot(
'test-raikura',
'test-rakiura',
'the context menu should have closed',
)

Expand All @@ -89,13 +89,13 @@ async def test_tui_basics(raikura):
rk.user_input('q')


async def test_subscribe_unsubscribe(one_conf, flow, scheduler, start, raikura):
async def test_subscribe_unsubscribe(one_conf, flow, scheduler, start, rakiura):
"""Test a simple workflow with one task."""
id_ = flow(one_conf, name='one')
schd = scheduler(id_)
async with start(schd):
await schd.update_data_structure()
with raikura(size='80,15') as rk:
with rakiura(size='80,15') as rk:
rk.compare_screenshot(
'unsubscribed',
'the workflow should be collapsed'
Expand All @@ -120,7 +120,7 @@ async def test_subscribe_unsubscribe(one_conf, flow, scheduler, start, raikura):
)


async def test_workflow_states(one_conf, flow, scheduler, start, raikura):
async def test_workflow_states(one_conf, flow, scheduler, start, rakiura):
"""Test viewing multiple workflows in different states."""
# one => stopping
id_1 = flow(one_conf, name='one')
Expand All @@ -137,7 +137,7 @@ async def test_workflow_states(one_conf, flow, scheduler, start, raikura):

async with start(schd_2):
await schd_2.update_data_structure()
with raikura(size='80,15') as rk:
with rakiura(size='80,15') as rk:
rk.compare_screenshot(
'unfiltered',
'All workflows should be visible (one, two, tree)',
Expand Down Expand Up @@ -193,7 +193,7 @@ async def test_workflow_states(one_conf, flow, scheduler, start, raikura):
# TODO: Task state filtering is currently broken
# see: https://github.com/cylc/cylc-flow/issues/5716
#
# async def test_task_states(flow, scheduler, start, raikura):
# async def test_task_states(flow, scheduler, start, rakiura):
# id_ = flow({
# 'scheduler': {
# 'allow implicit tasks': 'true',
Expand Down Expand Up @@ -224,15 +224,15 @@ async def test_workflow_states(one_conf, flow, scheduler, start, raikura):
# )
# await schd.update_data_structure()
#
# with raikura(schd.tokens.id, size='80,20') as rk:
# with rakiura(schd.tokens.id, size='80,20') as rk:
# rk.compare_screenshot('unfiltered')
#
# # filter out waiting tasks
# rk.user_input('T', 'down', 'enter', 'q')
# rk.compare_screenshot('filter-not-waiting')


async def test_navigation(flow, scheduler, start, raikura):
async def test_navigation(flow, scheduler, start, rakiura):
"""Test navigating with the arrow keys."""
id_ = flow({
'scheduling': {
Expand All @@ -257,7 +257,7 @@ async def test_navigation(flow, scheduler, start, raikura):
async with start(schd):
await schd.update_data_structure()

with raikura(size='80,30') as rk:
with rakiura(size='80,30') as rk:
# wait for the workflow to appear (collapsed)
rk.wait_until_loaded('#spring')

Expand Down Expand Up @@ -291,7 +291,7 @@ async def test_navigation(flow, scheduler, start, raikura):
)


async def test_auto_expansion(flow, scheduler, start, raikura):
async def test_auto_expansion(flow, scheduler, start, rakiura):
"""It should automatically expand cycles and top-level families.
When a workflow is expanded, Tui should auto expand cycles and top-level
Expand All @@ -314,7 +314,7 @@ async def test_auto_expansion(flow, scheduler, start, raikura):
},
}, name='one')
schd = scheduler(id_)
with raikura(size='80,20') as rk:
with rakiura(size='80,20') as rk:
async with start(schd):
await schd.update_data_structure()
# wait for the workflow to appear (collapsed)
Expand Down Expand Up @@ -342,15 +342,15 @@ async def test_auto_expansion(flow, scheduler, start, raikura):
)


async def test_restart_reconnect(one_conf, flow, scheduler, start, raikura):
async def test_restart_reconnect(one_conf, flow, scheduler, start, rakiura):
"""It should handle workflow shutdown and restart.
The Cylc client can raise exceptions e.g. WorkflowStopped. Any text written
to stdout/err will mess with Tui. The purpose of this test is to ensure Tui
can handle shutdown / restart without any errors occuring and any spurious
text appearing on the screen.
"""
with raikura(size='80,20') as rk:
with rakiura(size='80,20') as rk:
schd = scheduler(flow(one_conf, name='one'))

# 1- start the workflow
Expand Down
16 changes: 8 additions & 8 deletions tests/integration/tui/test_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ async def workflow(mod_flow, mod_scheduler, mod_start, standarise_host_and_path)

async def test_scheduler_logs(
workflow,
mod_raikura,
mod_rakiura,
wait_log_loaded,
):
"""Test viewing the scheduler log files."""
with mod_raikura(size='80,30') as rk:
with mod_rakiura(size='80,30') as rk:
# wait for the workflow to appear (collapsed)
rk.wait_until_loaded('#spring')

Expand Down Expand Up @@ -239,14 +239,14 @@ async def test_scheduler_logs(

async def test_task_logs(
workflow,
mod_raikura,
mod_rakiura,
wait_log_loaded,
):
"""Test viewing task log files.
I.E. Test viewing job log files by opening the log view on a task.
"""
with mod_raikura(size='80,30') as rk:
with mod_rakiura(size='80,30') as rk:
# wait for the workflow to appear (collapsed)
rk.wait_until_loaded('#spring')

Expand Down Expand Up @@ -280,14 +280,14 @@ async def test_task_logs(

async def test_job_logs(
workflow,
mod_raikura,
mod_rakiura,
wait_log_loaded,
):
"""Test viewing the job log files.
I.E. Test viewing job log files by opening the log view on a job.
"""
with mod_raikura(size='80,30') as rk:
with mod_rakiura(size='80,30') as rk:
# wait for the workflow to appear (collapsed)
rk.wait_until_loaded('#spring')

Expand Down Expand Up @@ -325,7 +325,7 @@ async def test_job_logs(

async def test_errors(
workflow,
mod_raikura,
mod_rakiura,
wait_log_loaded,
monkeypatch,
):
Expand All @@ -339,7 +339,7 @@ def cli_cmd_fail(*args, **kwargs):
cli_cmd_fail,
)

with mod_raikura(size='80,30') as rk:
with mod_rakiura(size='80,30') as rk:
# wait for the workflow to appear (collapsed)
rk.wait_until_loaded('#spring')

Expand Down
8 changes: 4 additions & 4 deletions tests/integration/tui/test_mutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ async def test_online_mutation(
flow,
scheduler,
start,
raikura,
rakiura,
monkeypatch,
):
"""Test a simple workflow with one task."""
id_ = flow(one_conf, name='one')
schd = scheduler(id_)
with raikura(size='80,15') as rk:
with rakiura(size='80,15') as rk:
async with start(schd):
await schd.update_data_structure()
assert schd.command_queue.empty()
Expand Down Expand Up @@ -157,14 +157,14 @@ def returncode(self):
async def test_offline_mutation(
one_conf,
flow,
raikura,
rakiura,
capture_commands,
standardise_cli_cmds,
):
id_ = flow(one_conf, name='one')
commands, returncode = capture_commands

with raikura(size='80,15') as rk:
with rakiura(size='80,15') as rk:
# run the stop-all mutation
rk.wait_until_loaded('root')
rk.user_input('enter', 'down')
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/tui/test_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from cylc.flow.tui.data import _show


async def test_show(flow, scheduler, start, raikura, monkeypatch):
async def test_show(flow, scheduler, start, rakiura, monkeypatch):
"""Test "cylc show" support in Tui."""
id_ = flow({
'scheduling': {
Expand All @@ -40,7 +40,7 @@ async def test_show(flow, scheduler, start, raikura, monkeypatch):
async with start(schd):
await schd.update_data_structure()

with raikura(size='80,40') as rk:
with rakiura(size='80,40') as rk:
rk.user_input('down', 'right')
rk.wait_until_loaded(schd.tokens.id)

Expand Down

0 comments on commit d9669a8

Please sign in to comment.