Skip to content

Commit 2cf889a

Browse files
Merge pull request #998 from NHSDigital/separate-jira-integration
Separate jira integration
2 parents 53c4cbf + fae41a7 commit 2cf889a

File tree

13 files changed

+46
-2772
lines changed

13 files changed

+46
-2772
lines changed

.env.generic

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ ADDITIONAL_FEATURE_FLAGS=
2323

2424
SCREENSHOT_ALL_STEPS=false
2525

26-
# JIRA Integration
26+
# JIRA Integration (provided by pytest-jira-zephyr-reporter package)
27+
# Package repository: https://github.com/NHSDigital/pytest-jira-zephyr-reporter
28+
# All environment variables below are optional; if not configured, tests run without Jira reporting
2729
JIRA_INTEGRATION_ENABLED=false
2830
JIRA_REPORTING_URL=https://pathtolive-jira.digital.nhs.uk
2931
JIRA_API_TOKEN=

.github/workflows/end-to-end-tests-release.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ jobs:
276276
IMMS_API_KID: ${{ secrets.IMMS_API_KID }}
277277
IMMS_API_PEM: ${{ secrets.IMMS_API_PEM }}
278278
# JIRA Integration Environment Variables
279+
# Provided by pytest-jira-zephyr-reporter package
280+
# Package: https://github.com/NHSDigital/pytest-jira-zephyr-reporter
279281
JIRA_INTEGRATION_ENABLED: ${{ vars.JIRA_INTEGRATION_ENABLED }}
280282
JIRA_REPORTING_URL: ${{ vars.JIRA_REPORTING_URL }}
281283
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

mavis/test/__init__.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,23 @@
4343
year_groups,
4444
)
4545
from .hooks import pytest_sessionfinish, pytest_sessionstart
46-
from .jira_integration.hooks import (
47-
pytest_configure,
48-
pytest_runtest_makereport,
49-
pytest_runtest_setup,
50-
pytest_runtest_teardown,
51-
)
46+
47+
# Note: Jira integration hooks are now provided by pytest-jira-zephyr-reporter package
48+
# and auto-register via pytest entry points.
49+
# Explicit imports below for backwards compatibility.
50+
try:
51+
from pytest_jira_zephyr_reporter.hooks import (
52+
pytest_configure,
53+
pytest_runtest_makereport,
54+
pytest_runtest_setup,
55+
pytest_runtest_teardown,
56+
)
57+
except ImportError:
58+
# If package is not installed, define no-op hooks
59+
pytest_configure = None
60+
pytest_runtest_makereport = None
61+
pytest_runtest_setup = None
62+
pytest_runtest_teardown = None
5263

5364
__all__ = [
5465
"add_vaccine_batch",

mavis/test/hooks.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,19 @@
44
from _pytest.main import Session
55
from _pytest.reports import TestReport
66

7-
from mavis.test.jira_integration.hooks import pytest_sessionfinish as jira_sessionfinish
87
from mavis.test.utils import get_current_datetime
98

9+
# Import from external package
10+
try:
11+
from pytest_jira_zephyr_reporter.hooks import (
12+
pytest_sessionfinish as jira_sessionfinish,
13+
)
14+
except ImportError:
15+
# If package not installed, use no-op function
16+
def jira_sessionfinish(session: Session, exitstatus: int) -> None:
17+
pass
18+
19+
1020
path = Path("logs") / "report.log"
1121

1222

mavis/test/jira_integration/README.md

Lines changed: 0 additions & 93 deletions
This file was deleted.

mavis/test/jira_integration/__init__.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)