-
Notifications
You must be signed in to change notification settings - Fork 123
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
Adding new framework (plugin?) #740
Comments
Thanks for the issue, @jackorp. Yeah, the documentation has still a few white spaces... Let's use this issue to track creating a new section for writing plugins. But to quickly answer your questions: If your new plugin would be useful to more users it would make sense to contribute a new pull request here. The
Is that supposed to be a plugin for the discover step?
Plugins are detected from the step folders or from the
Your plugin just needs to inherit from one of the plugin classes e.g. here and define the supported methods.
Your plugin will implement the method as registered above and each method defines its own set of keys. For example Let us know if anything is not clear. |
I am not sure.
Hmm, yes that would be nice if documented. What step folder do you mean? Do you mean
So all I need to do is inherit the class in my plugin, have it somewhere where tmt looks for plugins and then it gets loaded and is ready to be used?
I am not sure what do you mean by this. IOW the example you provided also implies |
Depends on how the plugin is intended to work. I am not very familiar with RSpec so I can't really help more. What is the intended way of integration into tmt? Am I right to assume that you would like to write a test using RSpec and then run it using tmt? In that case, the framework attribute sounds like what you are looking for - you will have to add support for execution using RSpec into the execute step, see for example this: https://github.com/psss/tmt/blob/master/tmt/steps/execute/internal.py#L148
Inside tmt repo, there is
I think what Petr meant here is that you can create fmf fields for a plugin using options, See this https://github.com/psss/tmt/blob/master/tmt/steps/provision/podman.py#L31, lets take a look at
Or through the command-line ( |
This seems like a nice topic to discuss on tmrw's hacking meeting. I believe we should discuss the general guidance here, how much integration with tmt makes sense for different test frameworks. Use case or rspec in this case can be similar to pytest, and other test frameworks for other languages .... |
Yes that sounds like I want to make use of that. Basically, what you said, I want to run RSpec inside tmt and have the results reported using tmt's methods of reporting. I also think that it should support choosing tests to be run. With RSpec, you can define the test file's path and the lines of tests to be run, e.g. However, all that is just a theoretical discussion of what it could / should do at this point.
I see, thanks.
Right, thanks. Now I understand. |
I've tried to do some another way how to solve similar issue for pytest. it is based on changes of FMF what allows custom plugins for discovering data in the files. (then it could be supported inside TMT) so theoretically you can use some already existing plugins inside FMF or create custom one directly in your project. I can imagine something like:
then this discovery step will use FMF custom plugin and allows you e.g. inspect python/ruby test files. |
I'd like to work on an RSpec plugin someday but I don't know how to go about it and there seems to be no documentation present on the topic of writing a plugin. Do I need to open a PR to this repo or can it be a pip library?
Regarding documentation I am missing answers mainly to these questions:
How to implement a plugin of this sort anyway?
What needs to be done?
How to register it with
tmt
?Can I define my own
fmf
fields for configuration?The text was updated successfully, but these errors were encountered: