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

(MODULES-6746) Convert Tests to RSpec #98

Conversation

RandomNoun7
Copy link

This change converts the module tests to the more standardized RSpec tests.

Gemfile Outdated
@@ -63,6 +63,7 @@ group :system_tests do
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
gem "puppet-blacksmith", '~> 3.4', :require => false
gem "beaker-windows", '~> 0.6', :require => false
gem "beaker-testmode_switcher", :require => false

Choose a reason for hiding this comment

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

out of scope for this ticket

Copy link
Author

Choose a reason for hiding this comment

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

Snip


context 'MODULES-3035 - Add New Config Item' do

before(:all) do

Choose a reason for hiding this comment

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

Have you tried a "before(:each)" to avoid duplication of the before and after calls?

Copy link
Author

Choose a reason for hiding this comment

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

I did. The problem is that each of the it_behaves_like blocks typically has two examples in it. One to apply the manifest, and the second to verify that the test property was applied correctly. If I do these as before and after each blocks, then my config file gets reset between each of those examples, and the second test will fail each time.

# require 'beaker-windows'
# test_name 'MODULES-3037 - C97738 Install known good package with utf-8 via manifest and remove via manifest'
# confine(:to, :platform => 'windows')
#
# # arrange
# package_name = '竹ChocolateyGUIÖ'
# package_name = '???ChocolateyGUI??'

Choose a reason for hiding this comment

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

we're not testing UTF-8 characters anymore?

Copy link
Author

Choose a reason for hiding this comment

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

I guess not? The whole test is commented out in the master I'm working from, but it looks like me moving it around has wiped out the UTF-8 characters.

Copy link
Author

Choose a reason for hiding this comment

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

Ok. I got the UTF-8 characters restored into the file. I'll take a pass at getting these test to run, but if I run into any issues, since they are commented out in the module right now, I'll take the cop out and start another ticket to get these working.

@RandomNoun7 RandomNoun7 force-pushed the tickets/master/MODULES-6746-convert_tests_to_respec branch 9 times, most recently from 6b7ae09 to c2ed145 Compare March 22, 2018 22:33
@RandomNoun7 RandomNoun7 changed the title (WIP)(MODULES-6746) Convert Tests to RSpec (MODULES-6746) Convert Tests to RSpec Mar 23, 2018
@RandomNoun7 RandomNoun7 force-pushed the tickets/master/MODULES-6746-convert_tests_to_respec branch from c2ed145 to 6ddc592 Compare March 23, 2018 20:58
@@ -0,0 +1,170 @@
require 'spec_helper_acceptance'

confine(:to, :platform => 'windows')

Choose a reason for hiding this comment

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

You don't need both this confine and "windows_agents" as the latter is functionally equivalent.

end
end
end
end

Choose a reason for hiding this comment

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

add newlines at EOF

Copy link

@ThoughtCrhyme ThoughtCrhyme left a comment

Choose a reason for hiding this comment

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

See comments

@RandomNoun7 RandomNoun7 force-pushed the tickets/master/MODULES-6746-convert_tests_to_respec branch 2 times, most recently from 61c8532 to b38dad9 Compare March 27, 2018 17:53
Copy link

@ThoughtCrhyme ThoughtCrhyme left a comment

Choose a reason for hiding this comment

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

Nit: more EOL additions

install_module_dependencies_on(agent)
install_module_on(agent)
install_chocolatey
end

Choose a reason for hiding this comment

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

Add EOL

end
end
end
end

Choose a reason for hiding this comment

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

Add EOL

end
end
end
end

Choose a reason for hiding this comment

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

Add EOL

end
end
end
end

Choose a reason for hiding this comment

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

Add EOL

end
end
end
end

Choose a reason for hiding this comment

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

Add EOL

@RandomNoun7 RandomNoun7 force-pushed the tickets/master/MODULES-6746-convert_tests_to_respec branch 2 times, most recently from b150f0c to 259a1b1 Compare March 27, 2018 18:03
This change converts the module tests to the more standardized RSpec tests.

Add back utf-8 test file.
@RandomNoun7 RandomNoun7 force-pushed the tickets/master/MODULES-6746-convert_tests_to_respec branch from 259a1b1 to c9efdd4 Compare March 27, 2018 18:06
@ThoughtCrhyme ThoughtCrhyme merged commit a052600 into puppetlabs:master Mar 28, 2018
@RandomNoun7 RandomNoun7 deleted the tickets/master/MODULES-6746-convert_tests_to_respec branch April 2, 2018 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants