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

Use test:///default in tests #140

Merged
merged 9 commits into from
Jul 15, 2024
Merged

Use test:///default in tests #140

merged 9 commits into from
Jul 15, 2024

Conversation

ekohl
Copy link
Contributor

@ekohl ekohl commented Jun 13, 2024

Rather than mocking, this uses the test connection to use real libvirt objects.

It only keeps mocking for dhcp_leases which isn't implemented in the test connection. The UUIDs are modified to match.

This was suggested by the ruby-libvirt maintainers in https://gitlab.com/libvirt/libvirt-ruby/-/merge_requests/35#note_1948893893. Right now it still contains various unrelated patches, though some are certainly needed. I'd qualify some of them as features, others bug fixes and some general cleanups.

This was referenced Jun 13, 2024
@ekohl ekohl marked this pull request as ready for review June 24, 2024 15:05
@ekohl
Copy link
Contributor Author

ekohl commented Jun 24, 2024

I think this is ready now.

I'm tempted to create a bugfix release with #142 and #139 first with the dependency pinned and then merge this.

Even EL7(.9) includes libvirt 4.5.0 and this greatly simplifies the
code.
Previously leases could be nil in which case the code would crash. By
using the safe operator the code can be shorter. It also replaces
sort_by.last with max_by.
The mac is defined as the mac address on the first nic. This removes the
double action of taking the first and then finding it again.
This is primarily useful for tests where I need a specific mac address
to match mocks.
Rather than assuming the key is present, this gracefully handles it
being absent.
Rather than mocking, this uses the test connection to use real libvirt
objects. This brings compatibility with 0.8.3.

It only keeps mocking for dhcp_leases which isn't implemented in the
test connection. The UUIDs are modified to match.
@ekohl ekohl merged commit 923ad45 into fog:master Jul 15, 2024
5 of 6 checks passed
@ekohl ekohl deleted the use-test-connection branch July 15, 2024 15:56
@voxik
Copy link
Contributor

voxik commented Aug 9, 2024

@ekohl is there by a chance any ETA getting this out of the doors?

@ekohl
Copy link
Contributor Author

ekohl commented Aug 9, 2024

I was hoping we'd finish the UEFI and secureboot things, but I can release what's already out there. Probably won't be this week though.

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

Successfully merging this pull request may close these issues.

2 participants