diagnostics, help: Link to diagnostics page logs in 500 error page

Closes: #2414.

- Remove separate implementation for showing logs in help page.

- Add link to the page in diagnostics app so that FreedomBox logs can more
easily be discovered by users.

Tests:

- Raise an exception in the common error middleware to cause a 500 internal
server error. Run FreedomBox service with the --develop option and notice that
500 error page is served. There, the link to logs page works. It shows the logs
for Diagnostics app.

- Diagnostics page description is update. Link to logs page works.

- Diagnostics page shows logs for plinth.service and freedombox-develop.service.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa authored and Veiko Aasa committed 2025-09-18 16:35:23 +03:00
1 parent e82d959c85
commit 5a55b59939
7 files changed
+20 -106

No files matched your search

@@ -1,38 +0,0 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Functional, browser based tests for help app.
"""
import pytest
from plinth.tests import functional
pytestmark = [pytest.mark.system, pytest.mark.essential, pytest.mark.help]
# TODO Scenario: Visit the wiki
# TODO Scenario: Visit the mailing list
# TODO Scenario: Visit the IRC channel
# TODO Scenario: View the manual
# TODO Scenario: View the about page
@pytest.fixture(scope='module', autouse=True)
def fixture_background(session_browser):
"""Login."""
functional.login(session_browser)
def test_view_status_logs(session_browser):
"""Test viewing the status logs."""
_go_to_status_logs(session_browser)
assert _are_status_logs_shown(session_browser)
def _go_to_status_logs(browser):
functional.visit(browser, '/plinth/help/status-log/')
def _are_status_logs_shown(browser):
status_log = browser.find_by_css('.status-log').first.text
return ('-- No entries --' in status_log
or status_log.strip().splitlines())