Repository navigation
Share the page machinery of the unit test reports with other reports - #25
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Documentation | 4 minor |
| CodeStyle | 14 minor |
🟢 Metrics 12 complexity · 0 duplication
Metric Results Complexity 12 Duplication 0
🟢 Coverage 96.49% diff coverage · +0.36% coverage variation
Metric Results Coverage variation ✅ +0.36% coverage variation (-1.00%) Diff coverage ✅ 96.49% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (17841b8) 3070 2460 80.13% Head commit (13a3e92) 3121 (+51) 2512 (+52) 80.49% (+0.36%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#25) 228 220 96.49% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #25 +/- ##
==========================================
+ Coverage 77.49% 77.85% +0.36%
==========================================
Files 19 20 +1
Lines 3070 3121 +51
Branches 448 449 +1
==========================================
+ Hits 2379 2430 +51
+ Misses 610 609 -1
- Partials 81 82 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
af9f777 to
3c4c465
Compare
The generation of pages from a report - document names, registration, generation, navigation, references - moves from 'UnittestReportPages' into the base-class 'ReportPages' of the new module 'pyTooling.Sphinx.Pages'. A derived class names an object, lists its children and builds its page. The domain 'report' serves any role referring to the objects of reports with pages: 'UnittestEntry' becomes 'ReportEntry', which carries the separator of its qualified name, 'UnittestRole' becomes 'ReportRole', and the table 'REPORT_ROLES' names per role the object type and the configuration value declaring its reports. The domain data is keyed by role; its version is raised, so a pickled environment of the old layout is dropped. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
'ReportPages.CheckPagesConfiguration' validates and normalizes the document name a report's pages are generated below, so every kind of report with pages checks it the same way. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
3c4c465 to
628335c
Compare
…es' is a tuple 'GetPages' returned None for a report without pages, for its callers to detect. It raises KeyError now; 'HasPages' asks first. 'DocNames' is a view of the generated documents, so it returns a tuple (review). Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
The example moves into a description paragraph below the summary (review rule of edaa-org/pyEDAA.Reports#271). Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
'GetPages' raises KeyError for a report without pages (#25 review). The summary table asks 'HasPages' instead of passing None-or-pages down to '_NameCell'. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
The machinery generating pages from a unit test report becomes shared, so the code coverage report gets its pages the same way (#26, stacked on this one).
Changes
pyTooling.Sphinx.Pages(new):ReportPages, the base-class of a report's pages. Moved there fromUnittestReportPages: the document names (UNSAFE_CHARACTERS, collision suffixes), registering and generating the pages, the hidden tables of contents and the navigation without the pages' own sections,GetPages(),GenerateAll(),HideSource(),Entry(),DocNames, the helpers for fields and tables, andCreateReference()(wasUnittestSummary.CreateReference()). A derived class names an object (_Name(),_Title()), lists its children (_Children()) and builds its page (_Page()).ReportPages.CheckPagesConfiguration()checks and normalizes a report's keypages, whichUnittestSummarychecked itself.pyTooling.Sphinx.UnittestPages.UnittestReportPagesderives fromReportPages; the pages are unchanged.pyTooling.Sphinx: the domainreportserves any role referring to the objects of reports with pages.UnittestEntry→ReportEntry, which carries the separator of its qualified name (.for testcases).UnittestRole→ReportRole.UNITTEST_ROLES→REPORT_ROLES: per role aReportRoleDefinition- object type, configuration value declaring its reports, and how a warning names them.ReportDomain.AddUnittestEntry()/FindUnittestEntries()→AddEntry()/FindEntries(); the domain data is keyed by role (tc,ts), anddata_versionis raised, so a pickled environment of the old layout is dropped.Unit Tests
Changes after opening
dev(Expand the dependency tables without a depth limit #27 dependency tables without depth limit, tree: descriptions in a second column #29 tree descriptions); no conflicts, no code changes.ReportPages.GetPagesraisesKeyErrorfor a report without pages instead of returningNone; the newHasPagesasks first.DocNamesreturns a tuple. (f135bb1)ReportRole: the example moved out of the doc-string's summary line. (13a3e92)Related Issues and Pull-Requests