Skip to content

Commit 37dc894

Browse files
committed
Upgrade Cylc Review to Python 3
1 parent 2df63c7 commit 37dc894

34 files changed

+2434
-672
lines changed

.github/workflows/test.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,21 @@ jobs:
5858
with:
5959
cylc_flow: true
6060
cylc_flow_opts: ''
61+
editable_installations: true
62+
63+
- name: bodge
64+
run: |
65+
# This is a bodge to make this branch work before companion branches
66+
# merged:
67+
pip install -e git+https://github.com/wxtim/cylc@feat.cylc-review#egg=cylc-flow --no-deps
6168
6269
- name: install cylc-uiserver
63-
run: pip install -e .[all]
70+
run: |
71+
pip install -e .[all]
6472
6573
- name: Style test
6674
if: startsWith(matrix.os, 'ubuntu')
67-
run: flake8
75+
run: flake8 cylc/uiserver/* tests/unit/* tests/integration/*
6876

6977
- name: Type checking
7078
if: startsWith(matrix.os, 'ubuntu')
@@ -76,8 +84,36 @@ jobs:
7684
- name: Test
7785
run: pytest
7886

87+
- name: Cylc Review tests
88+
run: |
89+
CONF_PATH="$HOME/.cylc/flow/8"
90+
mkdir -p "$CONF_PATH"
91+
touch "$CONF_PATH/global.cylc"
92+
ln -s "$CONF_PATH/global.cylc" "$CONF_PATH/global-tests.cylc"
93+
94+
cat >> "$CONF_PATH/global.cylc" <<__HERE__
95+
[platforms]
96+
[[_local_background_indep_tcp]]
97+
hosts = localhost
98+
install target = localhost
99+
ssh command = ssh -oBatchMode=yes -oConnectTimeout=8 -oStrictHostKeyChecking=no
100+
__HERE__
101+
102+
# Check that Cylc Review is ready to run
103+
# (We're only interested if it emits an error):
104+
cylc review --help > /dev/null || exit 1
105+
106+
# Run tests on Cylc Review
107+
export CYLC_COVERAGE=1
108+
./etc/bin/run-functional-tests
109+
79110
- name: Coverage report
80111
run: |
112+
echo pwd:
113+
pwd
114+
echo ls:
115+
ls
116+
coverage combine --append src/cylc-flow
81117
coverage xml --ignore-errors
82118
coverage report
83119

cylc/uiserver/cylc_review/template/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
{% if logo -%}
1616
<img {{logo}} />
1717
{% endif -%}
18+
{% if jupythub_base %}
19+
<a href="{{jupythub_base}}">Return to Cylc GUI</a>
20+
{% endif %}
1821
<h1>{{title}} <small>@ {{host}}</small></h1>
1922
<p>Browse User Suite-logs on HTTP</p>
2023
<p class="pull-right"><small>Cylc {{cylc_version}}</small></p>

cylc/uiserver/cylc_review/template/suite-base.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
<span class="icon-bar"></span>
3030
<span class="icon-bar"></span>
3131
</button>
32+
33+
{% if jupythub_base %}
34+
<a class="navbar-brand" href="{{jupythub_base}}">Cylc GUI</a>
35+
<div class="navbar-brand">|</div>
36+
{% endif %}
3237
<a class="navbar-brand" href="{{script}}/">
3338
{% if logo -%}
3439
<img {{logo}} />

cylc/uiserver/cylc_review/template/suites.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
<span class="icon-bar"></span>
2525
<span class="icon-bar"></span>
2626
</button>
27+
{% if jupythub_base %}
28+
<a class="navbar-brand" href="{{jupythub_base}}">Cylc GUI</a>
29+
<div class="navbar-brand">|</div>
30+
{% endif %}
2731
<a class="navbar-brand" href="{{script}}/">
2832
{% if logo -%}
2933
<img {{logo}} />

cylc/uiserver/jupyter_config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
)
2525
from cylc.uiserver.app import USER_CONF_ROOT
2626
from cylc.uiserver.authorise import CylcAuthorizer
27+
from cylc.uiserver.ws import get_review_service_config
2728

2829

2930
# the command the hub should spawn (i.e. the cylc uiserver itself)
@@ -104,3 +105,7 @@
104105
# Lab as a result of being granted the ``access:servers`` permission in Jupyter
105106
# Hub.
106107
c.ServerApp.authorizer_class = CylcAuthorizer
108+
109+
110+
# Setup Cylc Review
111+
c.JupyterHub.services = [get_review_service_config()]

0 commit comments

Comments
 (0)