Skip to content
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

Add basic tests using packit #818

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Apr 4, 2024

The aim of this is to run tests on the built RPM to verify various scenarios using real systems.

@@ -1,24 +0,0 @@
name: Ruby Tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this file get removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note it's in the last [WIP] commit. Just to avoid spending extra cycles just iterating on something unrelated.

@ekohl
Copy link
Member Author

ekohl commented Apr 4, 2024

I opened teemtee/tmt#2825 for some guidance on best practices for repository handling.

@ekohl
Copy link
Member Author

ekohl commented Apr 4, 2024

@Griffin-Sullivan locally I could run this with tmt run -a provision -h container -i centos:stream9 or tmt run -a provision -h virtual -i c9 for either a container or a VM. Afterwards you can run tmt run -l report -vvv to get all the output from the last run.

- hostname
- foreman-maintain
execute:
- script: foreman-maintain --help
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why --help triggers hostname?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. It's either this:

def hostname
execute('hostname -f')
end

But more likely this:

@foreman_url = @options.fetch(:foreman_url, `hostname -f`.chomp)

That latter should really use block form:

@foreman_url = @options.fetch(:foreman_url) { `hostname -f`.chomp }

That way it doesn't execute hostname -f if a value is found.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could, in theory, use this PR to test both this PR and the theory? By including these pieces of code selectively commented out and removing the hostname requires. Kind of a fun experiment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#819. And there's already plenty of other things I'm trying to test. First I just want it to work.

@ekohl
Copy link
Member Author

ekohl commented Apr 4, 2024

It's failing to install. I suspect it's trying to install the package before the repository with our packages is set up.

Command:
---v---v---v---v---v---
dnf -y install --allowerasing https://download.copr.fedorainfracloud.org/results/packit/theforeman-foreman_maintain-818/rhel-9-x86_64/07259709-rubygem-foreman_maintain/rubygem-foreman_maintain-doc-1.6.2-1.20240404155940931685.pr818.5.gd3fc944.el9.noarch.rpm https://download.copr.fedorainfracloud.org/results/packit/theforeman-foreman_maintain-818/rhel-9-x86_64/07259709-rubygem-foreman_maintain/rubygem-foreman_maintain-1.6.2-1.20240404155940931685.pr818.5.gd3fc944.el9.noarch.rpm
---^---^---^---^---^---

Stdout:
---v---v---v---v---v---
Last metadata expiration check: 0:00:04 ago on Thu 04 Apr 2024 04:06:04 PM UTC.
rubygem-foreman_maintain-doc-1.6.2-1.2024040415  16 MB/s | 537 kB     00:00    
rubygem-foreman_maintain-1.6.2-1.20240404155940 5.1 MB/s | 148 kB     00:00    
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

---^---^---^---^---^---

Stderr:
---v---v---v---v---v---
Warning: Permanently added '3.128.155.233' (ED25519) to the list of known hosts.
Error: 
 Problem 1: conflicting requests
  - nothing provides rubygem(clamp) needed by rubygem-foreman_maintain-1:1.6.2-1.20240404155940931685.pr818.5.gd3fc944.el9.noarch from @commandline
  - nothing provides rubygem(highline) needed by rubygem-foreman_maintain-1:1.6.2-1.20240404155940931685.pr818.5.gd3fc944.el9.noarch from @commandline
 Problem 2: package rubygem-foreman_maintain-doc-1:1.6.2-1.20240404155940931685.pr818.5.gd3fc944.el9.noarch from @commandline requires rubygem-foreman_maintain = 1:1.6.2-1.20240404155940931685.pr818.5.gd3fc944.el9, but none of the providers can be installed
  - conflicting requests
  - nothing provides rubygem(clamp) needed by rubygem-foreman_maintain-1:1.6.2-1.20240404155940931685.pr818.5.gd3fc944.el9.noarch from copr:copr.fedorainfracloud.org:packit:theforeman-foreman_maintain-818
  - nothing provides rubygem(highline) needed by rubygem-foreman_maintain-1:1.6.2-1.20240404155940931685.pr818.5.gd3fc944.el9.noarch from copr:copr.fedorainfracloud.org:packit:theforeman-foreman_maintain-818
  - nothing provides rubygem(clamp) needed by rubygem-foreman_maintain-1:1.6.2-1.20240404155940931685.pr818.5.gd3fc944.el9.noarch from @commandline
  - nothing provides rubygem(highline) needed by rubygem-foreman_maintain-1:1.6.2-1.20240404155940931685.pr818.5.gd3fc944.el9.noarch from @commandline

---^---^---^---^---^---

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants