On 7/31/25 4:12 PM, Cristian Le via devel wrote:
On 2025/07/31 15:42, Pavol Sloboda wrote:
Hello,
I am currently reworking the tests for bodhi for Mariadb from STI to
TMT as per the fedora change [0] and I came across an issue with the
versioned vs unversioned rpms of Mariadb (this issue seems to be
present in the STI tests as well), where the versioned mariadb rpms
are named differently than the unversioned ones and I want to
preferably keep the same tests for both kinds of packages by setting
a flag for tmt or using the `-e` flag (or any other option) in `tmt
run` to set an environment variable during the testing process in
bodhi. Is there a way to do something like this? How exactly are the
tests called inside of bodhi? I have gone over the documentation but
I haven't found anything on this topic.
A bit more context on the tests being run is needed. Iiuc, you have a
repo with common tests for multiple Mariadb packages which differ by
either installed package or cli names or equivalent in the test files?
For the former, testing-farm currently installs all packages (although
it is desired to get rid of that) so it might not be an issue there.
For the latter it depends on how you structure the tests. Ideally the
tests are shared and the plans are divergent in each repo, then you
can add either an environment variable [1] from which you can change
the tests execution. Recently you can do that with `plan.import` as
well, but I haven't experimented with it to tell you if there are any
pitfalls, but feel free to try that if you have different test
organization you want to use.
I started writing a similar message...
WRT importing plans, it works great AFAICT, last time I had time to look
at testing of rubygem packages that's the approach I came with, as what
I wrote was common enough, but needed
a different env variable here and there.
https://src.fedoraproject.org/tests/rubygem-cucumber
And example of importing the plan & changing some part of it for
specificity of the package:
https://src.fedoraproject.org/rpms/rubygem-cucumber-wire/blob/704612fab9ddff70e0c874007e9bc5deac8d0cd2/f/plans/all.fmf
It doesn't really differ FWICT from the previous approach that is still
visible on other package (well, less repetition...)L
https://src.fedoraproject.org/rpms/rubygem-cucumber-cucumber-expressions/blob/4bee418fb33a546802c8779e291f172cdc15fde8/f/plans/all.fmf
Though I'd note these packages are not gated necessarily, other than
having maintainer stop themself when something fails.
BTW if the plan is fully imported and is inheriting prepare step, and
other things (which it seems it should),
then it should be as simple as just specifying `prepare+:` to install
the package you desire.
But, as was mentioned, testing-farm takes IIRC care that there is the
newest package that is relevant for the testing (e.g. testing the gated
package, not current fedora repo's package)
Regards,
Jarek
[1]: https://tmt.readthedocs.io/en/stable/spec/plans.html#environment
--
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives:
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it:
https://pagure.io/fedora-infrastructure/new_issue