-
Notifications
You must be signed in to change notification settings - Fork 119
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
Running upstream tests in Fedora dist-git needs upstream tarball discovery or flexible ref: -- still needs #978 #585
Comments
Yes, this seems to be a demanded feature. Let's try to find a solution for this soon. Proposing for 1.5. |
Possible temporary workaround I'm using for referencing So the only thing I need to do when releasing a new |
Hi @psss, your solution is great. However, it has a problem that the tests will fail during time between upstream and downstream release is done. In that period the upstream test branch will point to the tests which are not yet in gating. |
Yes, yes, just a workaround, not very perfect... ;-) |
As of today, Fedora dist-git FMF test plans have to specify a git repo and fixed ref for where to find the tests to run. (teemtee/tmt#585) We don't want to bump this manually on every release, so teach release-koji to do that automatically for every old version that appears in plans/*.fmf. This can be dropped once there is a way to just run the tests from the upstream tarball in the dist-git, or run any "pre-discover" code.
My hack until then is to have our release scripts bump the ref automatically. |
As of today, Fedora dist-git FMF test plans have to specify a git repo and fixed ref for where to find the tests to run. (teemtee/tmt#585) We don't want to bump this manually on every release, so teach release-koji to do that automatically for every old version that appears in plans/*.fmf. This can be dropped once there is a way to just run the tests from the upstream tarball in the dist-git, or run any "pre-discover" code.
I always thought this is where I can see your point, when you're in charge of upstream, that you dont want your tests duplicated. But this basically generates tests dynamically from arbitrary upstream source... which I think is an "unsafe" operation, when I simply want to "run" the tests, not modify a host OS. I'd be fine with this running in a VM, f.e., but that's a lot of overhead for one archive... (I wrote more on this in #588.) |
@pvalena: For me this is exactly not the point -- I want to maintain and run the tests during upstream CI, so having this separate tests/ namespace is useless, too expensive [1], and error prone. The nice thing about STI is that you can effortlessly run tests from the upstream release tarball, which I consider the right thing to do. I"m not much fussed about how exactly to get this back (unpacking the source tarball in tmt, or mapping the spec version to a tag, or something equivalent). [1] in the sense of keeping gating tests actually working -- if they only run downstream, they always fail at the wrong time, and are nothing but a nuisance. |
No, not really - I want to take the tests as is from the upstream source which is defined in the spec. This is "safer" than tmt checking out some arbitrary git repo, as it does now. It's also awkward that test discovery has to call out to the internet in the first place, while it already has everything that it needs locally and validated. |
In general you won't get much adaption if there will be more work to be done manually like syncing upstream tests to another downstream repo. Also why would people use TMT if it would gave them more work than STI which they have now. Honestly, I think the whole downstream |
Reading #588 and the replies here, I do understand your concern about running too much code in the prepare step on the host machine. For this specific issue, I'd really be content with
... or something like that. That could invoke The standard-test-roles standard-test-source playbook should be a good inspiration, as that pretty much did the right thing in the last years. |
I need *pkg source too. However I wouldn't bind it to how:fmf and keep it a separate thing. Reason - test might not be in fmf but e.g shell, or later pytest (or any future how:plugin). |
In addition to
Imho we can make
Would that work for you @martinpitt too? |
@lukaszachy Sure! That's pretty much what I asked above as well. |
Just a thought on the |
Hopefully Autumn will bring more time to work on this. Moving to 1.9 |
Ooh, I somehow missed that this got fixed, nice! I tried this in https://src.fedoraproject.org/rpms/cockpit-podman/pull-request/37 , but it fails with
https://tmt.readthedocs.io/en/stable/spec/plans.html doesn't say a lot about this new option, but the example looks like that's all required? |
I'm still working on fixing this - Just guessing, but isn't this affected by #978 ? |
@lukaszachy oh right, thanks for the pointer -- that was the reason why I ignored the closing of this issue last time. Cheers! |
Fedora dist-git FMF test plans have to specify a git repo and fixed ref for where to find the tests to run. This is bad, and at some point it should instead just discover the tests from the upstream source tarball instead. Until teemtee/tmt#585 gets fixed, we need to bump `ref:` in dist-git's plans/upstream.fmf. Cockpituous had a hack for this [1], which we need to transplant to packit now. Unfortunately this reintroduces `files_to_sync:`, but all of this will go away when the follow-up issue teemtee/tmt#978 gets addressed. Create the file in tmp/ instead of plans/ (from where it would be easier to sync) as packit refuses operation on an unclean tree. tmp/ is in .gitignore. [1] cockpit-project/cockpituous@2ef3f6c9991
Fedora dist-git FMF test plans have to specify a git repo and fixed ref for where to find the tests to run. This is bad, and at some point it should instead just discover the tests from the upstream source tarball instead. Until teemtee/tmt#585 gets fixed, we need to bump `ref:` in dist-git's plans/upstream.fmf. Cockpituous had a hack for this [1], which we need to transplant to packit now. Unfortunately this reintroduces `files_to_sync:`, but all of this will go away when the follow-up issue teemtee/tmt#978 gets addressed. Create the file in tmp/ instead of plans/ (from where it would be easier to sync) as packit refuses operation on an unclean tree. tmp/ is in .gitignore. [1] cockpit-project/cockpituous@2ef3f6c9991
cockpit-podman now has an FMF test plan which runs in packit, which works very nice. I am currently investigating how to run the exact same tests downstream in Fedora. (Thanks to @psss for your great help!).
plans/upstream.fmf
currently looks like this:But this is awkward: I don't want to manually bump the
ref: "29"
each time there is an upstream release. This is error prone and breaks automation. The default value of ref: ismaster
, which is not suitable at all -- upstream's mainline tests are pretty much guaranteed to fail on the last or even earlier release. discover does not currently have any other method.So one way to fix this would be to support a shell command, or even provide that in tmt itself -- in our case, we'd parse
Version:
from the spec and requests that as a tag.But even that is a bit of a crutch -- having to check out a remote git tree is a point of brittleness, and this shell hackery is too much indirection. What I'd really like to do is what STI does: It unpacks the upstream tarball into
$WORKDIR/source
, and tests can just run there. See cockpit-podman's STI playbook role for example.It would be really nice to retain that semantics with FMF as well. The Fedora dist-git should be a small skeleton only, all the interesting bits should be done, gated, and released upstream. To keep TMT agnostic to the dist-git packaging mechanics, I could imagine a
prepare-discover:
orpre-discover:
shell command which could then doThis would actually also help @jscotka with his efforts of dynamically generating FMF metadata from Python unittests -- that step could then run the generator, so that the subsequent discover step can pick them up.
This is actually very similar to prepare:, but that runs after
discover
.The text was updated successfully, but these errors were encountered: