Skip to content

Commit 2242004

Browse files
cbeauchesneclaude
andauthored
Remove the JSON report (#8628)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 084cfe2 commit 2242004

11 files changed

Lines changed: 10 additions & 70 deletions

File tree

‎.gitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ bld/
3333
[Oo]bj/
3434
[Ll]og/
3535
dist/
36-
.report.json
3736

3837
!lib-injection/build/docker/ruby/lib_injection_rails_app/bin
3938
!utils/build/docker/ruby/rails52/bin

‎LICENSE-3rdparty.csv‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ click,PyPI,BSD-3-Clause,Armin Ronacher
44
requests,PyPI,Apache-2.0,Kenneth Reitz
55
Werkzeug,PyPI,BSD-3-Clause,Armin Ronacher
66
pytest,PyPI,MIT,"Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna Laugher, Florian Bruhin and others"
7-
pytest-json-report,PyPI,MIT,numirias
87
black,PyPI,MIT,Łukasz Langa
98
python-dateutil,PyPI,Apache-2.0,Gustavo Niemeyer
109
packaging,PyPI,Apache-2.0,Donald Stufft and individual contributors

‎conftest.py‎

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import pytest
1717
from _pytest.junitxml import xml_key
1818
from pluggy._result import _Result as Result
19-
from pytest_jsonreport.plugin import JSONReport
2019

2120
from utils import context
2221
from utils._context.junit_parameters import fingerprint_parameters
@@ -30,9 +29,6 @@
3029
from utils.manifest import Manifest
3130
from utils.properties_serialization import SetupProperties
3231

33-
# Monkey patch JSON-report plugin to avoid noise in report
34-
JSONReport.pytest_terminal_summary = lambda *args, **kwargs: None # noqa: ARG005
35-
3632
# pytest does not keep a trace of deselected items, so we keep it in a global variable
3733
_deselected_items: list[pytest.Item] = []
3834
setup_properties = SetupProperties()
@@ -221,7 +217,6 @@ def pytest_configure(config: pytest.Config) -> None:
221217
pytest.exit(f"Scenario {config.option.scenario} does not exist", 1)
222218

223219
if not config.option.replay and not config.option.collectonly:
224-
config.option.json_report_file = f"{context.scenario.host_log_folder}/report.json"
225220
config.option.xmlpath = f"{context.scenario.host_log_folder}/reportJunit.xml"
226221

227222
configure_decorators(config)
@@ -525,15 +520,17 @@ def pytest_fixture_setup(
525520

526521

527522
@pytest.hookimpl(hookwrapper=True)
528-
def pytest_runtest_makereport(item: pytest.Item, call: pytest.CallInfo) -> Generator[None, Result, None]: # noqa: ARG001
523+
def pytest_runtest_makereport(item: pytest.Item, call: pytest.CallInfo) -> Generator[None, Result, None]:
524+
if call.when == "setup":
525+
_collect_item_metadata(item)
526+
529527
# Run all other hooks to get the report object
530528
outcome = yield
531529
rep: pytest.TestReport = outcome.get_result()
532530

533531
if rep.when == "call": # only attach outcome after test call
534532
# rep.outcome is one of: passed, failed, skipped
535-
# but json_report also distinguishes xfailed/xpassed
536-
# via rep.wasxfail and outcome
533+
# xfailed/xpassed are distinguished via rep.wasxfail and outcome
537534
value = rep.outcome
538535
if getattr(rep, "wasxfail", None):
539536
if rep.outcome == "skipped":
@@ -558,21 +555,6 @@ def _set_outcome_properties(outcome: PytestOutcome, user_properties: list[tuple]
558555
user_properties.append(("dd_tags[test.final_status]", final_status))
559556

560557

561-
@pytest.hookimpl(optionalhook=True)
562-
def pytest_json_runtest_metadata(item: pytest.Item, call: pytest.CallInfo) -> dict | None:
563-
if call.when != "setup":
564-
return {}
565-
566-
return _collect_item_metadata(item)
567-
568-
569-
def pytest_json_modifyreport(json_report: dict) -> None:
570-
# add usefull data for reporting
571-
json_report["context"] = context.serialize()
572-
573-
logger.debug("Modifying JSON report finished")
574-
575-
576558
def pytest_sessionfinish(session: pytest.Session, exitstatus: int) -> None:
577559
logger.info("Executing pytest_sessionfinish")
578560

‎docs/execute/logs.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ System tests export a lot of data in `logs/` folder, and this folder is usually
88
* `logs/interfaces/agent`: **agent -> bakcend communication, key folder if you own an agent**
99
* `logs/interfaces.log`: Debug log of what's happening on interfaces
1010
* `logs/pytest.log`: **Entire debug, including `logs/interfaces.log`, lot of infos here**
11-
* `logs/report.json`: Technical data about the test run, will be exported to dashboard
11+
* `logs/reportJunit.xml`: Test results in JUnit format, exported to Test Optimization
1212
* `logs/weblog_image.json`: Result of `docker inspect` on [weblog](../edit/weblog.md) images

‎docs/understand/scenarios/k8s_lib_injection.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ In the following image you can see the log folder content:
479479
These are the main important log/data files:
480480

481481
* **test.log:** General log generated by system-tests.
482-
* **report.json:** Pytest results report.
482+
* **reportJunit.xml:** Pytest results report in JUnit XML format.
483483
* **lib-injection-testing-xyz-config.yaml:** The kind cluster configuration. In this file you can check the open ports for each cluster and test case.
484484
* **lib-injection-testing-xyz_help_values:** Helm chart operator values for each test case.
485485
* **daemon.set.describe.log:** Datadog Cluster daemon set logs.

‎docs/understand/scenarios/onboarding.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,6 @@ These are the main important log/data files:
796796
## Root Level Files
797797

798798
* **tests.log:** General log generated by system-tests. Here you will see the Pulumi outputs of the remote provisions.
799-
* **report.json:** Pytest results report in JSON format.
800799
* **reportJunit.xml:** Pytest results report in JUnit XML format.
801800
* **known_versions.json:** Contains information about the known versions of components used in the test.
802801
* **setup_properties.json:** Contains the setup properties and configuration used for the test execution.

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ packages = ["tests", "utils", "manifests"]
1010
dependencies = {file = ["requirements.txt"]}
1111

1212
[tool.pytest.ini_options]
13-
addopts = "--json-report --json-report-indent=2 --color=yes --no-header -r Xf"
13+
addopts = "--color=yes --no-header -r Xf"
1414
testpaths = [
1515
"tests",
1616
]

‎requirements.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pulumi-aws==6.38.0 #On Boarding requirements
2626
pulumi-command==0.11.1 #On Boarding requirements
2727
pulumi-tls==5.0.3 #On Boarding requirements
2828
pulumi==3.116.0 #On Boarding requirements
29-
pytest-json-report==1.5.0
3029
pytest-split==0.9.0
3130
pytest-xdist==3.2.1
3231
pytest==7.1.3

‎utils/ci/gitlab/main.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ variables:
110110
# + utils/ci/gitlab/validate_param_env.py, which is copied into the image)
111111
# Update this when any of these files changes:
112112
# cat utils/ci/gitlab/docker/system-tests.Dockerfile requirements.txt utils/ci/gitlab/validate_param_env.py | sha256sum | cut -c1-12
113-
CI_IMAGE: "registry.ddbuild.io/system-tests/ci-runner:9eb0426b57c3"
113+
CI_IMAGE: "registry.ddbuild.io/system-tests/ci-runner:ebfc794bf64e"
114114
SYSTEM_TESTS_SPLIT_PIPELINE: "$[[ inputs.split_pipeline ]]"
115115

116116
.system_tests_param_base:

‎utils/scripts/gitlab_print_logs.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if [ -f "${COLLAPSIBLE_LOGS_SCRIPT}" ]; then
2525
while IFS= read -r -d '' file; do
2626
section_id=$(printf '%s' "$file" | tr -c '[:alnum:]' '_')
2727
bash "${COLLAPSIBLE_LOGS_SCRIPT}" "$file" "logs_${LABEL}_${section_id}" "Logs for ${LABEL} - ${file}"
28-
done < <(find reports -type f \! -name report.json \! -name tests.log -print0)
28+
done < <(find reports -type f \! -name tests.log -print0)
2929
else
3030
echo "Skipping collapsible log dump: ${COLLAPSIBLE_LOGS_SCRIPT} not found"
3131
fi

0 commit comments

Comments
 (0)