Skip to content

fix: SonarQube report - refs #305404#6

Open
avoinea wants to merge 6 commits into
developfrom
fix-sonarqube
Open

fix: SonarQube report - refs #305404#6
avoinea wants to merge 6 commits into
developfrom
fix-sonarqube

Conversation

@avoinea

@avoinea avoinea commented Jul 8, 2026

Copy link
Copy Markdown
Member

Problem

After Jenkins pipeline update, test libraries changed behavior. Previously, skipped tests still generated empty XML report files. Now, no XML files are generated when tests are skipped. SonarQube scan fails because coverage/junit-results/testreports/*.xml glob matches nothing.

Root Cause

Packages had only test_doctests.py using legacy Plone testing (plone.testing.z2, PloneSandboxLayer, FUNCTIONAL_TESTING layer). These doctests loaded README.txt files with no actual doctest content (>>> lines) → always skipped → no test report generated.

Fix

  • Removed dead test_doctests.py and base.py (legacy Plone 4/5 testing infrastructure)
  • Added real unit tests using unittest.TestCase that actually run and generate test reports
  • Tests use pure functions / light mocking, no Plone integration layer needed

Refs #305404

avoinea and others added 6 commits July 8, 2026 17:50
Remove testing.py and test_setup_integration.py that caused:
- ModuleNotFoundError: wrong import path (package.testing vs package.tests.testing)
- TypeError: testing.py picked up as test module by zope.testrunner but has no test_suite()

Unit tests in test_*.py are sufficient for SonarQube XML report generation.
Matches the pattern used by eea.website.policy (PR #17) and all 13 working packages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant