Merge "Check for gitea template rendering errors"

This commit is contained in:
Zuul 2024-01-05 18:52:41 +00:00 committed by Gerrit Code Review
commit de98e3c3c8

View File

@ -112,6 +112,26 @@ def test_partial_project_clone(host):
assert "refs/remotes/origin/main" not in cmd.stdout
assert cmd.succeeded
def test_no_500_template_content(host):
# We discovered that gitea template rendering errors produce 500 errors
# in the rendered template but not in our http response codes. Check a
# number of pages for 500 errors in the html response.
paths_to_check = [
'/',
'/opendev/system-config',
'/opendev/system-config/src/branch/master/playbooks/roles/gitea/tasks/main.yaml',
'/explore/repos',
'/explore/users',
'/explore/organizations',
'/explore/code?q=gitea&t=',
]
for path in paths_to_check:
cmd = host.run('curl --insecure '
'--resolve gitea99.opendev.org:3081:127.0.0.1 '
'https://gitea99.opendev.org:3081' + path)
assert 'status-page-500' not in cmd.stdout
assert 'Internal Server Error' not in cmd.stdout
def test_gitea_screenshots(host):
shots = (