Add basic TMT gating test structure - #136
Conversation
2397582 to
c1cfdef
Compare
|
I think you need to had a workflow (maybe https://github.com/coreos/ignition/blob/main/.github/workflows/tmt-tests.yml) to trigger those. |
Thank you @travier, this should now work. 🤞🏻 |
|
Did the test actually run in testing farm? I don't see any URL pointing to the results in the workflow log |
I think you're referring to the |
|
I'm not sure I understand the goal here. This appear to be testing the RPM installation and then verifying its present. Shouldn't that test be in the distgit repo, testing the installation of the RPM package for PRs there? I think we have packit doing this now already? If we don't rebuild the RPM from the sources here then we are not testing the content of the PR but just what is in the Fedora repos? What I am missing? |
|
@travier : AFAIK the
That's correct, from what I understand the GH Actions workflow doesn't test the PR content. It's just a sanity check which verifies if TMT structure is valid. This follows the same pattern as ignition's dist-git, where the |
|
@c4rt0 By running 'rpm -q ', it tests almost nothing because it installs the existing package and not the code from the PR. Without rebuilding from source, we are not testing the PR changes. In order to address that Huijing had worked on enabling packit for bootupd. May be you can use this PR (coreos/bootupd#1003) for reference to add the gating test for CLHM. |
|
@aaradhak thank you for the above. I will follow Huijing's work and come back here with some questions if I still have any. |
|
/retest |
@travier I added .packit which should now run the TMT tests on testing farm. If I'm not mistaken this isn't yet triggered as packit isn't activated for |
|
That seems to make more sense. I need to find the instructions to enable packit again. |
|
/retest |
|
/packit-ci help |
Please note:
Contact:
Documentation: |
|
/packit-ci help |
Please note:
Contact:
Documentation: |
|
/packit-ci test |
|
It was requested so here's a simple: This commit adds three things: a TMT test structure, a Packit configuration, and a (copied from dist-git and very gently modified) spec file. In fact I only removed this since it was breaking the build, and TMT test structure (tests/tmt/, .fmf/version) I was asked why would we need a smoke test which only runs In the TMT smoke plan, there are two .fmf plan files that work together:the smoke.fmf and main.fmf. Before any test runs, TMT installs the package into the test environment. When Packit's tests job runs on Testing Farm, the test VM is a stock Fedora machine (matching the fedora-rawhide-x86_64 in .packit.yaml). Testing Farm automatically adds the COPR repo that Packit's copr_build just built into as a package source on that VM. So when main.fmf says
The COPR version has a higher release string, so dnf picks it. That's how the test ends up running against this PR's code instead of the stock Fedora package. We don't configure any of this - it's a packit thing behind the scenes. Packit configuration (.packit.yaml) Two jobs: copr_build rebuilds the RPM from the PR source, tests runs the TMT smoke plan against that rebuilt RPM via Testing Farm. This makes the PR test their own content instead of testing it against the stock Fedora rpm. At some point I was wondering if I should divide the architectures, but it turns out that diferent arches would just run the same test, so here I left simply the x86_64. In-tree spec file (console-login-helper-messages.spec) This curl will show the diff between both: Lastly there's the gh actions workflow (.github/workflows/tmt-tests.yml) Hope this helps, I'm open to any sugestions! |
joelcapitao
left a comment
There was a problem hiding this comment.
I left an in-line comment about the changelog.
Also, it would be really great to run tests against CentOS streams targets. In a previous comment, I pointed to the container-tools Packit config but there is also the bootc one which is interesting to take as reference c.f. https://github.com/bootc-dev/bootc/blob/main/.packit.yaml
I'm afraid this will have to be updated |
5662c07 to
7b3a712
Compare
travier
left a comment
There was a problem hiding this comment.
I can see the same RPM built by Packit and tested in TMT so this is looking good.
Can we avoid vendoring a copy of the spec file here? Maybe we can dynamically fetch it like we do it in https://github.com/coreos/ignition/blob/main/.copr/Makefile.
From your spec file change, I found https://src.fedoraproject.org/rpms/console-login-helper-messages/pull-request/18 which also looks like it needs a review so maybe we should fix the current specfile first or do a release of CLHM here and then retry all that?
|
CC @jbtrystram for the patch pending review / update: https://src.fedoraproject.org/rpms/console-login-helper-messages/pull-request/18 |
|
@travier Thanks for the review!
I should flag that this has been previously implemented, and it now conflicts with @joelcapitao's suggestion above to keep the spec here and use propose_downstream to sync it to dist-git. I followed Joel's direction in the latest push. I'm happy to go either way, but would need clarification which aproach is the one we agree here on:
Agreed, the dist-git spec needs fixing regardless - I also had the PR opened for the Joel's approach is that the dist-git spec currently doesn't match the upstream source (the issuegen.conf issue), which caused the Packit builds to fail when fetching it. Hosting the spec here lets us fix it alongside the code. |
|
Ah indeed, this sounds like a better plan. I had missed Joel's comment. LGTM then. |
travier
left a comment
There was a problem hiding this comment.
Looking good. But I think we should drop the patch from the RPM here.
Add a TMT test structure and Packit integration so PRs are tested against
their own content, not just the stock Fedora package.
TMT test structure:
- .fmf/version marks the FMF root
- tests/tmt/tests/core/core.fmf: smoke test (rpm -q)
- tests/tmt/plans/smoke.fmf: discovers and runs tests tagged smoke
- tests/tmt/plans/main.fmf: prepares the test environment
Packit (copr_build + tests on pull requests):
- Rebuilds the RPM from the PR source via COPR
- Runs the TMT smoke plan against the rebuilt RPM via Testing Farm
- Targets: fedora-rawhide, centos-stream-10, centos-stream-9
- propose_downstream syncs spec to fedora-all on release
In-tree spec file (rpm/):
- console-login-helper-messages.spec from Fedora dist-git with fixes:
- Removed stale issuegen.conf %files entry (removed upstream in v0.22.0)
- Made tmpfiles.d/console-login-helper-messages.conf unconditional
(restored upstream in PR coreos#134, post-v0.22.0)
- Removed obsolete fc29 conditionals
- Replaced manual %changelog with %autochangelog
GitHub Actions workflow (tmt-tests.yml):
- Runs TMT tests locally in a container on each push/PR
Assisted-by: Claude Opus 4.6 <noreply@anthropic.com>
Done. |
|
Let's do a release to exercise / validate the full flow? |
don't tag anything in fedora until fedora-selinux/selinux-policy#3169 |
Hmm, but we need that patch downstream don't we ? Or maybe the plan is to add it back only in CentOS stream distgit ? |
I went through the tagging exercise at CLHM straight away... it was not my intention to do anything at the dist-git side - I assumed that was a maintainer's job. |
Adds TMT / FMF tests structure. Without this, broken RPM builds pass unchecked.
Follows the same pattern used by ignition and coreos-installer
Reference: work done by @aaradhak's in #127.
Resolve COS-2288: Add gating test for console-login-helper-messages.