This speeds up parallel unit test runs from a very consistent 2:49 to
a very consistent 1:53, or a 33% reduction.
Signed-off-by: Ryan Davis <zenspider@chef.io>
Not sure how it was supposed to work in the first place. The plugin in
question depends on ordinal_array and that wasn't in that fixture dir.
Switching to 2 is all it apparently needed.
This does cause yet another double-load warning (VERSION already
defined). I don't know how we're supposed to get around that with the
way we've set up these tests.
Signed-off-by: Ryan Davis <zenspider@chef.io>
Helps testing and lots of other things if we only use $stdout/$stderr.
STDOUT/STDERR should only be used to restore the globals.
Signed-off-by: Ryan Davis <zenspider@chef.io>
Trying to fix file_test failure that only happens on travis.
The "mock" file in question is supposed to have a stat of 644, but
actually has 664 but only on travis-ci.
Signed-off-by: Ryan Davis <zenspider@chef.io>
This time between:
+ PluginManagerCliDefinitionTests#(?:test_plugin_registered
+ PluginLoaderTests#test_load_mock_plugin_by_gem
Signed-off-by: Ryan Davis <zenspider@chef.io>
Specifically, if these were run in this order:
+ PluginLoaderTests#test_load_mock_plugin_by_gem
+ PluginInstallerInstallationTests#test_install_a_gem_from_local_file
the latter would fail.
The failure was in test setup. The solution was partially to crib off
of and normalize with LoaderTest setup/teardown and partially to set extra things.
Specifically:
+ HOME wasn't being set so it was finding my ~/.inspec/plugins.json
+ ENV wasn't being reset for Gem.paths
+ Installer wasn't being reset correctly, so plugins were known across tests.
Signed-off-by: Ryan Davis <zenspider@chef.io>
+ Added SLOW=1 to appveyor (I hope?) and travis.
+ Off by default.
Speeds up installer tests from ~5.5 seconds to ~0.5 seconds.
Once this is established, we can push this up to the main helper and
generalize if it works out for us.
Signed-off-by: Ryan Davis <zenspider@chef.io>
+ Do extra cleanup of loaded_specs for the dependencies.
+ Ensure rake is actually activated.
Fixes#4030.
Fixes#4026.
Signed-off-by: Ryan Davis <zenspider@chef.io>
As commented, I'm happy to push this to our tests, but it does seem
odd that we'd install rdoc/ri for plugins.
Signed-off-by: Ryan Davis <zenspider@chef.io>
+ float? comparison can raise a TypeError
+ octal? comparison was allowing non-octal values (which cast to 0)
+ symbol comparison was casting to a string, but then doing an == check instead of casecmp.
The latter seems optional, but consistent with the intent of cmp.
Signed-off-by: Ryan Davis <zenspider@chef.io>
These tests both involve dynamic un-rooted classes. As such, they have
no name and thus print like #<Class:0xXXXXXXXX:...>. I switched one to
a describe instead of Class.new(Minitest::Test) and the other I
stringified the anonymous class.
Signed-off-by: Ryan Davis <zenspider@chef.io>