-
Notifications
You must be signed in to change notification settings - Fork 328
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
MODULES-5690: Implementing Rubocop in the module #418
Conversation
when 'AIX' | ||
servicename = 'xntpd' | ||
else | ||
servicename = if fact('operatingsystem') == 'SLES' && fact('operatingsystemmajrelease') == '12' |
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.
nice !
spec/acceptance/ntp_install_spec.rb
Outdated
when '5.11' | ||
packagename = 'service/network/ntp' | ||
end | ||
else | ||
if fact('operatingsystem') == 'SLES' and fact('operatingsystemmajrelease') == '12' | ||
servicename = 'ntpd' | ||
if fact('operatingsystem') == 'SLES' && fact('operatingsystemmajrelease') == '12' |
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.
it looks like servicename will not be set for solaris
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.
2 minor changes but class work @david22swan!
.travis.yml: | ||
extras: | ||
- rvm: 2.1.9 | ||
script: bundle exec rake rubocop |
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.
Would it be possible to remove this line break.
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.
Understand now, have resolved
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.
Have you pushed this change? I can still see it.
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.
Done
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.
Perfect
@@ -13,4 +13,5 @@ | |||
begin | |||
require 'spec_helper_local' | |||
rescue LoadError | |||
puts 'Rescue Load Error' | |||
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.
All changes in this file should probably be done in Module Sync rather than in the actual file.
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.
Didn't know that.
Was brought up as a rubocop error so I changed it.
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.
Fix has been made to modulesync
@david22swan i am happy with this, due to the large number of changes it would be great if @hunner @HAIL9000 or @eputnam could look as well. |
Ok |
when '5.11' | ||
packagename = 'service/network/ntp' | ||
end | ||
else | ||
if fact('operatingsystem') == 'SLES' and fact('operatingsystemmajrelease') == '12' |
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.
Did the sles conditional get re-added somewhere?
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.
To my knowledge this peace of code did not seem to do anything at all, and seemed to be a remnant of something from earlier.
end | ||
end | ||
|
||
describe 'keys' do | ||
it 'enables the key parameters' do | ||
pp = <<-EOS | ||
pp = <<-EOS |
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.
I think this should be a let(:pp)
block if it's outside of the it
but used inside of the it
. See http://www.betterspecs.org/#let and referenced stackoverflow link.
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.
Have made the change, though a little unsure of why it was necesary
end | ||
end | ||
|
||
describe 'package' do | ||
it 'installs the right package' do | ||
pp = <<-EOS | ||
pp = <<-EOS |
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.
Ditto.
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.
ditto
spec/acceptance/class_spec.rb
Outdated
describe 'ntp class:', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do | ||
it 'should run successfully' do | ||
describe 'ntp class:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do | ||
context 'ntp' do | ||
pp = "class { 'ntp': }" |
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.
Ditto.
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.
There's no actual explanation to ditto?
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.
Whoops weird... github was missing some comments and put them out of order, but I guess I didn't fix it right... this is what the first was supposed to say:
I think this should be a let(:pp)
block if it's outside of the it
but used inside of the it
. See http://www.betterspecs.org/#let and referenced stackoverflow link.
|
||
describe "ntp class with disable_monitor:", :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do | ||
describe 'ntp class with disable_monitor:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do | ||
context 'should disable' do | ||
pp = "class { 'ntp': disable_monitor => true }" |
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.
Ditto, even though this was pre-existing.
|
||
describe 'service is unmanaged' do | ||
it 'shouldnt stop the service' do | ||
describe 'service is unmanaged' do | ||
pp = <<-EOS |
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.
Ditto.
spec/acceptance/ntp_service_spec.rb
Outdated
it 'should be stopped' do | ||
expect(output.stdout).to match(/Active\:\s+inactive/) | ||
# HACK: until we either update SpecInfra or come up with alternative | ||
output = shell('service ntpd status', acceptable_exit_codes: [0, 3]) |
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.
Ugh. I think this should be a let
block as well. That way the execution is delayed until it's actually referenced. I understand that this isn't part of rubocop/style changes though.
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.
Done
|
||
describe 'preferred servers', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do | ||
describe 'preferred servers', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do | ||
pp = <<-EOS |
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.
Ditto, even though this was pre-existing.
spec/acceptance/restrict_spec.rb
Outdated
context 'should run successfully' do | ||
pp = "class { 'ntp': restrict => ['test restrict']}" |
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.
Ditto.
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.
ditto
spec/acceptance/statistics_spec.rb
Outdated
context 'should run successfully' do | ||
pp = "class { 'ntp': statistics => ['loopstats'], disable_monitor => false}" |
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.
Ditto.
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.
ditto
Ok. |
MODULES-5690: Implementing Rubocop in the module
No description provided.