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

[rails6][git_repository_spec.rb] Use .local_miq_server #20794

Merged

Conversation

NickLaMuro
Copy link
Member

In Rails 6, it seems like a validation callback for nested relations is causing a GitRepository.save! to fail. In this case, a MiqQueue call validation that checks that the Zone that is being provided via the options to queue the work on actually exists.

This seems to have not been respected properly in the past, so this fix just simply switches to using actually MiqServer/Zone records instead of trying to stub them out.

Works in both Rails 5.2 and Rails 6.0

Links

In Rails 6, it seems like a validation callback for nested relations is
causing a `GitRepository.save!` to fail.  In this case, a MiqQueue call
validation that checks that the `Zone` that is being provided via the
`options` to queue the work on actually exists.

This seems to have not been respected properly in the past, so this fix
just simply switches to using actually `MiqServer`/`Zone` records
instead of trying to stub them out.

Works in both Rails 5.2 and Rails 6.0
@NickLaMuro NickLaMuro mentioned this pull request Nov 9, 2020
39 tasks
@NickLaMuro
Copy link
Member Author

@miq-bot assign @jrafanie
@miq-bot add_label rails6

@miq-bot
Copy link
Member

miq-bot commented Nov 9, 2020

Checked commit NickLaMuro@0aff5f2 with ruby 2.6.3, rubocop 0.82.0, haml-lint 0.35.0, and yamllint
1 file checked, 0 offenses detected
Everything looks fine. 👍

@chessbyte chessbyte added the test label Nov 9, 2020
@Fryguy Fryguy merged commit 4e1f036 into ManageIQ:master Nov 9, 2020
@Fryguy Fryguy assigned Fryguy and unassigned jrafanie Nov 9, 2020
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.

5 participants