-
Notifications
You must be signed in to change notification settings - Fork 8
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
Check that rpms installed in tmt come from copr #676
Conversation
tests/snapshot-gating.fmf
Outdated
- name: Assert correct llvm package is installed | ||
how: shell | ||
order: 99 | ||
script: tests/assert_llvm.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
script: tests/assert_llvm.sh | |
script: rpm -q llvm-libs | grep -P "Version[^:]+:.*~pre.*" |
This should do the trick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that your point here is to keep it simple. I do think that the script might be more beneficial in this case, though. The script gives us some advantages here:
- We can make several checks at the
prepare
step end, all grouped under the same script. This may include, checking that the copr repo is reachable. - We can write more complex logic. For example testing several packages rather that llvm-libs only.
- We can properly report what failed and why.
For example, upon wrong package installation with the script, this is what we see in the report:
prepare step failed
The exception was caused by 1 earlier exceptions
Cause number 1:
Command '/var/ARTIFACTS/work-snapshot-gatingejv1c0ks/tests/snapshot-gating/tree/tmt-prepare-wrapper.sh-Assert-correct-llvm-package-is-installed-default-0' returned 1.
stdout (2 lines)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*** Unexpected llvm package installed: llvm-18.1.8-2.fc41.x86_64
*** Expected llvm: llvm-20.0.0~pre20240825.g3ef64f7ab5b865-1.fc42.x86_64
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
However, using the plain command, we would see this instead, which is much less intuitive:
prepare step failed
The exception was caused by 1 earlier exceptions
Cause number 1:
Command '/var/tmp/tmt/run-077/tests/snapshot-gating/tree/tmt-prepare-wrapper.sh-Assert-correct-llvm-package-is-installed-default-0' returned 1.
tests/assert_llvm.sh
Outdated
@@ -0,0 +1,34 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove this file.
tests/snapshot-gating.fmf
Outdated
@@ -23,6 +23,11 @@ prepare: | |||
script: | | |||
dnf install -y dnf-plugins-core | |||
dnf config-manager --save --setopt="testing-farm-tag-repository.priority=999" || true | |||
|
|||
- name: Assert correct llvm package is installed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: Assert correct llvm package is installed | |
- name: "Check that snapshot (~pre) version of LLVM is installed" |
Add a prepare step that checks the version of installed llvm-libs to ensure it's a copr package.
Followup fedora-llvm-team#670. Reimplement without using a specific dnf. Replace the unexpanded $distname variable in the script
Before trying to modify the repo we check that it exists, hence we no longer need to mask the result of commands. This now works with both dnf4 and dnf5 Fixes fedora-llvm-team#671
Closed in favor of #680 |
Add a script to ensure that the llvm package installed comes from the copr repo. A failure in the script aborts the test plan
See #671