-
Notifications
You must be signed in to change notification settings - Fork 898
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
Fix MiqWorker service_base_name to match unit file prefix #21149
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
RSpec.describe MiqWorker::SystemdCommon do | ||
describe ".service_base_name" do | ||
before { MiqWorkerType.seed } | ||
|
||
it "every worker has a matching systemd target and service file" do | ||
expected_units = (Vmdb::Plugins.systemd_units + Rails.root.join("systemd").glob("*.*")).map(&:basename).map(&:to_s) | ||
|
||
expected_units.delete("manageiq.target") | ||
|
||
found_units = MiqWorkerType.worker_class_names.flat_map do |klass_name| | ||
klass = klass_name.constantize | ||
service_base_name = klass.service_base_name | ||
|
||
service_file = "#{service_base_name}@.service" | ||
target_file = "#{service_base_name}.target" | ||
|
||
[service_file, target_file] | ||
end | ||
|
||
expect(expected_units).to match_array(found_units) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just realized this should have been the other way around...
but it's fine. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
end | ||
end | ||
end |
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.
Really want to make this a
providers_common
spec but we'll need a good way to determine which workers come from which engine.This is how the container_common_spec is testing all worker deployment name lengths
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.
Do we? It can't hurt to check all workers in all engines. If someone changes a particular engine, then the probability they break their own engine is higher than breaking others, especially since we won't merge on red.