Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with zope.testrunner 6.3 #28

Open
mauritsvanrees opened this issue Feb 10, 2024 · 2 comments
Open

Problems with zope.testrunner 6.3 #28

mauritsvanrees opened this issue Feb 10, 2024 · 2 comments
Assignees

Comments

@mauritsvanrees
Copy link
Member

Some of the collective.xmltestreport code was merged into zope.testrunner 6.3. When I upgrade the Plone 6.0 core development buildout to use that version, I get an error:

$ bin/test -u
Traceback (most recent call last):
  File "/Users/maurits/community/plone-coredev/6.0/bin/test", line 297, in <module>
    import collective.xmltestreport.runner
  File "/Users/maurits/shared-eggs/cp311/collective.xmltestreport-2.0.2-py3.11.egg/collective/xmltestreport/runner.py", line 36, in <module>
    group.add_argument(
  File "/Users/maurits/.pyenv/versions/3.11.7/lib/python3.11/argparse.py", line 1468, in add_argument
    return self._add_action(action)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/maurits/.pyenv/versions/3.11.7/lib/python3.11/argparse.py", line 1670, in _add_action
    action = super(_ArgumentGroup, self)._add_action(action)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/maurits/.pyenv/versions/3.11.7/lib/python3.11/argparse.py", line 1482, in _add_action
    self._check_conflict(action)
  File "/Users/maurits/.pyenv/versions/3.11.7/lib/python3.11/argparse.py", line 1619, in _check_conflict
    conflict_handler(action, confl_optionals)
  File "/Users/maurits/.pyenv/versions/3.11.7/lib/python3.11/argparse.py", line 1628, in _handle_conflict_error
    raise ArgumentError(action, message % conflict_string)
argparse.ArgumentError: argument --xml: conflicting option string: --xml

The changelog for zope.testrunner provides a hint:

Add new –xml path option to write JUnit-like XML reports. Code comes from collective.xmltestreport, but be aware that here –xml is not a boolean, but expects a path!

It is not clear to me what to do though. Does collective.xmltestreport need an update? Should we stop using it, and use zope.testrunner directly? Do we need a change in tests.cfg?

Depending on the answer, it might be better to only do this in Plone 6.1, not 6.0.

@davisagli
Copy link
Member

If I understand the change correctly, we should stop using collective.xmltestreport, and now pass --xml [path] where path is where we want the reports to go.

@gforcada
Copy link
Member

Yes, all code from c.xmltestreport has been merged in zope.testrunner so we don't need it, we need to replace it with zc.recipe.testrunner and set a path for the --xml option.

As soon as we update plone/meta to use it as well, we can start getting junit reports in GitHub as well 🤩

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

No branches or pull requests

3 participants