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

Test Report fails if report's ID is not in the allowed tags #59

Open
ntouran opened this issue Feb 24, 2023 · 1 comment
Open

Test Report fails if report's ID is not in the allowed tags #59

ntouran opened this issue Feb 24, 2023 · 1 comment

Comments

@ntouran
Copy link

ntouran commented Feb 24, 2023

I have sphinx-needs configured with a very specific set of allowed tags. But sphinx-test-reports always includes the report ID as a tag, and so each individual report I make fails with invalid tags:

Sphinx error:
Tag REPORT2 of need id REPORT2 is not allowed by config value 'needs_tags'.

Input causing this looks like:

.. test-report:: Unit Test Results
   :id: REPORT
   :file: ../proj/unit-test-results/proj-unit-test-results.xml

.. test-report:: Cypress Tests
   :id: REPORT2
   :tags: REPORT
   :file: ../frontend/proj/results/proj-e2e-test-output-5b4d6459a038b4cd8595b7b99702.xml

Seems that this is coming from here:

"tags": ";".join([self.test_tags, self.test_id])

where it hard-codes adding the test ID as a tag. Should this be removed? What purpose is this serving? Can I make a PR to remove that feature, or should it be a new setting to toggle it off?

@danwos
Copy link
Member

danwos commented Feb 24, 2023

Thanks for reporting.

For backwards compatibility I would add a config option to switch it off or maybe even better an option which allows to configure the tag-string. This could be done by supporting Jinja and add test_tags and test_id to the Jinja context.

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

2 participants