This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git
The following commit(s) were added to refs/heads/main by this push:
new 621a8ce Ensure that both sorts of license checks are used in report
tests
621a8ce is described below
commit 621a8cebb1ab002853d034777f0cc3d7c53c0db3
Author: Sean B. Palmer <[email protected]>
AuthorDate: Thu Jan 8 17:28:48 2026 +0000
Ensure that both sorts of license checks are used in report tests
---
tests/e2e/helpers.py | 9 +++++++--
tests/e2e/report/conftest.py | 14 +++++++++++++-
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/tests/e2e/helpers.py b/tests/e2e/helpers.py
index 56a244c..bf86a14 100644
--- a/tests/e2e/helpers.py
+++ b/tests/e2e/helpers.py
@@ -16,13 +16,18 @@
# under the License.
import os
-from typing import Final
+from typing import Any, Final
-from playwright.sync_api import Page
+from playwright.sync_api import APIRequestContext, Page
_ATR_BASE_URL: Final[str] = os.environ.get("ATR_BASE_URL",
"https://localhost.apache.org:8080")
+def api_get(request: APIRequestContext, path: str) -> dict[str, Any]:
+ response = request.get(f"{_ATR_BASE_URL}{path}")
+ return response.json()
+
+
def delete_release_if_exists(page: Page, project_name: str, version_name: str)
-> None:
release_name = f"{project_name}-{version_name}"
visit(page, "/admin/delete-release")
diff --git a/tests/e2e/report/conftest.py b/tests/e2e/report/conftest.py
index 4f62009..f9d2824 100644
--- a/tests/e2e/report/conftest.py
+++ b/tests/e2e/report/conftest.py
@@ -91,7 +91,7 @@ def primary_success_toggle(page_report: Page) -> Locator:
@pytest.fixture(scope="module")
-def report_context(browser: Browser) -> Generator[BrowserContext]:
+def report_context(browser: Browser, verify_license_check_mode: None) ->
Generator[BrowserContext]:
"""Create a release with an uploaded file and completed tasks."""
context = browser.new_context(ignore_https_errors=True)
page = context.new_page()
@@ -120,6 +120,18 @@ def report_context(browser: Browser) ->
Generator[BrowserContext]:
context.close()
[email protected](scope="module")
+def verify_license_check_mode(browser: Browser) -> None:
+ """Verify that the test project has the correct license check mode."""
+ context = browser.new_context(ignore_https_errors=True)
+ policy = helpers.api_get(context.request,
f"/api/project/policy/{PROJECT_NAME}")
+ context.close()
+
+ mode = policy.get("policy_license_check_mode", "").upper()
+ if mode == "RAT":
+ pytest.fail(f"Test project has policy_license_check_mode={mode}.
Member results will not be produced.")
+
+
def _wait_for_tasks_banner_hidden(page: Page, timeout: int = 30000) -> None:
"""Wait for all background tasks to be completed."""
page.wait_for_selector("#ongoing-tasks-banner", state="hidden",
timeout=timeout)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]