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

Custom options for test-file and co. #17

Open
danwos opened this issue Jun 18, 2021 · 5 comments
Open

Custom options for test-file and co. #17

danwos opened this issue Jun 18, 2021 · 5 comments

Comments

@danwos
Copy link
Member

danwos commented Jun 18, 2021

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.

@twodrops
Copy link

@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?

@danwos
Copy link
Member Author

danwos commented Jun 18, 2021

@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.

@twodrops
Copy link

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'.

@David-Le-Nir
Copy link

Hello,

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

Thanks for your great work

@danwos
Copy link
Member Author

danwos commented Jun 22, 2023

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

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