Skip to content

Commit

Permalink
Fix metric/ci_mixin_spec using kubevirt vm
Browse files Browse the repository at this point in the history
The metric/ci_mixin_spec was using a kubeivrt vm as an example of a
class which doesn't support capture.

This is no longer accurate as we have added C&U support for kubevirt,
plus we shouldn't be using provider plugin classes in core.

These specs are essentially testing that a class that includes a module
with `supports :capture` responds to `.supports?(:capture)` with true
which isn't actually testing anything.
  • Loading branch information
agrare committed Dec 10, 2024
1 parent a2a7b2d commit c44c194
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions spec/models/metric/ci_mixin_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
RSpec.describe Metric::CiMixin do
include Spec::Support::SupportsHelper

context "with a Vm" do
let(:vm) { FactoryBot.create(:vm_vmware) }

Expand Down Expand Up @@ -63,26 +65,4 @@
end
end
end

context "#supports?(:capture)" do
context "with a VM" do
let(:unsupported_vm) { FactoryBot.create(:vm_kubevirt) }
let(:supported_vm) { FactoryBot.create(:vm_vmware) }

it "correctly checks capture support" do
expect(unsupported_vm.supports?(:capture)).to be_falsy
expect(supported_vm.supports?(:capture)).to be_truthy
end
end

context "with a Host" do
let(:unsupported_host) { FactoryBot.create(:ibm_power_hmc_host) }
let(:supported_host) { FactoryBot.create(:host_vmware) }

it "correctly checks capture support" do
expect(unsupported_host.supports?(:capture)).to be_falsy
expect(supported_host.supports?(:capture)).to be_truthy
end
end
end
end

0 comments on commit c44c194

Please sign in to comment.