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

fixes #8857 - refactor Debian boot_files_uri into parent class to match CoreOS #2053

Closed

Conversation

johscheuer
Copy link
Member

Refactor Debian boot_files_uri into parent class to match CoreOS. See Issue http://projects.theforeman.org/issues/8857

@theforeman-bot
Copy link
Member

There were the following issues with the commit message:

  • 96b600c must be in the format Fixes/refs #redmine_number - brief description.

Guidelines are available on the Foreman wiki.


This message was auto-generated by Foreman's prprocessor

@johscheuer johscheuer changed the title Refactor #8857 fixes #8857 - refactor Debian boot_files_uri into parent class to match CoreOS Jan 7, 2015
@domcleal
Copy link
Contributor

domcleal commented Jan 7, 2015

[test]

@stbenjam
Copy link
Member

stbenjam commented Jan 7, 2015

[test]

@@ -0,0 +1,45 @@
require 'test_helper'

class DebianTest < ActiveSupport::TestCase
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of this file has a typo, "debin" instead of "debian". When you correct it, please put the test in test/unit/operatingsystems/debian_test.rb, just to keep a consistent hierarchy with the one in app/models

@dLobatog
Copy link
Member

dLobatog commented Jan 8, 2015

@johscheuer Nice job! There are only a few issues with the way tests are structured in my opinion, it works well although I have not thoroughly tested it yet. See the comments above and I'll test it a bit more, but it looks like 👍 from my side. 😄

@johscheuer
Copy link
Member Author

@elobato Thanks 👍 :) I will have a look and fix these things.

@theforeman-bot
Copy link
Member

There were the following issues with the commit message:

  • 3449e8b must be in the format Fixes/refs #redmine_number - brief description.

Guidelines are available on the Foreman wiki.


This message was auto-generated by Foreman's prprocessor

@mmoll
Copy link
Contributor

mmoll commented Jan 9, 2015

[test]

assert_equal 1, operatingsystems.count
assert_equal operatingsystems(:suse), operatingsystems.first
assert_equal operatingsystems(:centos5_3), operatingsystems.first
end
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the os from Suse to centos, so we can safely remove the fixture for Suse

@mmoll
Copy link
Contributor

mmoll commented Jan 10, 2015

[test]

@theforeman-bot
Copy link
Member

There were the following issues with the commit message:

  • 6f17b0d must be in the format Fixes/refs #redmine_number - brief description.

Guidelines are available on the Foreman wiki.


This message was auto-generated by Foreman's prprocessor

…ass to match CoreOS

Removed ubuntu_utopic from media.yml which caused the postgresql tests to fail

Refactored unit tests

Refactored os unit tests into one test file with param. tests

Refactored usage of fixtures into factories

Remove Checkstyle warnings and changed operatingsystem_test to use centos instead of suse

fixed Lint/BlockAlignment
@dLobatog
Copy link
Member

[test]

@dLobatog
Copy link
Member

Looks pretty good, I'll comment a few nitpicks I'll fix on merge just to leave some footprint. Just a sec...

@@ -252,7 +252,7 @@ def downcase_release_name
end

def boot_files_uri(medium, architecture, host = nil)
raise (_("invalid medium for %s") % to_s) unless media.include?(medium)
raise ::Foreman::Exception.new(N_("invalid medium for %s"), to_s) unless media.include?(medium)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to_s to self. A rubocop cop we should use forces this, it's much more readable.

@dLobatog
Copy link
Member

Merged as 03363cd, fixes in e760512, thanks @johscheuer!

@dLobatog dLobatog closed this Jan 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants