Commit graph

28 commits

Author SHA1 Message Date
Ryan Davis
6330fa486f Please also stop warning about VERSION being defined.
This removes ::InspecPlugins::TestFixture in installer_test and
loader_test on every test.

Please... no more output in our test runs...

Signed-off-by: Ryan Davis <zenspider@chef.io>
2020-02-03 16:38:25 -08:00
Ryan Davis
d4b3a5c149 Suppress output from rubygems installs.
I still wish this wouldn't fetch or install... but in the meantime,
leave my dots alone.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-11-27 13:42:43 -08:00
Ryan Davis
2eaebe510c Fixed installer_test by testing subsets of the paths.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-11-12 14:51:56 -08:00
Ryan Davis
b1c2af209b Corresponding fixes for the move from test/unit/mock to test/fixtures.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-11-08 19:20:12 -08:00
Ryan Davis
e8ca7d3cd3 Suppress output from rubygems installs.
I still wish this wouldn't fetch or install... but in the meantime,
leave my dots alone.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-11-08 18:35:23 -08:00
Clinton Wolfe
777f1a1bff Adjust checking for version when installing latest in unit test
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Clinton Wolfe
18640dd70c We do now include the version in the float fixture, for one thing
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-08-27 21:29:42 -04:00
Ryan Davis
917a531a92 Skipped all failing tests on windows AT the failures site.
This activates a BUNCH of tests but keeps us green.

Whether these tests are valid or not is not being addressed here.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-07-24 18:09:08 -07:00
Ryan Davis
c6837a3915 Moved skip_windows! to top helper and extended date to end of next month.
Fixed up requires in v2/installer_test.rb so it sees the top helper.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-07-24 18:06:25 -07:00
Clinton Wolfe
12b577fccd linting
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-07-22 15:17:30 -04:00
Clinton Wolfe
b37d165878 Unit test for suppressing doc install
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-07-22 15:17:30 -04:00
Miah Johnson
a4f4fe5231 chefstyle -a; https://github.com/chef/chefstyle/pull/74
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-07-08 17:22:50 -07:00
Clinton Wolfe
e4e7c255de Automated chefstyle application for rubocop 0.72 compatibility
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-07-03 17:24:41 -04:00
Miah Johnson
e46018a517 chefstyle -a cleanup
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-06-11 18:52:38 -07:00
Ryan Davis
a5309ea392 blindly applied chefstyle -a
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-06-11 18:52:03 -07:00
Ryan Davis
1b01aa7a57 Removed all redundant INSPEC_CONFIG_DIR setup from tests.
Pushed up to setup

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-17 02:26:07 -07:00
Ryan Davis
8f3e1a0fe5 Fixes test failure interaction between Loader and Installer tests.
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>
2019-05-17 02:26:07 -07:00
Ryan Davis
84fd8af96a Added SLOW=1 env var to run slow installer tests, otherwise skipped
+ 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>
2019-05-17 02:26:07 -07:00
Ryan Davis
92d8cd4df9 Fixed two test order dependency bugs.
+ 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>
2019-05-17 02:26:07 -07:00
Ryan Davis
4d4e8e1feb Turn off rdoc/ri generation in plugins.
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>
2019-05-17 02:26:07 -07:00
Ryan Davis
6adf1d2560 Remove all byebug requires in code.
Please don't leave debugging remnants in the code.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-14 23:24:14 -07:00
Ryan Davis
476c6878b3 Modernize use of Minitest.
+ Turn off verbosity in Rakefile by default. Use `rake V=1` to turn back on.
+ MiniTest -> Minitest everywhere.
+ MiniTest::Unit::TestCase -> Minitest::Test everywhere.
+ Updated minitest doco urls to official and up-to-date site.
+ Normalize requires. Only needs "minitest/autorun" and "minitest/pride".

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-03 15:01:57 -07:00
Tim Smith
b5ff949059 Update Ruby versions used for testing; fix Travis CI issues (#3678)
Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-12-20 22:17:07 -05:00
Clinton Wolfe
3c8697e5e2 Create a class to handle the plugins.json file (#3575)
* unit tests for plugin conf file class, all skip
* File path stuff works
* Validation works
* Add works
* Added remove_entry
* Save works - ready to refactor others
* Rework Loader to use ConfigFile
* Modify loader and installer to use the config file class
* linting

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-11-16 17:03:09 -05:00
Jerry Aldrich
0b0a0a4d48 Change Inspec to InSpec where appropriate (#3494)
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-10-15 12:09:46 -04:00
Clinton Wolfe
de5403d352 Plugins: Filter Plugins During Search and Install (#3458)
* Unit and functional tests for a reject list facility
* Implementation of plugin reject facility
* Initial draft of reject list
* Add option to search to hide test fixture by default
* Fix test
* PR feedback

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-10-11 14:05:57 -04:00
Jared Quick
2490a72c39 Fix plugin gem install code when deps cannot be resolved (#3453)
Signed-off-by: Jared Quick <jquick@chef.io>
2018-09-28 17:52:51 -04:00
Clinton Wolfe
7963131670 Plugins Installer API (#3352)
* Sketch out in comments the unit and functional tests for the installer
* Make a test fixture gem, v0.1.0
* Add a 0.2.0 version of the test fixture gem, this one with a dependency
* Add a fixture with a pre-installed gem
* Correct test-fixture 0.1.0 gem
* Moockup of installed inspec-test-fixture gems
* Uggh add gemspec files to mock installs
* Update gem fixtures, and add a script that does it for me
* Able to load from and list privately managed gems
# Conflicts:
#	lib/inspec/plugin/v2/loader.rb

* Expanded tests, starting on implementation of installer

# Conflicts:
#	test/unit/plugin/v2/loader_test.rb

* Install plugin from local gem file works
* Writes the plugins.json file; needs refactor
* Gem install works; no version pinning
* Install with pinned version works
* Install from path works
* update works
* Validation for uninstall
* Uninstall from path works
* Uninstaller works on gems
* Add search to installer API.


Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-09-19 17:38:13 -04:00