ManageIQ / manageiq-providers-kubevirt

ManageIQ plugin for the Kubevirt provider.
https://kubevirt.io/
Apache License 2.0
4 stars 29 forks source link

Don't rely on rails magic to find fixtures, be explicit #210

Closed jrafanie closed 2 years ago

jrafanie commented 2 years ago

As of https://github.com/ManageIQ/manageiq/pull/22039 core now specifies the fixture path so we need to be explicit when running these tests.

miq-bot commented 2 years ago

Checked commit https://github.com/jrafanie/manageiq-providers-kubevirt/commit/4cb7184d007a1318affa116510b1784bdf0495fa with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint 1 file checked, 0 offenses detected Everything looks fine. :star:

Fryguy commented 2 years ago

Is this something we should put in all of the providers? Perhaps at the provider generator level? Or perhaps in core in a pluggable manner? cc @agrare

Fryguy commented 2 years ago

Removed najdorf/yes? as we are not backporting anything Rails 6.1

agrare commented 2 years ago

Yeah I see a number of providers have spec/fixtures:

manageiq-providers-amazon/spec/fixtures:
orchestration_templates

manageiq-providers-azure/spec/fixtures:
events  orchestration_templates

manageiq-providers-azure_stack/spec/fixtures:
orchestration_templates

manageiq-providers-kubevirt/spec/fixtures:
files

manageiq-providers-openstack/spec/fixtures:
orchestration_templates

manageiq-providers-vmware/spec/fixtures:
orchestration_templates

I'm assuming all of these would have to be updated?

As for the generator, if spec/fixtures aren't used we probably don't need this...or should we create an empty spec/fixtures dir just in case?

Fryguy commented 2 years ago

I don't really understand the spec/fixtures... I didn't think we used fixtures at all

jrafanie commented 2 years ago

Yeah I see a number of providers have spec/fixtures:

manageiq-providers-amazon/spec/fixtures:
orchestration_templates

manageiq-providers-azure/spec/fixtures:
events  orchestration_templates

manageiq-providers-azure_stack/spec/fixtures:
orchestration_templates

manageiq-providers-kubevirt/spec/fixtures:
files

manageiq-providers-openstack/spec/fixtures:
orchestration_templates

manageiq-providers-vmware/spec/fixtures:
orchestration_templates

These aren't failing on cross repo so I wonder if the problem is that this one uses a non-standard path: "spec/fixtures/files"

Others seem to use spec/fixtures/...

https://github.com/ManageIQ/manageiq-providers-amazon/blob/master/spec/fixtures/orchestration_templates/cfn_parameters.json

And yet more just build their own path and don't use fixture_path at all: https://github.com/ManageIQ/manageiq-providers-vmware/blob/7e78afd5da4e05364156801408df06e57f56a896/spec/factories/orchestration_template.rb#L5

agrare commented 2 years ago

I didn't think we used fixtures at all

Yeah to be honest this is the first I've seen these

I wonder if the problem is that this one uses a non-standard path

Oh interesting