Skip to content

Drive the dialect matrix through the command line - #168

Open
eda-s-claude-bot[bot] wants to merge 5 commits into
devfrom
claude/app-testing-dialect-matrix
Open

Drive the dialect matrix through the command line#168
eda-s-claude-bot[bot] wants to merge 5 commits into
devfrom
claude/app-testing-dialect-matrix

Conversation

@eda-s-claude-bot

@eda-s-claude-bot eda-s-claude-bot Bot commented Aug 16, 2026

Copy link
Copy Markdown

New Features

  • tests/app/JUnitDialects.py runs the dialect conversion matrix through the command line: one class per
    source dialect, one testcase per target, each invoking pyedaa-reports unittest --merge=… --output=…,
    validating the written report against the target schema and reading it back with the target dialect.

    The unit-level matrix in tests/unit/JUnitDialects/ exercises readers and writers directly. This one covers
    what only the installed program can: argument parsing, dialect dispatch, console-script wiring and exit codes.
    The two are deliberately the same shape - a difference between them is a defect in the layer this one adds.

  • It uses pyTooling.Testing.ApplicationTestcaseMixin (pyTooling#266)
    instead of another copy of the subprocess helper.

Known Issues

Two things only this level sees, both encoded as testcases in TheCommandLineVocabulary:

  • The command line has its own dialect vocabulary. _merge splits the argument on - and expects the second
    part to be junit, so the names the schemas and reports use are rejected:

    What the schemas/reports call it What the command line wants
    Ant-JUnit4 Ant-JUnit
    GoogleTest-JUnit gtest-JUnit
  • Any-JUnit can be read but not written - _output has no branch for it, so
    --output=Any-JUnit:… reports Unsupported JUnit XML dialect for writing.

    Neither is fixed here; this pull-request records the behaviour so a decision about it is visible.

Unit Tests

  • 23 testcases: the 5×4 conversion matrix (Any-JUnit cannot be written, so it is a source only) plus three for
    the vocabulary.
  • tests/app: 8 → 31 passed.

Related Issues and Pull-Requests

  • Stacked on #167. Without it, six cells of this matrix
    fail at application level while passing at unit level - which is how that defect was found.

  • Needs pyTooling.Testing from pyTooling#266. The floor is
    raised in the main requirements.txt (pyTooling[terminal] >= 8.21, < 10.0) with doc/Dependency.rst
    bumped alongside - a derived requirements file must not name a package its included file already carries.

    This branch cannot go green before that release. pyTooling.Testing is not part of v8.20.0, so >= 8.21
    is a floor that does not exist on PyPI yet; pip install --dry-run fails accordingly.

claude-code and others added 2 commits August 16, 2026 17:53
MergedTestsuiteSummary.Merge() never touched _startTime, so every merged report lost it - the same shape as the
hostname before #162. A merged entity started when the earliest of its parts started, and an entity without a
start time contributes nothing rather than erasing what is known. The rule lives on the Merged mixin, so the
summary and the test suite share it.

Found through the command line: 'pyedaa-reports unittest --merge=Ant-JUnit:... --output=CTest-JUnit:...' failed
with "The CTest + JUnit format requires a timestamp on <testsuite>, but the report has none", although the same
conversion works when the reader hands its document straight to the writer. The merge in between was dropping it.
Six conversions were affected: Ant, CTest and GoogleTest into CTest and GoogleTest.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
The unit-level matrix exercises readers and writers directly. This one runs 'pyedaa-reports' as a user does, so
argument parsing, dialect dispatch, console-script wiring and exit codes are covered too - and the two matrices
being the same shape is the point: a difference between them is a defect in the layer this one adds.

It uses pyTooling.Testing.ApplicationTestcaseMixin rather than another copy of the subprocess helper.

Two things only this level can see, both encoded here:

* The command line has its own vocabulary. A dialect is spelled '<dialect>-JUnit' and split on '-', so the names
  the schemas and reports use - 'Ant-JUnit4' and 'GoogleTest-JUnit' - are rejected; it wants 'Ant-JUnit' and
  'gtest-JUnit'. 'Any-JUnit' can be read but not written: _output has no branch for it.
* A format limit can bite when writing or only when reading back. 'Any-JUnit' to 'pyTest-JUnit' writes happily -
  'timestamp' is optional in PyTest-JUnit.xsd - and fails on the way back in, because the reader requires it. The
  chain is what has to fail, not a particular command.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
@eda-s-claude-bot
eda-s-claude-bot Bot requested a review from Paebbels as a code owner August 16, 2026 17:54
@Paebbels Paebbels added FileFormat: XML XML file format Unit Testing Unit test summaries labels Aug 16, 2026
@eda-s-claude-bot eda-s-claude-bot Bot added the FileFormat: XML XML file format label Aug 16, 2026
@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 12.50000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 31.68%. Comparing base (469beb1) to head (a1a7184).

Files with missing lines Patch % Lines
pyEDAA/Reports/Unittesting/__init__.py 12.50% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #168      +/-   ##
==========================================
- Coverage   31.74%   31.68%   -0.07%     
==========================================
  Files           9        9              
  Lines        2498     2506       +8     
  Branches      396      398       +2     
==========================================
+ Hits          793      794       +1     
- Misses       1705     1712       +7     
Flag Coverage Δ
unittests 31.68% <12.50%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

claude-code and others added 2 commits August 16, 2026 18:17
tests/app/requirements.txt already includes ../../requirements.txt, which carries pyTooling. Naming it again
there duplicates the dependency and breaks packaging, so the floor is raised in the main file instead - and
doc/Dependency.rst with it, because that is what gets forgotten.

The floor is 8.21: pyTooling.Testing is not part of v8.20.0. This branch cannot go green before the release that
ships it.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
It describes how the code got here rather than what a reader needs; the rule lives in the coding guidelines.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
pyTooling.Testing was merged into pyTooling's dev branch before v8.20.0 was released, so the module ships in that
release rather than the next one.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
@eda-s-claude-bot

Copy link
Copy Markdown
Author

pyTooling.Testing was merged into pyTooling's dev before v8.20.0 went out, so it ships in that release rather than the next: the floor is >= 8.20 again (requirements.txt and doc/Dependency.rst). This branch still cannot go green until pyTooling#267 is released to PyPI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FileFormat: XML XML file format Unit Testing Unit test summaries

Development

Successfully merging this pull request may close these issues.

2 participants