add playwright test for kepler dashboard

What does this MR do and why?

Related reference(s)

part of #2119

Test coverage

Tests are done on CI https://gitlab.com/sylva-projects/sylva-core/-/pipelines/1772372755 :

without Kepler deployed, the test is skipped:

$ pytest ./tools/login-test/test_ui_playwright.py --browser firefox -v --tb=short
============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-8.3.5, pluggy-1.5.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /builds/sylva-projects/sylva-core
plugins: base-url-2.1.0, playwright-0.7.0
collecting ... collected 2 items
tools/login-test/test_ui_playwright.py::test_thanos_basic_auth[firefox] PASSED [ 50%]
tools/login-test/test_ui_playwright.py::test_kepler_dashboard[firefox] SKIPPED [100%]

with Kepler deployed (🛠 misc), the test mgmt-GUIs-test is passed:

Get Kepler unit status 00:16
$ export kepler_unit_enabled=$(kubectl --kubeconfig management-cluster-kubeconfig get secrets sylva-units-values -o yaml | yq .data.values | base64 -d | yq .units.kepler.enabled)
$ pytest ./tools/login-test/test_ui_playwright.py --browser firefox -v --tb=short
============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-8.3.5, pluggy-1.5.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /builds/sylva-projects/sylva-core
plugins: base-url-2.1.0, playwright-0.7.0
collecting ... collected 2 items
tools/login-test/test_ui_playwright.py::test_thanos_basic_auth[firefox] PASSED [ 50%]
tools/login-test/test_ui_playwright.py::test_kepler_dashboard[firefox] PASSED [100%]
============================== 2 passed in 11.98s ==============================

N.B. an intermediate step has to be added in Playwright to filter other dashboards (page.goto(grafana_url + "/dashboards?query=kepler")). Otherwise, playwright is unable to find Kepler dashboard link. (cf. failure screenshot)

failure screenshot test_kepler_dashboard_firefox_

failure log

FAILED tools/login-test/test_ui_playwright.py::test_kepler_dashboard[firefox] 
- playwright._impl._errors.TimeoutError: Locator.click: Timeout 30000ms exceeded.

CI configuration

Below you can choose test deployment variants to run in this MR's CI.

Click to open to CI configuration

Legend:

Icon Meaning Available values
☁️ Infra Provider capd, capo, capm3
🚀 Bootstrap Provider kubeadm (alias kadm), rke2
🐧 Node OS ubuntu, suse
🛠️ Deployment Options light-deploy, dev-sources, ha, misc, maxsurge-0
🎬 Pipeline Scenarios Available scenario list and description
  • 🎬 preview ☁️ capd 🚀 kadm 🐧 ubuntu

  • 🎬 preview ☁️ capo 🚀 rke2 🐧 suse

  • 🎬 preview ☁️ capm3 🚀 rke2 🐧 ubuntu

  • ☁️ capd 🚀 kadm 🛠️ light-deploy 🐧 ubuntu

  • ☁️ capd 🚀 rke2 🛠️ light-deploy 🐧 suse

  • ☁️ capo 🚀 rke2 🐧 suse 🎬 simple-update-no-wkld

  • ☁️ capo 🚀 rke2 🐧 suse 🎬 simple-update-no-wkld 🛠️ misc

  • ☁️ capo 🚀 kadm 🐧 ubuntu

  • ☁️ capo 🚀 rke2 🎬 rolling-update 🛠️ ha 🐧 ubuntu

  • ☁️ capo 🚀 kadm 🎬 wkld-k8s-upgrade 🐧 ubuntu

  • ☁️ capo 🚀 rke2 🎬 rolling-update-no-wkld 🛠️ ha,misc 🐧 suse

  • ☁️ capo 🚀 rke2 🎬 sylva-upgrade-from-1.3.x 🛠️ ha,misc 🐧 ubuntu

  • ☁️ capm3 🚀 rke2 🐧 suse

  • ☁️ capm3 🚀 kadm 🐧 ubuntu

  • ☁️ capm3 🚀 kadm 🎬 rolling-update-no-wkld 🛠️ ha,misc 🐧 ubuntu

  • ☁️ capm3 🚀 rke2 🎬 wkld-k8s-upgrade 🛠️ ha 🐧 suse

  • ☁️ capm3 🚀 kadm 🎬 rolling-update 🛠️ ha 🐧 ubuntu

  • ☁️ capm3 🚀 rke2 🎬 sylva-upgrade-from-1.3.x 🛠️ misc,ha 🐧 suse

  • ☁️ capm3 🚀 kadm 🎬 rolling-update 🛠️ ha 🐧 suse

Global config for deployment pipelines

  • autorun pipelines
  • allow failure on pipelines
  • record sylvactl events

Notes:

  • Enabling autorun will make deployment pipelines to be run automatically without human interaction
  • Disabling allow failure will make deployment pipelines mandatory for pipeline success.
  • if both autorun and allow failure are disabled, deployment pipelines will need manual triggering but will be blocking the pipeline

Be aware: after configuration change, pipeline is not triggered automatically. Please run it manually (by clicking the run pipeline button in Pipelines tab) or push new code.

Edited by Yiping Chen

Merge request reports

Loading