sphinx-test-reports icon indicating copy to clipboard operation
sphinx-test-reports copied to clipboard

Custom options for test-file and co.

Open danwos opened this issue 4 years ago • 5 comments

Currently test-file and co. do not allow to set values for the extra_options and extra_links. So Sphinx would claim about a not registered option.

test-file and co. should allow all options/links and just copy&paste them to the next level without any interpretation.

This would allow to set values for user specific options/links.

danwos avatar Jun 18 '21 09:06 danwos

@danwos

If this is implemented, does this mean, if I write

.. test-file:: My Test Data
   :file: my_test_data.xml
   :id: TESTFILE_1
   :links: [[tr_link('classname', 'title')]]

the "links" option and the value set (via dynamic function) will be copied over to test-suite, test-case etc. because they are all linked with each other?

Else how do you plan to set a option value for a need like test-case, which would be automatically generated? Is needs_global_options the only way?

twodrops avatar Jun 18 '21 09:06 twodrops

@twodrops Yes, but this is already done for links, status, tags and collapse: See https://sphinx-test-reports.readthedocs.io/en/latest/directives/test_file.html#usage

But this behavior is missing for all other options, especially the ones defined in needs_extra_options and needs_extra_links.

I think this also answers your second question: You set it in test-file and it gets reused for test-suite and test-case.

But needs_global_options can be used as well. However, I think using it in test-file is much easier and more precise, if multiple result-files get documented.

danwos avatar Jun 18 '21 10:06 danwos

ah I missed this part. Thanks for the hint.

All other options like tags, links, status are copied from test-file directive to the autogenerated test-suite and test-case directives.

Yes I agree that this would be a perfect solution than using 'needs_global_options'.

twodrops avatar Jun 18 '21 10:06 twodrops

Hello,

I miss this feature too. Is it planned for an implementation ?

Thanks for your great work

David-Le-Nir avatar Jun 09 '23 10:06 David-Le-Nir

No, nothing planned from my side, as I have currently too much load in other projects.

danwos avatar Jun 22 '23 05:06 danwos